mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb/CSS: Support nested shorthands in CSSStyleDeclaration
Without this, getting a property's value from `element.style.foo` would fail if `foo` is a shorthand property which has a longhand that is also a shorthand. For example, `border` expands to `border-width` which expands to `border-top-width`. This is because we used `property()` to get a longhand's value, but this returns nothing if the property is a shorthand. This commit solves that by moving most of get_property_value() into a separate method that returns a StyleProperty instead of a String, and which calls itself recursively for shorthands. Also move the manual shorthand construction out of ResolvedCSSStyleDeclaration so that all CSSStyleDeclarations can use it.
This commit is contained in:
Notes:
github-actions[bot]
2025-02-12 16:02:13 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/412b7581070 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3482 Reviewed-by: https://github.com/jdahlin
@@ -2,7 +2,8 @@ Harness status: OK
|
||||
|
||||
Found 3 tests
|
||||
|
||||
3 Fail
|
||||
Fail Declaration with border longhands is not serialized to a border shorthand declaration.
|
||||
Fail Declaration with border longhands and border-image is not serialized to a border shorthand declaration.
|
||||
2 Pass
|
||||
1 Fail
|
||||
Pass Declaration with border longhands is not serialized to a border shorthand declaration.
|
||||
Pass Declaration with border longhands and border-image is not serialized to a border shorthand declaration.
|
||||
Fail Border shorthand is serialized correctly if all border-image-* are set to their initial specified values.
|
||||
Reference in New Issue
Block a user