mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Simplify processing of deferred scripts
It is now done on-demand when a deferred script finished loading, and when the page source finished loading.
This commit is contained in:
parent
abdb390da8
commit
e9feb20775
2 changed files with 11 additions and 6 deletions
|
@ -1547,9 +1547,15 @@ impl Document {
|
|||
loader.finish_load(&load);
|
||||
}
|
||||
|
||||
if let LoadType::Stylesheet(_) = load {
|
||||
self.process_deferred_scripts();
|
||||
self.process_pending_parsing_blocking_script();
|
||||
match load {
|
||||
LoadType::Stylesheet(_) => {
|
||||
self.process_deferred_scripts();
|
||||
self.process_pending_parsing_blocking_script();
|
||||
},
|
||||
LoadType::PageSource(_) => {
|
||||
self.process_deferred_scripts();
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
if !self.loader.borrow().is_blocked() && !self.loader.borrow().events_inhibited() {
|
||||
|
@ -1638,7 +1644,7 @@ impl Document {
|
|||
}
|
||||
|
||||
/// https://html.spec.whatwg.org/multipage/#the-end step 3.
|
||||
pub fn process_deferred_scripts(&self) {
|
||||
fn process_deferred_scripts(&self) {
|
||||
if self.ready_state.get() != DocumentReadyState::Interactive {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue