#12488 closed defect (fixed)
dojo.query on xml nodes in IE
Reported by: | aurelien.baudet | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.4.5 |
Component: | Query | Version: | 1.5 |
Keywords: | query xml | Cc: | |
Blocked By: | Blocking: |
Description
dojo.query fails when trying to access direct children using '>' selector on xml content in IE. It throws an error in this code:
var te, x = 0, tret = root[childNodesName]
It tries to get rootchildren? but it's not defined... The bug comes from childNodesName because it values "children" and not "childNodes" due to the code below that tests if children is available but on dojo.doc and not on the real document of the node:
var childNodesName = !!getDoc().firstChild["children"] ? "children" : "childNodes";
and getDoc:
var getDoc = function(){ return d.doc; };
I attached a file in order to reproduce the bug easily.
Attachments (2)
Change History (13)
Changed 10 years ago by
Changed 10 years ago by
comment:1 Changed 10 years ago by
I found a possible correction but it needs more tests and check performances (file attached): line 148
var childNodesName = function(root) { return !!root.firstChild["children"] ? "children" : "childNodes"; };
line 594
tret = root[childNodesName(root)],
line 875
var te, x = 0, tret = root[childNodesName(root)];
comment:2 Changed 10 years ago by
Oups I made an error in my correction:
line 148
var childNodesName = function(root) { return !!root["children"] ? "children" : "childNodes"; };
And the doh test for dojo.query pass with this correction
comment:4 Changed 10 years ago by
Milestone: | tbd → 1.7 |
---|---|
Owner: | changed from dylan to kriszyp |
comment:5 Changed 10 years ago by
Owner: | changed from kriszyp to Kris Zyp |
---|
comment:6 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:10 Changed 8 years ago by
Milestone: | 1.7 → 1.4.4 |
---|
comment:11 Changed 8 years ago by
Milestone: | 1.4.4 → 1.4.5 |
---|
Surprise! 1.4.4 was actually released over a year ago.
possible fix