Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#7075 closed defect (fixed)

Firefox 3 XPath changes break dojo.query

Reported by: guest Owned by: alex
Priority: high Milestone: 1.2
Component: Query Version: 1.1.1
Keywords: Cc: Adam Peller
Blocked By: Blocking:

Description

If you have dojo.query and you want to query another document (say an iframe document):

dojo.query(".foo", iframeDocument);

In firefox 3, you will get: [Exception... "Node cannot be used in a document other than the one in which it was created" code: "4" nsresult: "0x80530004 (NS_ERROR_DOM_WRONG_DOCUMENT_ERR)" location: "file:///c:/mystuff/ibm/madlib/svn/trunk/lib/dojo-release-1.1.1/dojo/dojo.js.uncompressed.js Line: 5955"] constructor=DOMException code=4 INDEX_SIZE_ERR=1

This is due to a Firefox 3 change (see http://weblogs.mozillazine.org/doron/archives/2008/06/documentcreateexpression_chang.html). Dojo is doing:

xpathResult = doc.evaluate(xpath, parent, null, ...

The code needs to use parent's ownerDocument (should parent exist).

Change History (4)

comment:1 Changed 11 years ago by Adam Peller

Cc: Adam Peller added
Milestone: 1.2
Owner: changed from anonymous to alex

comment:2 Changed 11 years ago by alex

Status: newassigned

comment:3 Changed 11 years ago by alex

Resolution: fixed
Status: assignedclosed

(In [14415]) ensure that cross-document xpath-run queries don't bomb out on FF3 due to new security restrictions. Fixes #7075. !strict

comment:4 Changed 10 years ago by bill

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