Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#13119 closed defect (fixed)

[regression] failure on ">" query in lite engine

Reported by: bill Owned by: Kris Zyp
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

See dijit/tests/form/mobile.html for test case, which was working a few days ago but fails to load now.

_FormSelectWidget._fillContent() calls:

dojo.query(">",  this.srcNodeRef)

which (at least on FF 3.6 and iPhone safari) calls:

return method.call(context, "[id='" + nid + "'] " + query ); 

essentially executing:

dojo.byId("s").querySelectorAll("[id='s'] >")

which errors as:

An invalid or illegal string was specified" code: "12
[Break on this error] return method.call(context, "[id='" + nid + "'] " + query ); 

Note that "s" is the id of the node:

<select id="s" data-dojo-type="dijit.form.Select">

Change History (7)

comment:1 Changed 8 years ago by bill

Description: modified (diff)
Milestone: tbd1.7

comment:2 Changed 8 years ago by bill

PS: perhaps the recent dijit granular dependency changes caused a switch from acme to lite.

comment:3 Changed 8 years ago by Kris Zyp

This is a combination of:

  • When you load Dojo in async mode, and you don't load full base, by default the lite/native engine will be used when full CSS3 support (WebKit? and Firefox).
  • ">" and "[name=value]>" are not valid CSS selectors (despite the fact that Acme supports them), so when querySelectorAll is called it throws an error. The correct syntax is ">*".

We should probably start using valid CSS selector syntax in Dojo (in that particular case, is there any reason we are not using childNodes?). I could add support for certain invalid selectors like ">", but obviously that adds weight to something that is supposed to stick to modern browser behavior as much as possible.

comment:4 Changed 8 years ago by bill

Component: QueryDijit

Ah thanks, yes of course I can switch dijit to use proper syntax, I don't want to add bulk to the lite engine, although it would be nice for you to document any gotchas like this in the release notes.

About childNodes, I think it could be used here although would need to filter out text nodes and perhaps comment nodes too, to get the same behavior as before. (I didn't write this code though.)

comment:5 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

(In [25296]) Fix non-standard syntax which works w/acme but not w/lite query engine, fixes #13119 !strict

comment:6 Changed 6 years ago by David W

So it seems the ">" selector is no longer supported. I see that it's been mostly removed from the documentation as well, but it lingers in at few places:

The example ".foo >" on these pages: http://dojotoolkit.org/reference-guide/1.8/dojo/query.html#example-selector-queries http://dojotoolkit.org/reference-guide/1.9/dojo/query.html#example-selector-queries

And in these two sections: http://dojotoolkit.org/reference-guide/1.7/dojo/query.html#immediate-child-elements http://dojotoolkit.org/reference-guide/1.7/dojo/query.html#descendant-selectors

Note: See TracTickets for help on using tickets.