mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Delay the load event until critical style subresources load
Previously, `<link rel=stylesheet>` would delay the load event until its style sheet loaded, but not care about its subresources. `<style>` would not delay the load event at all. Instead, each `@import` would delay the load event. Now, both `<style>` and `<link>` delay the load event until their style sheet and its critical subresources have loaded or failed. This means that CSSImportRules no longer need to delay the load event themselves, because they do so implicitly as a critical subresource of their parent style sheet. This doesn't directly affect behavior, but means that any other critical style resources we add will automatically delay the load event. One wrinkle here is that the spec for the `<link>` element requires that we wait for the style sheet's critical subresources *before* we create a CSSStyleSheet, which means we don't yet know what those are. https://html.spec.whatwg.org/multipage/semantics.html#fetching-and-processing-a-resource-from-a-link-element:critical-subresources For now we simply ignore this, as we did before. That means we continue to not delay the `<link>`'s load event.
This commit is contained in:
committed by
Andreas Kling
parent
b21a05d290
commit
873680a504
Notes:
github-actions[bot]
2026-02-12 15:24:26 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/873680a5046 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7787
@@ -11,7 +11,6 @@
|
||||
#include <LibWeb/CSS/CSSRule.h>
|
||||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
#include <LibWeb/CSS/URL.h>
|
||||
#include <LibWeb/DOM/DocumentLoadEventDelayer.h>
|
||||
#include <LibWeb/Export.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
@@ -67,7 +66,6 @@ private:
|
||||
RefPtr<Supports> m_supports;
|
||||
GC::Ref<MediaList> m_media;
|
||||
GC::Ptr<CSSStyleSheet> m_style_sheet;
|
||||
Optional<DOM::DocumentLoadEventDelayer> m_document_load_event_delayer;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
||||
Reference in New Issue
Block a user