mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Block rendering until linked stylesheets are loaded
This commit implements the main "render blocking" behavior for link elements, drastically reducing the amount of FOUC (flash of unstyled content) we subject our users to. The document will now block rendering until linked style sheets referenced by parser-created link elements have loaded (or failed). Note that we don't yet extend the blocking period until "critical subresources" such as imported style sheets have been downloaded as well.
This commit is contained in:
parent
5146bbe296
commit
043e96946f
Notes:
github-actions[bot]
2025-02-27 20:37:32 +00:00
Author: https://github.com/awesomekling
Commit: 043e96946f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3720
5 changed files with 52 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2023, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2018-2025, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
|
||||
* Copyright (c) 2023-2024, Shannon Booth <shannon@serenityos.org>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
|
@ -813,6 +813,8 @@ public:
|
|||
// https://html.spec.whatwg.org/multipage/dom.html#allows-adding-render-blocking-elements
|
||||
[[nodiscard]] bool allows_adding_render_blocking_elements() const;
|
||||
|
||||
[[nodiscard]] bool is_render_blocking_element(GC::Ref<Element>) const;
|
||||
|
||||
void add_render_blocking_element(GC::Ref<Element>);
|
||||
void remove_render_blocking_element(GC::Ref<Element>);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue