ladybird/Userland/Libraries/LibWeb/CSS
Andreas Kling 646b37d1a9 LibWeb: Cache CSS rules in buckets to reduce number of rules checked
This patch introduces the StyleComputer::RuleCache, which divides all of
our (author) CSS rules into buckets.

Currently, there are two buckets:
- Rules where a specific class must be present.
- All other rules.

This allows us to check a significantly smaller set of rules for each
element, since we can skip over any rule that requires a class attribute
not present on the element.

This takes the typical numer of rules tested per element on Discord from
~16000 to ~550. :^)

We can definitely improve the cache invalidation. It currently happens
too often due to media queries. And we also need to make sure we
invalidate when mutating style through CSSOM APIs.
2022-02-10 20:52:11 +01:00
..
Parser LibWeb: Parse multiple box-shadows :^) 2022-02-08 17:45:51 +01:00
SyntaxHighlighter
.gitignore
ComputedValues.h LibWeb: Incorporate spread-distance into box-shadow rendering 2022-02-08 17:45:51 +01:00
CSSConditionRule.cpp
CSSConditionRule.h
CSSConditionRule.idl
CSSGroupingRule.cpp
CSSGroupingRule.h
CSSGroupingRule.idl
CSSImportRule.cpp LibWeb: Make CSSImportRule::m_document a WeakPtr 2021-12-06 19:22:16 +01:00
CSSImportRule.h Everywhere: Fix -Winconsistent-missing-override warnings from Clang 2021-12-11 13:14:15 -08:00
CSSMediaRule.cpp
CSSMediaRule.h
CSSRule.cpp
CSSRule.h LibWeb: Make CSSStyleSheet::m_owner_css_rule a WeakPtr 2021-12-06 19:22:16 +01:00
CSSRule.idl
CSSRuleList.cpp LibWeb: Remove duplicate checks in for_each_effective_style_rule() 2022-01-23 01:22:41 +01:00
CSSRuleList.h
CSSRuleList.idl
CSSStyleDeclaration.cpp
CSSStyleDeclaration.h LibWeb: Include custom properties in CSS dump 2021-12-09 21:30:31 +01:00
CSSStyleDeclaration.idl
CSSStyleRule.cpp
CSSStyleRule.h
CSSStyleRule.idl
CSSStyleSheet.cpp
CSSStyleSheet.h LibWeb: Make StyleSheet::m_parent_style_sheet a WeakPtr 2021-12-06 19:22:16 +01:00
CSSStyleSheet.idl
CSSSupportsRule.cpp
CSSSupportsRule.h
Default.css LibWeb: Make attribute hidden have an effect; hide some other elements 2022-01-22 01:28:42 +00:00
Display.h
GeneralEnclosed.h LibWeb: Implement independent GeneralEnclosed class 2021-11-24 22:57:46 +01:00
Identifiers.json LibWeb: Parse display: inline-flex 2022-02-07 21:55:12 +01:00
Length.cpp LibWeb: Replace Length::set_calculated_style() with ::make_calculated() 2022-02-04 13:52:02 +01:00
Length.h LibWeb: Replace Length::set_calculated_style() with ::make_calculated() 2022-02-04 13:52:02 +01:00
LengthBox.h LibWeb: Convert width/height and min-/max- versions to LengthPercentage 2022-01-20 00:04:10 +01:00
MediaList.cpp
MediaList.h
MediaList.idl
MediaQuery.cpp AK+Everywhere: Make Variant::visit() respect the Variant's constness 2022-01-14 11:35:40 +03:30
MediaQuery.h LibWeb: Support range syntax for media queries 2022-01-02 15:43:51 +01:00
MediaQueryList.cpp LibWeb: Rewrite EventTarget to more closely match the spec 2022-02-08 17:47:44 +00:00
MediaQueryList.h LibWeb: Rewrite EventTarget to more closely match the spec 2022-02-08 17:47:44 +00:00
MediaQueryList.idl
MediaQueryListEvent.h
MediaQueryListEvent.idl
Percentage.cpp LibWeb: Allow LengthPercentage to hold a calculated value 2022-02-04 13:52:02 +01:00
Percentage.h LibWeb: Allow LengthPercentage to hold a calculated value 2022-02-04 13:52:02 +01:00
PreferredColorScheme.cpp
PreferredColorScheme.h
Properties.json LibWeb: Parse display: inline-flex 2022-02-07 21:55:12 +01:00
QuirksMode.css
ResolvedCSSStyleDeclaration.cpp LibWeb: Incorporate spread-distance into box-shadow rendering 2022-02-08 17:45:51 +01:00
ResolvedCSSStyleDeclaration.h
Screen.cpp LibWeb: Make CSS::Screen forward its ref count to DOM::Window 2021-12-09 21:28:52 +01:00
Screen.h LibWeb: Make CSS::Screen forward its ref count to DOM::Window 2021-12-09 21:28:52 +01:00
Screen.idl
Selector.cpp LibWeb: Cache the result of Selector::specificity() 2022-02-05 16:48:14 +01:00
Selector.h LibWeb: Cache the result of Selector::specificity() 2022-02-05 16:48:14 +01:00
SelectorEngine.cpp LibWeb: Mark SelectorEngine matches-related functions as inline 2022-02-05 16:48:14 +01:00
SelectorEngine.h
Serialize.cpp
Serialize.h
StyleComputer.cpp LibWeb: Cache CSS rules in buckets to reduce number of rules checked 2022-02-10 20:52:11 +01:00
StyleComputer.h LibWeb: Cache CSS rules in buckets to reduce number of rules checked 2022-02-10 20:52:11 +01:00
StyleProperties.cpp LibWeb: Incorporate spread-distance into box-shadow rendering 2022-02-08 17:45:51 +01:00
StyleProperties.h LibWeb: Render multiple box-shadows 2022-02-08 17:45:51 +01:00
StyleSheet.cpp LibWeb: Make StyleSheet::m_parent_style_sheet a WeakPtr 2021-12-06 19:22:16 +01:00
StyleSheet.h LibWeb: Make StyleSheet::m_parent_style_sheet a WeakPtr 2021-12-06 19:22:16 +01:00
StyleSheet.idl
StyleSheetList.cpp LibWeb: Cache CSS rules in buckets to reduce number of rules checked 2022-02-10 20:52:11 +01:00
StyleSheetList.h LibWeb: Cache CSS rules in buckets to reduce number of rules checked 2022-02-10 20:52:11 +01:00
StyleSheetList.idl
StyleValue.cpp LibWeb: Parse spread-distance and inset parts of box-shadow 2022-02-08 17:45:51 +01:00
StyleValue.h LibWeb: Parse spread-distance and inset parts of box-shadow 2022-02-08 17:45:51 +01:00
Supports.cpp LibWeb: Remove unknown value in @supports query logic 2022-01-19 21:44:45 +00:00
Supports.h LibWeb: Remove unknown value in @supports query logic 2022-01-19 21:44:45 +00:00