mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +00:00
LibWeb: Add generic logic for parsing "positional-value-list-shorthands"
Continues the work started in #5386 to simplify handling of positional value list shorthand properties. Previously we would parse these as `StyleValueList`s and then rely on `StyleComputer::for_each_property_expanding_shorthands` to expand them into longhands. This required a bit of work to handle `ShorthandStyleValue`s for the `@page` `margin` descriptor.
This commit is contained in:
parent
b1e77b3522
commit
a7e5ded188
Notes:
github-actions[bot]
2025-09-09 09:47:05 +00:00
Author: https://github.com/Calme1709
Commit: a7e5ded188
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6136
Reviewed-by: https://github.com/gmta ✅
6 changed files with 57 additions and 199 deletions
|
@ -53,9 +53,8 @@ Parser::ParseErrorOr<NonnullRefPtr<StyleValue const>> Parser::parse_descriptor_v
|
|||
auto value_for_property = value_or_error.release_value();
|
||||
// Descriptors don't accept the following, which properties do:
|
||||
// - CSS-wide keywords
|
||||
// - Shorthands
|
||||
// - Arbitrary substitution functions (so, UnresolvedStyleValue)
|
||||
if (value_for_property->is_css_wide_keyword() || value_for_property->is_shorthand() || value_for_property->is_unresolved())
|
||||
if (value_for_property->is_css_wide_keyword() || value_for_property->is_unresolved())
|
||||
return nullptr;
|
||||
return value_for_property;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue