Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#17400 closed defect (fixed)

Chrome 29 breaks dojo.query in Dojo 1.4.4 through Dojo 1.6 (minimum)

Reported by: Jared Jurkiewicz Owned by:
Priority: blocker Milestone: 1.4.5
Component: Query Version: 1.4.3
Keywords: Cc:
Blocked By: Blocking:


This just hit us today in application testing. This first hit with dijit.form.Select usage, where it was throwing the error getAttribute is not a function. This was traced down to dojo.query. In the _FormSelectWidget there is this function: _fillContent: function(){ summary: Loads our options and sets up our dropdown correctly. We don't want any content, so we don't call any inherit chain function. var opts = this.options; if(!opts){

opts = this.options = this.srcNodeRef ? dojo.query(">", * this.srcNodeRef).map(function(node){ if(node.getAttribute("type") === "separator"){ return { value: "", label: "", selected: false, disabled: false }; } return { value: node.getAttribute("value"), label: String(node.innerHTML),

selected: node.getAttribute("selected") disabled: node.getAttribute("disabled")
false };

}, this) : []; }

The call dojo.query(">") is returning Text Nodes (node type 3 and Entity nodes) now on Chrome 29. This is causing any usage of Select in a template that happened to leave any text (whitespace included) to die horribly. You can actually see this in play just using a straight dojo test case. Load any file, for example:


Load this in Chrome 29. It dies horribly with the console error: Uncaught TypeError?: Object #<Text> has no method 'getAttribute' test_Select.html:468

You can also just open the Chrome 29 console and run: dojo.query(">") in it, and it'll return an array of textnodes and regular element nodes.

If you run the same command in Firefox, it just returns DOM nodes.

So something has regressed/broken with Dojo 1.4.4 and Chrome 29. It may very well be a bug in Chrome 29's QSA implementation.

The same failure I can verify occurs from Dojo 1.4 through Dojo 1.6. Dojo 1.8+ are fine.

This is a serious issue for any apps build on anything prior to 1.8.

Change History (6)

comment:1 Changed 5 years ago by bill

It was fixed in fc262d0d589c490cdd671791f1546a4665ed69c6, ticket #12488.

BTW, I also tried "> *" but that has the same issue. On test_Select.html you can do:

dojo.query("> *", dojo.query("span")[3])

to reproduce. Incidentally dojo.query(">") also grabs the DOCTYPE.

comment:2 Changed 5 years ago by Colin Snover

Component: GeneralQuery
Milestone: tbd1.4.4
Priority: undecidedblocker
Resolution: fixed
Status: newclosed

The fix from fc262d0d has been backported through to 1.4. Because it was a straight cherry pick, the commits went to #12488.

comment:3 Changed 5 years ago by Colin Snover


Surprise! 1.4.4 was actually released over a year ago.

comment:4 Changed 5 years ago by nullio

Same behavior in v 1.6.1 (24595), is it possible to indicate me which version should we use in order to keep using 1.6.x and get rid of this issue?

comment:5 Changed 5 years ago by dylan

@nullio 1.6.2 fixes this: (as does 1.4.5 and 1.5.3, in case anyone looks at this ticket in the future for updates to those versions)

comment:6 in reply to:  5 Changed 5 years ago by nullio

Replying to dylan:

@nullio 1.6.2 fixes this: (as does 1.4.5 and 1.5.3, in case anyone looks at this ticket in the future for updates to those versions)

Thanks a lot!

Note: See TracTickets for help on using tickets.