aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/servoparser/mod.rs
diff options
context:
space:
mode:
authorPatrick Shaughnessy <pshaughn@comcast.net>2020-01-13 18:32:16 -0500
committerPatrick Shaughnessy <pshaughn@comcast.net>2020-01-15 11:49:52 -0500
commitc725f9e84da3f75e2812452567e146a946d01438 (patch)
treec2c4dafff873e0daeb109dad32a593977ff4b996 /components/script/dom/servoparser/mod.rs
parent2373769e766aa6794bd141cd2da137e71a580c86 (diff)
downloadservo-c725f9e84da3f75e2812452567e146a946d01438.tar.gz
servo-c725f9e84da3f75e2812452567e146a946d01438.zip
Add microtask checkpoints on </script> and CE construct
Diffstat (limited to 'components/script/dom/servoparser/mod.rs')
-rw-r--r--components/script/dom/servoparser/mod.rs13
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);