style: Implement parsing of container relative lengths

- For now, implementation always returns the fallback value, i.e. small viewport lengths.
- Enabled via existing pref `layout.css.container-queries.enabled`.

Differential Revision: https://phabricator.services.mozilla.com/D158054
This commit is contained in:
David Shin 2022-10-17 17:26:12 +00:00 committed by Martin Robinson
parent 4dd841a036
commit d8785f3a22
4 changed files with 202 additions and 3 deletions

View file

@ -58,6 +58,13 @@ impl specified::NoCalcLength {
.add_flags(ComputedValueFlags::USES_VIEWPORT_UNITS);
length.to_computed_value(context)
},
specified::NoCalcLength::ContainerRelative(length) => {
// Fallback uses small viewport size.
context
.builder
.add_flags(ComputedValueFlags::USES_VIEWPORT_UNITS);
length.to_computed_value(context)
},
specified::NoCalcLength::ServoCharacterWidth(length) => {
length.to_computed_value(context.style().get_font().clone_font_size().size())
},