mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 15:19:16 +00:00
LibWeb: Implement anchor-size(..)
function parsing
This parses `anchor-size(..)` functions in CSS, but does not yet result in a useful `Size`: we need style & layout interleaving similar to container queries for this, since the resulting value depends on layout results. Not supported yet: `anchor-size()` appearing inside a `calc()` node. Adds 4280 WPT subtest passes in `css/css-anchor-position`.
This commit is contained in:
parent
02598040ad
commit
c4f5e7bee3
Notes:
github-actions[bot]
2025-07-30 17:15:09 +00:00
Author: https://github.com/gmta
Commit: c4f5e7bee3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5655
Reviewed-by: https://github.com/tcl3 ✅
16 changed files with 318 additions and 3 deletions
|
@ -293,7 +293,7 @@ Optional<Parser::PropertyAndValue> Parser::parse_css_value_for_properties(Readon
|
|||
auto transaction = tokens.begin_transaction();
|
||||
if (property_accepts_type(*property, ValueType::Percentage)) {
|
||||
if (auto value = parse_length_percentage_value(tokens)) {
|
||||
if (value->is_calculated()) {
|
||||
if (value->is_calculated() || value->is_anchor_size()) {
|
||||
transaction.commit();
|
||||
return PropertyAndValue { *property, value };
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ Optional<Parser::PropertyAndValue> Parser::parse_css_value_for_properties(Readon
|
|||
}
|
||||
}
|
||||
if (auto value = parse_length_value(tokens)) {
|
||||
if (value->is_calculated()) {
|
||||
if (value->is_calculated() || value->is_anchor_size()) {
|
||||
transaction.commit();
|
||||
return PropertyAndValue { *property, value };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue