mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Process deferred scripts less often
Only do it from finish_load when a stylesheet finished loading, and from deferred_script_loaded directly.
This commit is contained in:
parent
9912721f06
commit
1bf0db5537
1 changed files with 2 additions and 1 deletions
|
@ -1547,7 +1547,7 @@ impl Document {
|
||||||
loader.finish_load(&load);
|
loader.finish_load(&load);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let LoadType::Script(_) = load {
|
if let LoadType::Stylesheet(_) = load {
|
||||||
self.process_deferred_scripts();
|
self.process_deferred_scripts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1636,6 +1636,7 @@ impl Document {
|
||||||
/// https://html.spec.whatwg.org/multipage/#prepare-a-script step 22.d.
|
/// https://html.spec.whatwg.org/multipage/#prepare-a-script step 22.d.
|
||||||
pub fn deferred_script_loaded(&self, element: &HTMLScriptElement, result: ScriptResult) {
|
pub fn deferred_script_loaded(&self, element: &HTMLScriptElement, result: ScriptResult) {
|
||||||
self.deferred_scripts.loaded(element, result);
|
self.deferred_scripts.loaded(element, result);
|
||||||
|
self.process_deferred_scripts();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://html.spec.whatwg.org/multipage/#the-end step 3.
|
/// https://html.spec.whatwg.org/multipage/#the-end step 3.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue