mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Properly insert text in document when parsing
If the last child of a node is a Text child and we are inserting text in that node, we need to append it to that Text child. Doing that means that HTMLStyleElement::children_changed gets called less frequently, but that's not a problem during parsing thanks to the pop hook.
This commit is contained in:
@@ -124,6 +124,14 @@ pub trait VirtualMethods {
|
||||
s.cloning_steps(copy, maybe_doc, clone_children);
|
||||
}
|
||||
}
|
||||
|
||||
/// Called on an element when it is popped off the stack of open elements
|
||||
/// of a parser.
|
||||
fn pop(&self) {
|
||||
if let Some(ref s) = self.super_type() {
|
||||
s.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Obtain a VirtualMethods instance for a given Node-derived object. Any
|
||||
|
||||
Reference in New Issue
Block a user