mirror of
https://github.com/servo/servo.git
synced 2025-06-13 02:44:29 +00:00
spec compliant active parser concept
This commit is contained in:
parent
f2ee941da2
commit
e49c8e7f26
2 changed files with 6 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue