Opened 16 years ago

Closed 15 years ago

#959 closed defect (wontfix)

Regression: dojo.html.getElementsByClass returns nothing if parentNode is not part of the DOM

Reported by: anonymous Owned by: dylan
Priority: high Milestone: 0.9
Component: HTML Version: 0.3
Keywords: Cc:
Blocked By: Blocking:


Execute the following in Firebug:

foo = dojo.html.createNodesFromText('<div><span class="bar"></span></div>')[0] dojo.html.getElementsByClass("bar", foo)

foo is a div containing a span with class "bar". So you would expect getElementsByClass("bar", foo) to return the span. However it returns an empty array in Dojo 0.3.1.

This worked in Dojo 0.3.0

What may be happening is that the new XQuery implementation of dojo.html.getElementsByClass may not work if the parent is not connected to the DOM?

Change History (9)

comment:1 Changed 16 years ago by dylan

Milestone: 0.4
Owner: changed from anonymous to dylan

comment:2 Changed 16 years ago by dylan

Status: newassigned

comment:3 Changed 15 years ago by dylan

Component: GeneralHTML
Owner: changed from dylan to Bryan Forbes
Status: assignednew

I suggest we disable the xpath version of this until we can fully test it... Bryan, can you handle this.

comment:4 Changed 15 years ago by dylan

(In [6203]) references #456, references #959, temporary workaround until we figure out why the xpath version of getElementsByClass does not work 100% reliably in firefox

comment:5 Changed 15 years ago by dylan


comment:6 Changed 15 years ago by bill


This is working as per temporary fix above.

comment:7 Changed 15 years ago by dylan

Owner: changed from Bryan Forbes to dylan
Status: newassigned

comment:8 Changed 15 years ago by Adam Peller

getElementsByClass() was replaced in 0.9 by dojo.query. Not sure if we support createNodesFromText or if this interaction would still fail

comment:9 Changed 15 years ago by Adam Peller

Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.