LibWeb: Make getComputedStyle(e).getPropertyValue() see custom props

A lot of WPT tests rely on this mechanism to test unrelated things.
This commit is contained in:
Andreas Kling 2024-11-21 20:12:18 +01:00 committed by Andreas Kling
parent ea0e434d1d
commit 6dc61f895d
Notes: github-actions[bot] 2024-11-21 20:16:55 +00:00
6 changed files with 36 additions and 37 deletions

View file

@ -601,10 +601,10 @@ Optional<StyleProperty> ResolvedCSSStyleDeclaration::property(PropertyID propert
}; };
} }
Optional<StyleProperty> ResolvedCSSStyleDeclaration::custom_property(FlyString const&) const Optional<StyleProperty> ResolvedCSSStyleDeclaration::custom_property(FlyString const& name) const
{ {
dbgln("FIXME: ResolvedCSSStyleDeclaration::custom_property is not implemented"); const_cast<DOM::Document&>(m_element->document()).update_style();
return {}; return m_element->custom_properties(m_pseudo_element).get(name);
} }
static WebIDL::ExceptionOr<void> cannot_modify_computed_property_error(JS::Realm& realm) static WebIDL::ExceptionOr<void> cannot_modify_computed_property_error(JS::Realm& realm)

View file

@ -6,6 +6,6 @@ Rerun
Found 1 tests Found 1 tests
1 Fail 1 Pass
Details Details
Result Test Name MessageFail element with display:contents is focusable Result Test Name MessagePass element with display:contents is focusable

View file

@ -6,17 +6,16 @@ Rerun
Found 11 tests Found 11 tests
1 Pass 11 Pass
10 Fail
Details Details
Result Test Name MessageFail Trailing declarations apply after any preceding rules Result Test Name MessagePass Trailing declarations apply after any preceding rules
Fail Trailing declarations apply after any preceding rules (no leading) Pass Trailing declarations apply after any preceding rules (no leading)
Fail Trailing declarations apply after any preceding rules (multiple) Pass Trailing declarations apply after any preceding rules (multiple)
Fail Nested declarations rule has same specificity as outer selector Pass Nested declarations rule has same specificity as outer selector
Fail Nested declarations rule has top-level specificity behavior Pass Nested declarations rule has top-level specificity behavior
Fail Nested declarations rule has top-level specificity behavior (max matching) Pass Nested declarations rule has top-level specificity behavior (max matching)
Fail Bare declartaion in nested grouping rule can match pseudo-element Pass Bare declartaion in nested grouping rule can match pseudo-element
Fail Nested group rules have top-level specificity behavior Pass Nested group rules have top-level specificity behavior
Fail Nested @scope rules behave like :where(:scope) Pass Nested @scope rules behave like :where(:scope)
Fail Nested @scope rules behave like :where(:scope) (trailing) Pass Nested @scope rules behave like :where(:scope) (trailing)
Pass Nested declarations rule responds to parent selector text change Pass Nested declarations rule responds to parent selector text change

View file

@ -6,13 +6,13 @@ Rerun
Found 8 tests Found 8 tests
8 Fail 8 Pass
Details Details
Result Test Name MessageFail :has(#foo) wins over :has(.foo) Result Test Name MessagePass :has(#foo) wins over :has(.foo)
Fail :has(span#foo) wins over :has(#foo) Pass :has(span#foo) wins over :has(#foo)
Fail :has(.bar, #foo) has same specificity as :has(#foo, .bar) Pass :has(.bar, #foo) has same specificity as :has(#foo, .bar)
Fail :has(.bar, #foo) wins over :has(.foo, .bar) Pass :has(.bar, #foo) wins over :has(.foo, .bar)
Fail :has(span + span) wins over :has(span) Pass :has(span + span) wins over :has(span)
Fail :has(span, li, p) wins over :has(span, lo, p) Pass :has(span, li, p) wins over :has(span, lo, p)
Fail latter .baz wins over :has(.foo) Pass latter .baz wins over :has(.foo)
Fail latter :has(.foo) wins over .baz Pass latter :has(.foo) wins over .baz

View file

@ -6,6 +6,6 @@ Rerun
Found 1 tests Found 1 tests
1 Fail 1 Pass
Details Details
Result Test Name MessageFail Test string hash collision in bucketing Result Test Name MessagePass Test string hash collision in bucketing

View file

@ -6,13 +6,13 @@ Rerun
Found 8 tests Found 8 tests
8 Fail 8 Pass
Details Details
Result Test Name MessageFail :not(#foo) wins over :not(.foo) Result Test Name MessagePass :not(#foo) wins over :not(.foo)
Fail :not(div#foo) wins over :not(#foo) Pass :not(div#foo) wins over :not(#foo)
Fail :not(.bar, #foo) has same specificity as :not(#foo, .bar) Pass :not(.bar, #foo) has same specificity as :not(#foo, .bar)
Fail :not(.bar, #foo) wins over :not(.foo, .bar) Pass :not(.bar, #foo) wins over :not(.foo, .bar)
Fail :not(span + span) wins over :not(span) Pass :not(span + span) wins over :not(span)
Fail :not(span, li, p) wins over :not(span, lo, p) Pass :not(span, li, p) wins over :not(span, lo, p)
Fail :not(span, :not(:not(.a#foo)), p) wins over :not(span, #foo, p) Pass :not(span, :not(:not(.a#foo)), p) wins over :not(span, #foo, p)
Fail :not(span, #foo, p) wins over :not(span, :where(.a#foo), p) Pass :not(span, #foo, p) wins over :not(span, :where(.a#foo), p)