mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
script: Do not track outdated oustanding loads for stylesheets. (#42208)
The `HTMLLinkElement::pending_loads` field should only be used to track outstanding loads for the current generation; any loads from previous generations can be ignored. This avoids confusion about when to dispatch load/error events. See https://github.com/servo/servo/issues/42187#issuecomment-3808888585 for more details about how the timing of multiple loads for the same `<link>` element resulted in intermittent timeouts in one WPT test. Testing: Intermittent failure did not appear within 75 runs; previously reproduced within 15. Fixes: #42187 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
@@ -379,13 +379,6 @@ impl FetchResponseListener for StylesheetContext {
|
||||
if !self.contributes_to_the_styling_processing_model(&element) {
|
||||
// Step 2.1. Remove el from el's node document's script-blocking style sheet set.
|
||||
self.decrement_load_and_render_blockers(&document);
|
||||
let owner = element
|
||||
.upcast::<Element>()
|
||||
.as_stylesheet_owner()
|
||||
.expect("Stylesheet not loaded by <style> or <link> element!");
|
||||
// Always consider ignored loads as successful, as they shouldn't cause any subsequent
|
||||
// successful loads to fire an "error" event.
|
||||
owner.load_finished(true);
|
||||
document.finish_load(LoadType::Stylesheet(self.url), CanGc::note());
|
||||
// Step 2.2. Return.
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user