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
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

@ -131,13 +131,6 @@ public:
static void for_each_property_expanding_shorthands(PropertyID, CSSStyleValue const&, Function<void(PropertyID, CSSStyleValue const&)> const& set_longhand_property);
static NonnullRefPtr<CSSStyleValue const> get_inherit_value(CSS::PropertyID, DOM::Element const*, Optional<CSS::PseudoElement> = {});
struct LogicalAliasMappingContext {
CSS::WritingMode writing_mode;
CSS::Direction direction;
// TODO: text-orientation
};
static PropertyID map_logical_alias_to_physical_property_id(PropertyID, LogicalAliasMappingContext);
static Optional<String> user_agent_style_sheet_source(StringView name);
explicit StyleComputer(DOM::Document&);