diff options
author | Chris Paris <cap@chrisparis.org> | 2014-12-17 17:40:38 -1000 |
---|---|---|
committer | Chris Paris <cap@chrisparis.org> | 2014-12-17 17:40:38 -1000 |
commit | 96f73d67d40e9010c3a791bfc3342a237610ac2c (patch) | |
tree | 3a01dc4e76b5f08b6a9c7f73e350b87c1886fadb /components/script/parse/html.rs | |
parent | fbf42c951b2f53d91e2f32f8035484a07ea83493 (diff) | |
download | servo-96f73d67d40e9010c3a791bfc3342a237610ac2c.tar.gz servo-96f73d67d40e9010c3a791bfc3342a237610ac2c.zip |
Use `parse_html` in DOMParser.
Diffstat (limited to 'components/script/parse/html.rs')
-rw-r--r-- | components/script/parse/html.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index 99d23e33674..ab30802d16e 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -168,7 +168,10 @@ pub fn parse_html(document: JSRef<Document>, let parser = ServoHTMLParser::new(Some(url.clone()), document).root(); let parser: JSRef<ServoHTMLParser> = *parser; - task_state::enter(IN_HTML_PARSER); + let nested_parse = task_state::get().contains(task_state::IN_HTML_PARSER); + if !nested_parse { + task_state::enter(IN_HTML_PARSER); + } match input { HTMLInput::InputString(s) => { @@ -201,7 +204,9 @@ pub fn parse_html(document: JSRef<Document>, parser.finish(); - task_state::exit(IN_HTML_PARSER); + if !nested_parse { + task_state::exit(IN_HTML_PARSER); + } debug!("finished parsing"); } |