Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#971 closed defect (fixed)

dojo.html.getElementsByClass doesn't respect the scoping node on firefox

Reported by: dojo@… Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

When using dojo.html.getElementsByClass, the scoping node is not respected on firefox (or possibly other browsers that supports document.evaluate). Attached is a patch to test_html.html that repros the problem.

Attachments (2)

scoped_getElementsByClass_test.patch (1.2 KB) - added by dojo@… 13 years ago.
test case patch for test_html.html
dojo.html.getElementsByClass-xpath-fix.diff (553 bytes) - added by akaihola 13 years ago.
patch verified to work in Firefox 1.5.0.4 and Epiphany 2.14.1.1

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by dojo@…

test case patch for test_html.html

comment:1 Changed 13 years ago by dojo@…

Version: 0.20.4

Also, I have a CLA on file. Probably under ben AT blowery.org (Ben Lowery)

comment:2 Changed 13 years ago by bill

Milestone: 0.4
Version: 0.40.3

Just fixing (the cryptic) version and milestone fields.

comment:3 Changed 13 years ago by akaihola

Here's the fix which was posted as #1079:

change

var xpath = "//" + (nodeType "*") + "[contains(";

to

var xpath = ".//" + (nodeType "*") + "[contains(";

in dojo.html.getElementsByClass

Meanwhile a work-around is to specify true as the fifth (useNonXpath) argument to dojo.html.getElementsByClass(). An example:

dojo.html.getElementsByClass("classname", parent, null, null, true)

instead of the non-functional

dojo.html.getElementsByClass("classname", parent)

Changed 13 years ago by akaihola

patch verified to work in Firefox 1.5.0.4 and Epiphany 2.14.1.1

comment:4 Changed 13 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

Fixed in the html-refactor.

comment:5 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.