mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-07 11:42:51 +00:00
LibWeb: Implement more of the "script-blocking style sheet" mechanism
The basic idea is that style sheets can block script execution under some circumstances. With this commit, we now handle the simplest cases where a parser-inserted link element gets to download its style sheet before script execution continues. This improves performance on Speedometer 3 where JavaScript APIs that depend on layout results (like Element.scrollIntoView()) would get called too early (before the relevant CSS was downloaded), and so we'd perform premature layout work. This work then had to be redone after downloading the CSS anyway, wasting time. Note that our Text/input/link-re-enable-crash.html test had to be tweaked after these changes, since it relied on the old, incorrect, behavior where scripts would run before downloading CSS.
This commit is contained in:
parent
8e37cd2f71
commit
0c0650e60a
Notes:
github-actions[bot]
2025-04-20 12:55:15 +00:00
Author: https://github.com/awesomekling
Commit: 0c0650e60a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4407
9 changed files with 101 additions and 18 deletions
|
@ -30,6 +30,8 @@ public:
|
|||
CSS::CSSStyleSheet* sheet();
|
||||
CSS::CSSStyleSheet const* sheet() const;
|
||||
|
||||
virtual bool contributes_a_script_blocking_style_sheet() const final;
|
||||
|
||||
private:
|
||||
HTMLStyleElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue