Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9850 closed defect (worksforme)

dojo.query() exception when no root node specified in ff3.5

Reported by: mpalmer Owned by: alex
Priority: high Milestone: tbd
Component: Query Version: 1.3.1
Keywords: ff3.5 dojo.query Cc:
Blocked By: Blocking:

Description (last modified by Eugene Lazutkin)

The following simple snippet of code does not work in ff3.5:

dojo.query("> [widgetId]", undefined);

The error you get is "tret is undefined".

When no node is provided to dojo.query it takes the dojo.doc instead which is fine in earlier versions of ff. But, in ff3.5 the childNodesName is detected to be "children" instead of "childNodes" The check is for children being available on the firstChild of dojo.doc, but when dojo.query is called it must be available on dojo.doc directly which it isn't (no idea why ff3.5 works this way though).

This appeared for me when I had constructed a dijit with a grid inside without a explicit containerNode. On startup when getChildren is called on the grid it calls dojo.query without a node (since this.containerNode is not defined) and the error occurs.

Hence, there is a simple workaround, make sure dojo.query is never called wihout a node, in my case it was enough to make sure the containerNode is defined. But dojo.query should not break down so easily.

Change History (4)

comment:1 Changed 10 years ago by Eugene Lazutkin

Description: modified (diff)
Owner: changed from anonymous to alex

comment:2 Changed 10 years ago by bill

Summary: problem with dojo.query in ff3.5dojo.query() exception when no root node specified in ff3.5

This works fine for me, I just tried it in firebug after loading test_Menu.html FF3.5/mac and FF3.5/win, trunk and 1.3. Do you have a test case where it fails?

comment:3 Changed 10 years ago by bill

Resolution: worksforme
Status: newclosed

Please upload a test case if it's still failing, then reopen this ticket or write a comment here and we'll reopen it.

comment:4 Changed 10 years ago by bill

Component: CoreQuery
Note: See TracTickets for help on using tickets.