Skip to content

Commit

Permalink
spec compliant active parser concept
Browse files Browse the repository at this point in the history
  • Loading branch information
gterzian committed Jul 29, 2018
1 parent f2ee941 commit e49c8e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/script/dom/document.rs
Expand Up @@ -3927,7 +3927,7 @@ impl DocumentMethods for Document {
return Err(Error::Security);
}

if self.get_current_parser().map_or(false, |parser| parser.script_nesting_level() > 0) {
if self.get_current_parser().map_or(false, |parser| parser.is_active()) {
// Step 5.
return Ok(DomRoot::from_ref(self));
}
Expand Down
5 changes: 5 additions & 0 deletions components/script/dom/servoparser/mod.rs
Expand Up @@ -344,6 +344,11 @@ impl ServoParser {
self.document.set_ready_state(DocumentReadyState::Interactive);
}

// https://html.spec.whatwg.org/multipage/#active-parser
pub fn is_active(&self) -> bool {
self.script_nesting_level() > 0 && !self.aborted.get()
}

#[allow(unrooted_must_root)]
fn new_inherited(document: &Document,
tokenizer: Tokenizer,
Expand Down

0 comments on commit e49c8e7

Please sign in to comment.