mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Set descendant's attribute's owner document in Node::adopt (#35076)
* Set descendant's attribute's owner document in Node::adopt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add test that adopting an element into a new doc updates the attribute' owner docs Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
dabe162d44
commit
c070372d1e
4 changed files with 38 additions and 7 deletions
2
tests/wpt/meta/MANIFEST.json
vendored
2
tests/wpt/meta/MANIFEST.json
vendored
|
@ -606523,7 +606523,7 @@
|
|||
]
|
||||
],
|
||||
"Node-mutation-adoptNode.html": [
|
||||
"9c9594c07b22a4ac94b3703f8ab1711b41a759e4",
|
||||
"812a2e4d3af326c1e73115c6fc50726bc4fc4b23",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -20,4 +20,18 @@ test(() => {
|
|||
assert_equals(div.firstChild.ownerDocument, document);
|
||||
}, "simple append of foreign div with text");
|
||||
|
||||
test(function() {
|
||||
var div = document.createElement("div");
|
||||
div.id = "foobar";
|
||||
|
||||
assert_equals(div.ownerDocument, document);
|
||||
assert_equals(div.attributes[0].ownerDocument, document);
|
||||
|
||||
var other_doc = document.implementation.createHTMLDocument();
|
||||
other_doc.body.appendChild(div);
|
||||
|
||||
assert_equals(div.ownerDocument, other_doc);
|
||||
assert_equals(div.attributes[0].ownerDocument, other_doc);
|
||||
}, "Adopting an element into a different document update's the element's owner doc as well as the owner docs of it's attributes")
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue