mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01: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:
parent
8caa564540
commit
0cb09468a0
17 changed files with 72 additions and 31 deletions
|
@ -17,6 +17,7 @@ use dom::htmlscriptelement::HTMLScriptElement;
|
|||
use dom::node::Node;
|
||||
use dom::processinginstruction::ProcessingInstruction;
|
||||
use dom::text::Text;
|
||||
use dom::virtualmethods::vtable_for;
|
||||
use html5ever::tokenizer::buffer_queue::BufferQueue;
|
||||
use html5ever_atoms::{Prefix, QualName};
|
||||
use js::jsapi::JSTracer;
|
||||
|
@ -196,4 +197,9 @@ impl TreeSink for Sink {
|
|||
NextParserState::Continue
|
||||
}
|
||||
}
|
||||
|
||||
fn pop(&mut self, node: Self::Handle) {
|
||||
let node = Root::from_ref(&*node);
|
||||
vtable_for(&node).pop();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue