#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 )
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 11 years ago by
Description: | modified (diff) |
---|---|
Milestone: | tbd → 1.7 |
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
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 11 years ago by
Component: | Query → Dijit |
---|
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 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 Changed 9 years ago by
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
comment:7 Changed 9 years ago by
Makes sense, I removed those examples from the doc in:
- https://github.com/dojo/docs/commit/09db308bc75c8bfed1a58b578e5972a34f08de8d
- https://github.com/dojo/docs/commit/bcd4fcaa0513ebd616d3aee33b4fab971fd25d02
- https://github.com/dojo/docs/commit/21ab47503111d67d810360a37a3a9edd2936ccc3
- https://github.com/dojo/docs/commit/fbfff88763bd1702543bc6af2274f7ea8df55f89
PS: perhaps the recent dijit granular dependency changes caused a switch from acme to lite.