#14381 closed bug (fixed)
.add() throws "no such interface" in IE when adding nodes from another window
Reported by: | Owned by: | gibson042 | |
---|---|---|---|
Priority: | low | Milestone: | 1.11/2.1 |
Component: | selector | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
- Open a new window, either with
target="_blank"
orwindow.open
- In child window, create a bag of nodes with $(...), containing at least one node
- Add a node from the parent window, using collection.add(...)
- Expected (actual in Chrome and FF): the collection now contains elements from both windows
- Actual (Internet Explorer 10): throws error "No such interface supported"
This happens because .add()
uses Node.compareDocumentPosition
on line 1704 (jquery-1.10.2). Internet Explorer appears unable to use that function against nodes from different windows
Test case: http://jsbin.com/etUvODu/2/
Change History (5)
comment:1 follow-up: 2 Changed 9 years ago by
comment:2 Changed 9 years ago by
Owner: | set to gibson042 |
---|---|
Status: | new → assigned |
Replying to dmethvin:
Perhaps it could be turned into a
$.fn.adopt()
method that called.adoptNode()
on the nodes to make it safe to append them?
These is obviously a rare case (and no doubt present for a looong time), but the root issue is in Sizzle's uniqueSort, not jQuery append. I'm willing to look into it.
comment:4 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fix #14381: Update to Sizzle 1.10.11 (cherry picked from commit 64bdf4140b58c6dae72db78fc2f02832ed51a863)
Changeset: c93743b4faf7db5e2b95eee287adaece975541e3
comment:5 Changed 9 years ago by
Component: | unfiled → selector |
---|---|
Milestone: | None → 1.11/2.1 |
Priority: | undecided → low |
See this documentation: http://www.w3.org/DOM/faq.html#ownerdoc
Technically you are supposed to use
.adoptNode()
or.importNode()
in these cases. It's rare enough that I don't think we would want to add code to guard against it everywhere.Perhaps it could be turned into a
$.fn.adopt()
method that called.adoptNode()
on the nodes to make it safe to append them?