Opened 11 years ago

Closed 8 years ago

#7345 closed defect (fixed)

dojo.query I.E children property not document object

Reported by: dave_daniel Owned by: dylan
Priority: low Milestone: 1.7
Component: Query Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:

Description

in dojo._base.query 'childNodesName' is set to 'children' if browser is IE but in the function _childElements if the document object is passed in the line 'tret = root[childNodesName];' will fail because the document object doesn't have a children property. You will probably need to see if root is a document object and if it is then use 'childNodes' instead of 'children'

Attachments (1)

dojo-query-ie.html (440 bytes) - added by navtej 10 years ago.
simple test case that throws an error immediately

Download all attachments as: .zip

Change History (16)

comment:1 Changed 11 years ago by dylan

Keywords: query added
Milestone: tbd1.2
Owner: changed from anonymous to alex

comment:2 Changed 11 years ago by bill

Milestone: 1.21.3

as per today's meeting, punting these core bugs

comment:3 Changed 11 years ago by alex

is there a unit test that shows the failure? I'm somewhat disinclined to fix w/o a test case since I'm having a hard time imagining one that would fail but where we would also pass the current unit tests.

comment:4 Changed 11 years ago by alex

Status: newassigned

comment:5 Changed 11 years ago by bill

Milestone: 1.31.4

1.3rc1 has been release; bumping remaining tickets to 1.4 (except for documentation/testing tickets)

comment:6 Changed 10 years ago by bill

Component: GeneralQuery

comment:7 Changed 10 years ago by James Burke

Milestone: 1.4tbd
Resolution: invalid
Status: assignedclosed

Alex indicated needing a test to see where this would fail, but no test so far. Closing for now, but feel free to reopen with a test case.

comment:8 Changed 10 years ago by navtej

Resolution: invalid
Status: closedreopened

The following simple code will cause this error to happen in IE8 with the document in IE7 standards mode:

dojo.query("> [widgetid]");

I used the following docType:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

I encountered this when dijit calls _Widget.destroyRecursive on a dijit._Container during page-unload. This invokes the aforementioned dojo.query call, but with a second argument of "this.containerNode". Unfortunately, this.containerNode is null (presumably because the page is in the process of unloading?).

Changed 10 years ago by navtej

Attachment: dojo-query-ie.html added

simple test case that throws an error immediately

comment:9 Changed 10 years ago by bill

Not sure why you are seeing that problem on page unload (where this.containerNode is not set) but if you have a test case please file a separate ticket. Sounds like things are getting destroyed out of order. I know _Templated.destroyRendering() nulls out attach points to prevent memory leaks but it should run last, after destroyDescendants().

comment:10 Changed 10 years ago by navtej

Yeah, I haven't nailed that (page unload) case quite down, so I'm not certain about it. Regardless, the one-liner in my test-case above triggers an error, and I believe the behavior is exactly as stated in the original description of this bug. That is, this particular bug has little to do with page unload or destroyRecursive, that just happened to be where it was manifesting for me.

comment:11 Changed 9 years ago by James Burke

Milestone: tbdfuture

comment:12 Changed 9 years ago by virsir

I got the same problem, it occurs in some places that I call destroyRecursive method on some widgets, it fails on the getChildren method which use css query "> [widgetId]". IE8, dojo 1.4.3. Ref #11378

comment:13 Changed 9 years ago by Chris Mitchell

Owner: changed from alex to dylan

please review/triage

comment:14 Changed 8 years ago by ben hockey

Keywords: needsreview added
Priority: highlow

comment:15 Changed 8 years ago by bill

Keywords: query needsreview removed
Milestone: future1.7
Resolution: fixed
Status: reopenedclosed

Kris fixed in [25510].

Note: See TracTickets for help on using tickets.