LibWeb: Support shorthands when setting style attribute

Better support for CSS shorthands when setting the style attribute. This
improves some tests in WPT /css/css-align/default-alignment/*shorthand.
When setting the style attribute in JS via element.style = '..' or the
setAttribute method, shorthand properties were not expanded to longhand
properties.
This commit is contained in:
Sergei Azarkin 2024-10-22 21:59:22 +02:00 committed by Sam Atkins
commit 2199fde5a9
Notes: github-actions[bot] 2024-10-31 12:23:58 +00:00
5 changed files with 130 additions and 1 deletions

View file

@ -0,0 +1,12 @@
style.cssText = background-color: rgb(255, 255, 0); background-image: none; background-position-x: left 0%; background-position-y: top 0%; background-size: auto auto; background-repeat: repeat repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box;
style.length = 9
style[] =
1. background-color
2. background-image
3. background-position-x
4. background-position-y
5. background-size
6. background-repeat
7. background-attachment
8. background-origin
9. background-clip

View file

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