From b7bff424dada8de086f5b9da9208a90a2702ddbf Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 31 Dec 2015 11:16:09 -0500 Subject: [PATCH] Reorder marking of pending parser-blocking scripts to avoid reentrancy. In cases where a pending parser-blocking script is executing, if the script caused another load to complete (eg. by removing a pending iframe from the DOM, thus terminating the load) then the currently-executing script would attempt to execute itself again. --- components/script/dom/document.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 854dc5a195c..18cbbabf15c 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -1296,8 +1296,8 @@ impl Document { }; if self.script_blocking_stylesheets_count.get() == 0 && script.is_ready_to_be_executed() { - script.execute(); self.pending_parsing_blocking_script.set(None); + script.execute(); return ParserBlockedByScript::Unblocked; } ParserBlockedByScript::Blocked