LibWeb: Generate logical property mappings

To support this, how we declare logical property aliases has changed.
Instead of `logical-alias-for` being a list of properties, it's now an
object with a `group` and `mapping`. The group is the name of a logical
property group in LogicalPropertyGroups.json. The mapping is which
side/dimension/corner this property is. Hopefully it's self-explanatory
enough.

The generated code is very much a copy of what was previously in
`StyleComputer::map_logical_alias_to_physical_property_id()`, so there
should be no behaviour change.
This commit is contained in:
Sam Atkins 2025-07-03 14:31:26 +01:00 committed by Andrew Kaster
parent 4c48a51860
commit 69d4811ef7
Notes: github-actions[bot] 2025-07-08 17:46:32 +00:00
9 changed files with 561 additions and 646 deletions

View file

@ -700,7 +700,7 @@ RefPtr<CSSStyleValue const> CSSStyleProperties::style_value_for_computed_propert
return style_value_for_computed_property(
layout_node,
StyleComputer::map_logical_alias_to_physical_property_id(property_id, StyleComputer::LogicalAliasMappingContext { computed_properties->writing_mode(), computed_properties->direction() }));
map_logical_alias_to_physical_property(property_id, LogicalAliasMappingContext { computed_properties->writing_mode(), computed_properties->direction() }));
}
// A limited number of properties have special rules for producing their "resolved value".