diff options
Diffstat (limited to 'components/script/dom/servoparser/mod.rs')
-rw-r--r-- | components/script/dom/servoparser/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 40f3da3c78e..1e172db35fd 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -558,6 +558,19 @@ impl ServoParser { Err(script) => script, }; + // https://html.spec.whatwg.org/multipage/#parsing-main-incdata + // branch "An end tag whose tag name is "script" + // The spec says to perform the microtask checkpoint before + // setting the insertion mode back from Text, but this is not + // possible with the way servo and html5ever currently + // relate to each other, and hopefully it is not observable. + if is_execution_stack_empty() { + self.document + .window() + .upcast::<GlobalScope>() + .perform_a_microtask_checkpoint(); + } + let script_nesting_level = self.script_nesting_level.get(); self.script_nesting_level.set(script_nesting_level + 1); |