[css-properties-values-api] ComputedPropertyValue should be an enum
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox125 | --- | fixed |
People
(Reporter: zrhoffman, Assigned: zrhoffman)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
Attachments
(4 files, 1 obsolete file)
Currently, computed registered custom properties are computed when substituting variable references, but the computed value is converted back to a String to be stored as a ComputedPropertyValue (VariableValue) in the custom properties map, only for the value to converted back to its computed type when applying longhands.
Instead, ComputedPropertyValue should be something like
enum { Unparsed { css, url_data, serialization_types, references }, Parsed(..) }
so the computed value can be reused later.
Assignee | ||
Comment 1•1 year ago
|
||
Emilio, how should substitutions work if we store the computed representation as-is? For example, if we have something like
@property --my-property {
syntax: '<length>';
inherits: true;
initial-value: 5px;
}
.my-class {
--another: calc(4px + var(--my-property));
width: var(--another)
}
, we would still need a String representation of --my-property
when performing a substitution for --another
, unless the value of --another
is computed when performing that substitution.
Comment 2•1 year ago
|
||
Yeah, I was assuming we'd serialize the internal value for substitution. But maybe we can just parse/compute the values when interpolating instead, if that makes it easier.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 3•11 months ago
|
||
Assignee | ||
Comment 4•11 months ago
|
||
The URL data is necessary to uncompute the value for animation. This was
handled previously by adding the URL data to CustomAnimatedValue.
However, now that a registered custom property is passed to
CustomAnimatedValue::from_computed instead of a VariableValue, that
registered custom property should include URL data instead.
Assignee | ||
Comment 5•11 months ago
|
||
Now that registered custom property values contain URL data, URL data is
eliminated as an argument in some places, and the ComputedValue.url_data
field is removed.
Assignee | ||
Comment 6•11 months ago
|
||
Although the inner value of the Parsed variant is the
ComputedRegisteredValueInner type, custom property maps hold only the
ComputedRegisteredValueInner::Universal variant to keep behavior
unchanged for now.
Updated•11 months ago
|
Assignee | ||
Comment 7•11 months ago
|
||
An Arc is still around VariableValues, and the extra Arc would be
redundant.
Updated•11 months ago
|
Comment 9•11 months ago
|
||
Backed out for causing build bustages.
- Backout link
- Push with failures
- Failure Log
- Failure line: error[E0599]: no method named
is_parsed
found for reference&Value<GenericValueComponent<CSSPixelLength, f32, Percentage, ..., ..., ..., ..., ..., ..., ..., ..., ...>>
in the current scope
Assignee | ||
Updated•11 months ago
|
Comment 10•11 months ago
|
||
Comment 11•11 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6078a631438d
https://hg.mozilla.org/mozilla-central/rev/9e5d71c9324f
https://hg.mozilla.org/mozilla-central/rev/f7ddfd619c51
https://hg.mozilla.org/mozilla-central/rev/63d81375ed6e
Comment 12•11 months ago
|
||
You rock, Zach!
Description
•