1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 01:51:03 +09:00
ladybird/Tests/LibWeb
Sam Atkins 4edafb35cd LibWeb/CSS: Use PendingSubstitutionValue for unresolved shorthands
Previously, we would just assign the UnresolvedStyleValue to each
longhand, which was completely wrong but happened to work if it was a
ShorthandStyleValue (because that's basically a list of "set property X
to Y", and doesn't care which property it's the value of).

For example, the included `var-in-margin-shorthand.html` test would:
1. Set `margin-top` to `var(--a) 10px`
2. Resolve it to `margin-top: 5px 10px`
3. Reject that as invalid

What now happens is:
1. Set `margin-top` to a PendingSubstitutionValue
2. Resolve `margin` to `5px 10px`
3. Expand that out into its longhands
4. `margin-top` is `5px` 🎉

In order to support this, `for_each_property_expanding_shorthands()` now
runs the callback for the shorthand too if it's an unresolved or
pending-substitution value. This is so that we can store those in the
CascadedProperties until they can be resolved - otherwise, by the time
we want to resolve them, we don't have them any more.

`cascade_declarations()` has an unfortunate hack: it tracks, for each
declaration, which properties have already been given values, so that
it can avoid overwriting an actual value with a pending one. This is
necessary because of the unfortunate way that CSSStyleProperties holds
expanded longhands, and not just the original declarations. The spec
disagrees with itself about this, but we do need to do that expansion
for `element.style` to work correctly. This HashTable is unfortunate
but it does solve the problem until a better solution can be found.
2025-05-14 11:46:47 +01:00
..
Assets LibWeb: Check if navigable has active window before navigating 2025-02-28 23:15:35 +01:00
Crash LibWeb: Fix SRI handling of badly-formatted strings 2025-05-06 13:02:58 -04:00
Fixtures Tests/LibWeb: Fix type for delay_ms property in HTTP echo server 2024-12-07 15:49:15 +00:00
Layout Meta: Add doctypes to all grid layout tests 2025-05-13 03:49:32 +03:00
Ref LibWeb: Add paint containment clipping 2025-05-13 15:30:14 +03:00
Screenshot LibWeb: Use efficient background repeat path for either direction 2025-05-09 21:37:48 +02:00
Text LibWeb/CSS: Use PendingSubstitutionValue for unresolved shorthands 2025-05-14 11:46:47 +01:00
add_libweb_test.py LibWeb: Update add_libweb_test.py to support Screenshot, Ref, and Layout 2025-01-13 14:25:26 +00:00
CMakeLists.txt LibWeb: Only use code unit length for is_code_unit_prefix 2025-05-12 11:20:32 +02:00
TestConfig.ini LibGfx: Only include frames with fcTL chunks in the animation 2025-05-01 10:30:00 +02:00
TestCSSIDSpeed.cpp
TestCSSInheritedProperty.cpp Meta/LibWeb: Use correct shorthand range in is_inherited_property 2024-12-22 12:33:41 +01:00
TestCSSPixels.cpp
TestCSSTokenStream.cpp
TestFetchInfrastructure.cpp
TestFetchURL.cpp Everywhere: Remove some use of the URL constructors 2025-02-19 08:01:35 -05:00
TestHTMLTokenizer.cpp LibWeb: Fix hex character references accepting all alphabetic ASCII 2025-01-07 00:43:41 +01:00
TestHTMLTokenizerSwift.swift LibWeb: Add remaining states to the Swift tokenizer 2024-11-15 10:51:45 -07:00
TestLibWebSwiftBindings.swift
TestMicrosyntax.cpp
TestMimeSniff.cpp
TestNumbers.cpp
TestStrings.cpp LibWeb: Only use code unit length for is_code_unit_prefix 2025-05-12 11:20:32 +02:00
tokenizer-test.html