Commit graph

3 commits

Author SHA1 Message Date
Sam Atkins
693517daa0 LibWeb: Resolve container-relative length units
Add cqw/cqh/cqi/cqb/cqmin/cqmax to the unit tables and generated
helpers, then thread them through the shared length resolution path.

Length::ResolutionContext now carries the subject element and whether
its inline axis is horizontal. Container units need that extra context:
the nearest eligible query container is selected from the subject
element's flat-tree ancestors, and cqi/cqb/cqmin/cqmax map logical axes
through the subject's writing mode before resolving to a physical width
or height.

Teach Length to resolve each axis against the selected container's
content box, fall back to viewport lengths when no eligible container
exists, and mark size-container dependencies so post-layout
recomputation can happen when layout is not up to date.

Also expose the new units through Typed OM, reject them for
computationally independent `@property` initial values, and add focused
font-size coverage.
2026-06-01 08:27:17 +01:00
Zaggy1024
4959bd25e0 Meta: Use Optional instead of the union operator in css_dimensions.py
Fixes a build error on macOS. Union operators aren't supported in
Python 3.9.
2026-05-13 08:13:51 -05:00
Callum Law
c96e8f15e5 Meta: Make CSS dimension loading reusable
Aside from the existing users this will also be used within the
CSSGrammar parser
2026-05-13 11:00:07 +01:00