Opened 12 years ago
Closed 9 years ago
#10029 closed defect (fixed)
NodeList children() and filter() query fails
Reported by: | Les | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Query | Version: | 1.3.2 |
Keywords: | dojo.NodeList-traverse | Cc: | dante, Eugene Lazutkin, alex, Kris Zyp |
Blocked By: | Blocking: |
Description
This might be related to ticket #9665.
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/tests/NodeList-manipulate.html
dojo.require('dojo.NodeList-traverse'); dojo.query('form').children(':not(textarea)'); // returns [] <== bad dojo.query('form').children().filter(':not(textarea)'); // returns [] <== bad dojo.query('form>*:not(textarea)'); // returns [div.myClass, div.myClass] <== OK
Change History (8)
comment:1 Changed 12 years ago by
Cc: | dante Eugene Lazutkin alex added |
---|
comment:2 Changed 12 years ago by
I'm curious how much slower the "enhanced" .query is compared to the "limited" filter.
comment:3 Changed 12 years ago by
dojox.jq compatibility layer will not match jQuery unless this ticket is fixed.
comment:4 Changed 12 years ago by
Owner: | changed from anonymous to James Burke |
---|
comment:5 Changed 11 years ago by
(In [20617]) Refs #10029: fixes the children() method and all NodeList?-traverse methods to use a slower dojo.query-based filter vs dojo._filterQueryResult. It allows more types of CSS selectors. Updated dojocampus docs for -travers. Leaving the ticket open to figure out what to do for dojo.NodeList?'s .filter method, but will be pushing that out to another milestone.
comment:6 Changed 11 years ago by
comment:7 Changed 11 years ago by
Milestone: | tbd → future |
---|
comment:8 Changed 9 years ago by
Cc: | Kris Zyp added |
---|---|
Component: | General → Query |
Milestone: | future → 1.7 |
Resolution: | → fixed |
Status: | new → closed |
It's working now, probably due to the new dojo/query module and related code.
I consider this a dupe of #9665, the issue mainly is that children() uses filter() underneath, and filter is limited to very simple selectors. For the second example, using query() instead of filter works:
So the fix for children() is to not use filterQueryResult (which is what filter() uses) and just a query call (what #9665 is tracking). However it will be a slower call.
I wouldn't mind changing dojo.NodeList?'s filter to just be an alias to query(), but it is a slight change in behavior (but for the good, allows more selectors?), and it will be slower, but I think not having the qualification about the types of selectors will make it easier to use.
Peter, Eugene, Alex, any thoughts on mapping dojo.NodeList?'s filter() to be just query()?