LibWeb/CSS: Pull out and expand CSSStyleProperties::get_property()

This awkwardly sat as the internal final API for getting a StyleProperty
directly for a given PropertyID, and also the external API for getting
the StyleProperty for a PropertyID. For the latter, it lacked support
for shorthands, and for both it lacked support for custom properties.

This commit:
- Moves the code from get_property() into get_direct_property()
- Makes get_property() call get_property_internal() to support
  shorthands
- Adds custom property support for get_direct_property()

This also wins us some WPT points for StylePropertyMap.
This commit is contained in:
Sam Atkins 2025-09-25 17:09:22 +01:00
commit 47062424fb
Notes: github-actions[bot] 2025-10-02 12:47:56 +00:00
10 changed files with 95 additions and 85 deletions

View file

@ -4691,7 +4691,6 @@ Optional<NonnullRefPtr<CSS::StyleValue const>> property_in_style_attribute(GC::R
if (!inline_style)
return {};
// FIXME: This doesn't support shorthand properties.
auto style_property = inline_style->get_property(property_id);
if (!style_property.has_value())
return {};