#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 14 years ago by
Cc: | Adam Peller added |
---|---|
Milestone: | → 1.2 |
Owner: | changed from anonymous to alex |
comment:2 Changed 14 years ago by
Status: | new → assigned |
---|
comment:3 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 13 years ago by
Component: | General → Query |
---|
(In [14415]) ensure that cross-document xpath-run queries don't bomb out on FF3 due to new security restrictions. Fixes #7075. !strict