Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#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)

test.html (1.2 KB) - added by aurelien.baudet 9 years ago.
query.js (54.7 KB) - added by aurelien.baudet 9 years ago.
possible fix

Download all attachments as: .zip

Change History (13)

Changed 9 years ago by aurelien.baudet

Attachment: test.html added

Changed 9 years ago by aurelien.baudet

Attachment: query.js added

possible fix

comment:1 Changed 9 years ago by aurelien.baudet

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 9 years ago by aurelien.baudet

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:3 Changed 8 years ago by Chris Mitchell

Owner: changed from alex to dylan

please review/triage

comment:4 Changed 8 years ago by dylan

Milestone: tbd1.7
Owner: changed from dylan to kriszyp

comment:5 Changed 8 years ago by bill

Owner: changed from kriszyp to Kris Zyp

comment:6 Changed 8 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

(In [25510]) Use per element determination of children vs childNodes, fixes #12488 !strict

comment:7 Changed 6 years ago by Colin Snover <github.com@…>

In c67ea3e7a6463c8d5479b0c88007cd2c0c86443c/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:8 Changed 6 years ago by Colin Snover <github.com@…>

In 4b50371538c09375caf6072b7956c7a5dfd06f6b/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:9 Changed 6 years ago by Colin Snover <github.com@…>

In 819d5cded4dc99af6144a65b058ec1708cacf975/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:10 Changed 6 years ago by Colin Snover

Milestone: 1.71.4.4

comment:11 Changed 6 years ago by Colin Snover

Milestone: 1.4.41.4.5

Surprise! 1.4.4 was actually released over a year ago.

Note: See TracTickets for help on using tickets.