LibWeb: Add support for the 'all' CSS property

The "longhands" array is populated in the code generator to avoid the
overhead of manually maintaining the list in Properties.json

There is one subtest that still fails in
'cssstyledeclaration-csstext-all-shorthand', this is related to
us not maintaining the relative order of CSS declarations for custom vs
non-custom properties.
This commit is contained in:
Callum Law 2025-06-10 01:31:14 +12:00 committed by Sam Atkins
commit d31a58a7d6
Notes: github-actions[bot] 2025-06-12 14:26:43 +00:00
16 changed files with 199 additions and 82 deletions

View file

@ -95,6 +95,11 @@ String ShorthandStyleValue::to_string(SerializationMode mode) const
// Then special cases
switch (m_properties.shorthand_property) {
case PropertyID::All: {
// NOTE: 'all' can only be serialized in the case all sub-properties share the same CSS-wide keyword, this is
// handled above, thus, if we get to here that mustn't be the case and we should return the empty string.
return ""_string;
}
case PropertyID::Background: {
auto color = longhand(PropertyID::BackgroundColor);
auto image = longhand(PropertyID::BackgroundImage);