Introduce ServoParser::pipeline

This commit is contained in:
Anthony Ramine 2016-10-08 23:50:58 +02:00
parent 02162a8bda
commit 1f23810a34
3 changed files with 19 additions and 15 deletions

View file

@ -38,9 +38,6 @@ pub struct ServoXMLParser {
tokenizer: DOMRefCell<Tokenizer>,
/// True if this parser should avoid passing any further data to the tokenizer.
suspended: Cell<bool>,
/// The pipeline associated with this parse, unavailable if this parse does not
/// correspond to a page load.
pipeline: Option<PipelineId>,
}
impl<'a> Parser for &'a ServoXMLParser {
@ -61,7 +58,7 @@ impl<'a> Parser for &'a ServoXMLParser {
self.upcast().document().set_current_parser(None);
if let Some(pipeline) = self.pipeline {
if let Some(pipeline) = self.upcast().pipeline() {
ScriptThread::parsing_complete(pipeline);
}
}
@ -81,10 +78,9 @@ impl ServoXMLParser {
let tok = tokenizer::XmlTokenizer::new(tb, Default::default());
let parser = ServoXMLParser {
servoparser: ServoParser::new_inherited(document, false),
servoparser: ServoParser::new_inherited(document, pipeline, false),
tokenizer: DOMRefCell::new(tok),
suspended: Cell::new(false),
pipeline: pipeline,
};
reflect_dom_object(box parser, document.window(), ServoXMLParserBinding::Wrap)