Add initial infrastructure for list-valued property reification in Typed OM
Categories
(Core :: CSS Parsing and Computation, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox150 | --- | affected |
People
(Reporter: janv, Assigned: janv)
References
(Blocks 2 open bugs)
Details
(Keywords: leave-open)
Attachments
(19 files, 4 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 2017250 - Support #[css(comma)] in ToTyped derive for list-valued property reification; r=emilio
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Introduce initial infrastructure for reification of list-valued CSS properties in Typed OM.
This includes:
- Changing
ToTypedto write into aTypedValueListinstead of returning a single value. - Using existing
#[css(iterable)]metadata to trigger subdivision of list-valued properties into iterations. - Supporting subdivision logic for both
StylePropertyMap.get()/getAll()and futureCSSStyleValue::parse().
This provides the foundation for proper reification of list-valued properties. As a result, some existing Typed OM WPTs for list-valued properties may start passing. Broader property coverage and more complete reification support will follow in subsequent bugs.
| Assignee | ||
Comment 1•1 month ago
|
||
In other words, this is mainly about creating the infrastructure so that StylePropertyMap will be able to return multiple values for a list-valued property.
| Assignee | ||
Comment 2•18 days ago
|
||
Introduce initial infrastructure for reification of list-valued CSS
properties in Typed OM.
Change the ToTyped trait to append results into a ThinVec<TypedValue> instead
of returning a single TypedValue, allowing values to reify into multiple Typed
OM objects.
Add a convenience helper to_typed_value() which returns the first TypedValue
so existing call sites continue to behave as before, and update the derive and
callers accordingly.
| Assignee | ||
Comment 3•17 days ago
|
||
Refactor reify_number and reify_percentage to return the final TypedValue
type directly.
This prepares for upcoming iterable reification changes where these helpers
will append results into the output vector used by ToTyped::to_typed.
| Assignee | ||
Comment 4•17 days ago
|
||
This patch extends the ToTyped derive to support fields marked with
entries.
When such a field is present, the generated implementation iterates over the
items and delegates to ToTyped for each element, adding the necessary trait
bounds only for the element types involved. This keeps the derive lightweight
and avoids forcing unrelated container types to implement ToTyped.
This builds on the earlier derive_fields support and prepares the groundwork
for proper reification of list-valued CSS properties.
| Assignee | ||
Comment 5•17 days ago
|
||
Fix what appears to be a copy/paste error in the WPT for the container-name
property.
The test appears to have been copied from the container-type test. Adjust it
so it correctly reflects the behavior of container-name with multiple values.
| Assignee | ||
Comment 6•16 days ago
|
||
Update ToTyped derive documentation to better describe supported attributes
and their behavior.
| Assignee | ||
Comment 7•16 days ago
|
||
Teach the ToTyped derive to recognize #[css(comma)] as a signal that an
iterable field represents a comma-separated CSS list whose items can be
reified as separate TypedValue entries.
If #[css(comma)] is not present and the iterable contains more than one item,
the derive treats the value as unsupported and returns Err(()).
This matches current Typed OM Level 1 behavior reflected by WPT, where only
comma-separated lists are subdivided into iterations. Properties such as
container-name may accept multiple space-separated values but are currently
reified as unsupported when more than one value is present.
| Assignee | ||
Comment 8•16 days ago
|
||
Demonstrate iterable-field support in the ToTyped derive using the
container-name property.
The property accepts a list of identifiers, but Typed OM Level 1 currently
treats space-separated multi-value cases as unsupported. Reification therefore
succeeds for a single identifier and returns Err(()) when more than one value
is present.
| Assignee | ||
Comment 9•16 days ago
|
||
Demonstrate iterable-field support in the ToTyped derive using the
container-name property.
The property accepts a list of identifiers, but Typed OM Level 1 currently
treats space-separated multi-value cases as unsupported. Reification therefore
succeeds for a single identifier and returns Err(()) when more than one value
is present.
| Assignee | ||
Comment 10•16 days ago
|
||
Demonstrate iterable-field support in the ToTyped derive using the
container-name property.
The property accepts a list of identifiers, but Typed OM Level 1 currently
treats space-separated multi-value cases as unsupported. Reification therefore
succeeds for a single identifier and returns Err(()) when more than one value
is present.
| Assignee | ||
Comment 11•16 days ago
|
||
Demonstrate iterable-field support in the ToTyped derive using the
container-name property.
The property accepts a list of identifiers, but Typed OM Level 1 currently
treats space-separated multi-value cases as unsupported. Reification therefore
succeeds for a single identifier and returns Err(()) when more than one value
is present.
| Assignee | ||
Comment 12•16 days ago
|
||
Demonstrate iterable-field support in the ToTyped derive using the
container-name property.
The property accepts a list of identifiers, but Typed OM Level 1 currently
treats space-separated multi-value cases as unsupported. Reification therefore
succeeds for a single identifier and returns Err(()) when more than one value
is present.
Updated•16 days ago
|
| Assignee | ||
Comment 13•16 days ago
|
||
Enable ToTyped derive for the OwnedList type used for computed values
generated by helpers.mako.rs for predefined types using the vector
field.
This further exercises the iterable-field support recently added to the
ToTyped derive. A few default ToTyped implementations were also added for
element types used by these iterable OwnedList representations.
This makes Typed OM reification pass WPTs for the following properties:
- animation-direction
- animation-fill-mode
- animation-play-state
- backdrop-filter
- background-attachment
- background-blend-mode
- background-clip
- background-image
- background-origin
- background-size
- box-shadow
- filter
- mask-image
| Assignee | ||
Comment 14•16 days ago
|
||
Enable ToTyped derive for SpecifiedValue type generated by helpers.mako.rs for
predefined types using the vector field.
This exercises the recently added iterable-field support in the ToTyped derive
across a broader set of property value types. Some additional ToTyped
implementations were added for element types used by these iterable
SpecifiedValue representations.
No new WPTs pass yet, as relevant tests also require iterable computed values
to be supported.
Updated•16 days ago
|
Updated•16 days ago
|
Updated•16 days ago
|
| Assignee | ||
Comment 15•13 days ago
|
||
Enable ToTyped derive for ComputedList type generated by helpers.mako.rs for
predefined types using the vector field.
This further exercises the iterable-field support recently added to the
ToTyped derive.
This makes Typed OM reification pass WPTs for the text-shadow property.
| Assignee | ||
Comment 16•13 days ago
|
||
animation-iteration-count values can now be reified into Typed OM values.
| Assignee | ||
Comment 17•13 days ago
|
||
animation-name values can now be reified into Typed OM values.
| Assignee | ||
Comment 18•13 days ago
|
||
background-repeat values can now be reified into Typed OM values.
| Assignee | ||
Comment 19•13 days ago
|
||
Refactor the ToTyped derive implementation so that multiple supported fields
can contribute TypedValue items. The derive now accumulates the reified output
of fields into a temporary list and validates the result against the variant's
No observable behavior changes occur yet. Existing derived types either
reify a single field or rely on iterable fields, so existing WPT tests
continue to pass.
A follow-up patch will demonstrate the new behavior by enabling reification
for BackgroundSize type (background-size property).
| Assignee | ||
Comment 20•13 days ago
|
||
Allow fields participating in ToTyped derive reification to be conditionally
skipped using a new #[typed_value(skip_if = "...")] attribute.
When present, the provided function is called with the field value during
reification. If it returns true, the field is ignored and produces no
TypedValue items.
This is useful for fields that only contribute to reification in specific
situations, without requiring the entire variant or struct to be treated as
unsupported.
| Assignee | ||
Comment 21•13 days ago
|
||
Demonstrate multi-field support in the ToTyped derive using the
background-size property.
The ExplicitSize variant contains separate width and height fields.
Reification now derives TypedValue items for both fields, using
This allows cases such as background-size: 3.14px or 200px 100px to
reify correctly (the former producing a CSSUnitValue while the latter falls
back to CSSUnsupportedValue).
| Assignee | ||
Comment 22•13 days ago
|
||
Negative values are invalid per the property definition, but in computed-value
tests they effectively appear as 0. Without custom handling in the test,
negative percentage inputs were compared directly, causing failures across
browsers (e.g. when setting values such as -3.14%).
Add a custom computed-value assertion that clamps percentage values below 0
to 0 before comparison.
| Assignee | ||
Comment 23•12 days ago
|
||
Fix what appears to be a copy/paste error in the WPT for the fill-rule
property.
The test currently uses the helper intended for list-valued properties even
though fill-rule is not list-valued. This does not affect the actual coverage,
since the helper ultimately delegates to the same underlying test logic, but
it is misleading.
Switch the test to the appropriate helper so it correctly reflects the
behavior of fill-rule.
| Assignee | ||
Comment 24•12 days ago
|
||
transition-timing-function values can now be reified into Typed OM values.
| Assignee | ||
Updated•10 days ago
|
Comment 25•10 days ago
|
||
Comment 26•9 days ago
|
||
| bugherder | ||
Comment 27•9 days ago
|
||
Comment 28•8 days ago
|
||
| bugherder | ||
Comment 29•8 days ago
|
||
Comment 30•7 days ago
|
||
| bugherder | ||
Comment 31•7 days ago
|
||
Comment 32•7 days ago
|
||
| bugherder | ||
Comment 33•7 days ago
|
||
Comment 35•6 days ago
|
||
| bugherder | ||
| Assignee | ||
Updated•6 days ago
|
Comment 37•5 days ago
|
||
Comment 38•5 days ago
|
||
| bugherder | ||
| Assignee | ||
Updated•5 days ago
|
Comment 39•5 days ago
|
||
Updated•5 days ago
|
Comment 40•4 days ago
|
||
| bugherder | ||
Comment 41•4 days ago
|
||
Comment 42•4 days ago
|
||
| bugherder | ||
Comment 43•3 days ago
|
||
Comment 44•3 days ago
|
||
| bugherder | ||
Comment 45•2 days ago
|
||
Comment 46•2 days ago
|
||
| bugherder | ||
Comment 47•2 days ago
|
||
Comment 48•2 days ago
|
||
| bugherder | ||
Comment 49•1 day ago
|
||
Comment 50•1 day ago
|
||
| bugherder | ||
Comment 51•1 day ago
|
||
Comment 52•20 hours ago
|
||
| bugherder | ||
Comment 53•19 hours ago
|
||
Description
•