Implement the create an element for token algorithm

This commit is contained in:
Connor Brewster 2017-11-27 13:55:46 -06:00 committed by Josh Matthews
parent 9b3fc43f5a
commit 87475b11d3
4 changed files with 127 additions and 40 deletions

View file

@ -16,7 +16,7 @@ use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmltemplateelement::HTMLTemplateElement;
use dom::node::Node;
use dom::processinginstruction::ProcessingInstruction;
use dom::servoparser::Sink;
use dom::servoparser::{ParsingAlgorithm, Sink};
use html5ever::QualName;
use html5ever::buffer_queue::BufferQueue;
use html5ever::serialize::{AttrRef, Serialize, Serializer};
@ -39,13 +39,15 @@ impl Tokenizer {
pub fn new(
document: &Document,
url: ServoUrl,
fragment_context: Option<super::FragmentContext>)
fragment_context: Option<super::FragmentContext>,
parsing_algorithm: ParsingAlgorithm)
-> Self {
let sink = Sink {
base_url: url,
document: Dom::from_ref(document),
current_line: 1,
script: Default::default(),
parsing_algorithm: parsing_algorithm,
};
let options = TreeBuilderOpts {