LibWeb: Avoid getting shorthand property from ComputedProperties

ComputedProperties only includes longhands so we shouldn't try to get
shorthands - this will be asserted in a later commit.
This commit is contained in:
Callum Law 2025-08-25 15:56:21 +12:00 committed by Jelle Raaijmakers
parent 1ba64a1d7e
commit 9f5696e9c5

View File

@ -184,10 +184,13 @@ RefPtr<StyleValue const> StylePropertyMapReadOnly::get_style_value(Source& sourc
return registered_custom_property.value()->initial_style_value();
return nullptr;
}
// FIXME: This will only ever be null for pseudo-elements. What should we do in that case?
// The property's value is also sometimes null. Is that correct?
if (auto computed_properties = element.computed_properties())
return computed_properties->maybe_null_property(property_id.value());
if (*property_id >= first_longhand_property_id && *property_id <= last_longhand_property_id) {
// FIXME: This will only ever be null for pseudo-elements. What should we do in that case?
if (auto computed_properties = element.computed_properties())
return computed_properties->property(property_id.value());
}
return nullptr;
},
[&property](GC::Ref<CSSStyleDeclaration>& declaration) {