mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-14 20:03:29 +00:00
LibWeb: Reorder MatchingRule members to make it smaller
By packing the members more efficiently, it goes from 64 to 56 bytes.
This commit is contained in:
parent
963aa213c5
commit
25c22bb5e5
|
@ -2323,14 +2323,14 @@ NonnullOwnPtr<StyleComputer::RuleCache> StyleComputer::make_rule_cache_for_casca
|
|||
size_t selector_index = 0;
|
||||
for (CSS::Selector const& selector : rule.selectors()) {
|
||||
MatchingRule matching_rule {
|
||||
cascade_origin,
|
||||
shadow_root,
|
||||
&rule,
|
||||
sheet,
|
||||
style_sheet_index,
|
||||
rule_index,
|
||||
selector_index,
|
||||
selector.specificity()
|
||||
selector.specificity(),
|
||||
cascade_origin,
|
||||
};
|
||||
|
||||
for (auto const& simple_selector : selector.compound_selectors().last().simple_selectors) {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace Web::CSS {
|
||||
|
||||
// https://www.w3.org/TR/css-cascade/#origin
|
||||
enum class CascadeOrigin {
|
||||
enum class CascadeOrigin : u8 {
|
||||
Author,
|
||||
User,
|
||||
UserAgent,
|
||||
|
@ -30,7 +30,6 @@ enum class CascadeOrigin {
|
|||
};
|
||||
|
||||
struct MatchingRule {
|
||||
CascadeOrigin cascade_origin;
|
||||
JS::GCPtr<DOM::ShadowRoot const> shadow_root;
|
||||
JS::GCPtr<CSSStyleRule const> rule;
|
||||
JS::GCPtr<CSSStyleSheet const> sheet;
|
||||
|
@ -39,6 +38,7 @@ struct MatchingRule {
|
|||
size_t selector_index { 0 };
|
||||
|
||||
u32 specificity { 0 };
|
||||
CascadeOrigin cascade_origin;
|
||||
bool contains_pseudo_element { false };
|
||||
bool contains_root_pseudo_class { false };
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue