LibWeb/CSS: Use ShorthandStyleValue to serialize shorthands

This wins us 65 new WPT subtest passes! It also shows up that we're
doing the wrong thing in ShorthandStyleValue in places, notably with
the grid properties. However, having one place to fix instead of two
will make it easier to correct them. :^)

In order to be fully correct, we should use the algorithm here:
https://drafts.csswg.org/cssom/#serialize-a-css-value

However, it's quite hand-wavy. What we do have in the meantime is
`ShorthandStyleValue::to_string()`, where we special-case the
serialization rules for shorthands with a generic fallback that's
equivalent to what the previous `get_property_value()` code was doing.
This commit is contained in:
Sam Atkins 2024-11-29 13:02:30 +00:00 committed by Andreas Kling
commit e4d55a6037
Notes: github-actions[bot] 2024-11-30 10:03:02 +00:00
13 changed files with 127 additions and 121 deletions

View file

@ -1,41 +1,41 @@
=== place-items: normal
place-items: normal normal
place-items: normal
align-items: normal
justify-items: normal
=== place-items: stretch
place-items: stretch stretch
place-items: stretch
align-items: stretch
justify-items: stretch
=== place-items: start
place-items: start start
place-items: start
align-items: start
justify-items: start
=== place-items: end
place-items: end end
place-items: end
align-items: end
justify-items: end
=== place-items: self-start
place-items: self-start self-start
place-items: self-start
align-items: self-start
justify-items: self-start
=== place-items: self-end
place-items: self-end self-end
place-items: self-end
align-items: self-end
justify-items: self-end
=== place-items: center
place-items: center center
place-items: center
align-items: center
justify-items: center
=== place-items: flex-start
place-items: flex-start flex-start
place-items: flex-start
align-items: flex-start
justify-items: flex-start
=== place-items: flex-end
place-items: flex-end flex-end
place-items: flex-end
align-items: flex-end
justify-items: flex-end
=== place-items: baseline
place-items: baseline baseline
place-items: baseline
align-items: baseline
justify-items: baseline
=== place-items: normal start