diff options
Diffstat (limited to 'Libraries/LibWeb/CSS/StyleResolver.cpp')
-rw-r--r-- | Libraries/LibWeb/CSS/StyleResolver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/LibWeb/CSS/StyleResolver.cpp b/Libraries/LibWeb/CSS/StyleResolver.cpp index 142a100342..2d74c34ddd 100644 --- a/Libraries/LibWeb/CSS/StyleResolver.cpp +++ b/Libraries/LibWeb/CSS/StyleResolver.cpp @@ -497,12 +497,14 @@ NonnullRefPtr<StyleProperties> StyleResolver::resolve_style(const Element& eleme quick_sort(matching_rules, [&](MatchingRule& a, MatchingRule& b) { auto& a_selector = a.rule->selectors()[a.selector_index]; auto& b_selector = b.rule->selectors()[b.selector_index]; + auto a_specificity = a_selector.specificity(); + auto b_specificity = b_selector.specificity(); if (a_selector.specificity() == b_selector.specificity()) { if (a.style_sheet_index == b.style_sheet_index) return a.rule_index < b.rule_index; return a.style_sheet_index < b.style_sheet_index; } - return a_selector.specificity() < b_selector.specificity(); + return a_specificity < b_specificity; }); for (auto& match : matching_rules) { |