mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Don't call bind_to_tree when appending a node to another node that isn't in the tree (fixes #1874).
This commit is contained in:
parent
bfb849bb04
commit
6ecb9ba4b6
2 changed files with 21 additions and 8 deletions
|
@ -405,10 +405,12 @@ impl NodeHelpers for JS<Node> {
|
|||
assert!(self.parent_node().is_some());
|
||||
let document = document_from_node(self);
|
||||
|
||||
for node in self.traverse_preorder() {
|
||||
if node.is_element() {
|
||||
let element: JS<Element> = ElementCast::to(&node);
|
||||
element.bind_to_tree_impl();
|
||||
if self.is_in_doc() {
|
||||
for node in self.traverse_preorder() {
|
||||
if node.is_element() {
|
||||
let element: JS<Element> = ElementCast::to(&node);
|
||||
element.bind_to_tree_impl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue