Closed Bug 1858848 Opened 8 months ago Closed 6 months ago

[css-properties-values-api] Compute initial value

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: zrhoffman, Assigned: zrhoffman)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Now that registered custom properties are computed, the initial value can also be computed.

Tests that should pass: https://wpt.fyi/results/css/css-properties-values-api/registered-property-initial.html

In order to use computed <length> and <length-percentage> values before bug 1856524 is resolved, a new generic computed value type would need to be added, like ComputedValueComponent added in bug 1857716, which uses computed::Length and computed::LengthPercentage instead of specified::Length and specified::LengthPercentage like ComputedValueComponent does until bug 1856524 is resolved.

Blocks: interop-2023
Blocks: css-properties-values-api
No longer blocks: interop-2023

This will probably require passing a computed::Context all the way to PropertyRegistration::validate_initial_value, similar to the Stylist passing in bug 1840478 and bug 1850370.

Assignee: nobody → zach
Status: NEW → ASSIGNED
Blocks: 1864818

This patch computes initial value when initial values are collected. The
initial value cannot be computed earlier (for example, at parse time)
without breaking intended behavior, since CSSOM expects the initial
value string of a CSSPropertyRule to remain uncomputed.

Although <length> and <length-percentage> can be accurately computed
already for initial values since valid initial values are always
font-indepent, this patch leaves <length> and <length-percentage>
uncomputed for simplicity (until bug 1856524 is implemented).

Attachment #9364017 - Attachment description: Bug 1858848 - Compute initial value r=zsun,fredw,#style → Bug 1858848 - [css-properties-values-api] Compute initial value r=zsun,fredw,#style
Pushed by zach@zrhoffman.net:
https://hg.mozilla.org/integration/autoland/rev/ab1916269c71
[css-properties-values-api] Compute initial value r=firefox-style-system-reviewers,layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: