Implement additional CSSMathValue reification support
Categories
(Core :: CSS Parsing and Computation, task)
Tracking
()
People
(Reporter: janv, Assigned: janv)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Attachments
(16 files, 1 obsolete file)
|
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 | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
This bug tracks additional CSSMathValue reification work as defined in the CSS Typed OM Level 1 specification.
The work focuses on completing support for reifying CSS math expressions into the corresponding CSSMathValue subclasses, including CSSMathProduct, CSSMathNegate, CSSMathInvert, CSSMathMin, CSSMathMax, and CSSMathClamp.
This complements the existing CSSStyleValue reification infrastructure and extends the TypedValue machinery to represent a broader range of numeric expressions in their Typed OM form.
This intentionally excludes CSSMathSum, which already gained most of the required infrastructure to support reification and associated WPT coverage. However, this bug may still include additional improvements that are shared with or benefit CSSMathSum as well.
| Assignee | ||
Comment 1•4 days ago
|
||
Fix the argument order in parse.tentative.html so the actual value is passed
before the expected value.
The previous ordering made failure output confusing because the expected and
actual values were reported in the wrong direction. No behavior change is
intended.
| Assignee | ||
Comment 2•4 days ago
|
||
Reorder the math value match arms in CalcNode::to_typed_impl to match the
ordering of the corresponding GenericCalcNode variants.
This makes the code easier to navigate while preparing for additional math
reification support. No functional changes intended.
| Assignee | ||
Comment 3•4 days ago
|
||
Add helper constructors for CalcNodeWithLevel and use them at existing call
sites.
This avoids repeating CalcNodeWithLevel initialization boilerplate and makes
the code easier to follow while preparing for additional math reification
support. No functional changes intended.
| Assignee | ||
Comment 4•4 days ago
|
||
This patch introduces infrastructure for reifying min() expressions into
CSSMathMin objects as part of the CSS Typed OM implementation.
A new MathMin type is added to represent min() expressions, mirroring the
CSSMathMin object, and is integrated into the MathValue enum.
This is an incremental step, support for additional expressions will be added
in follow-up patches.
| Assignee | ||
Comment 5•4 days ago
|
||
This patch introduces infrastructure for reifying max() expressions into
CSSMathMax objects as part of the CSS Typed OM implementation.
A new MathMax type is added to represent max() expressions, mirroring the
CSSMathMax object, and is integrated into the MathValue enum.
This is an incremental step, support for additional expressions will be added
in follow-up patches.
| Assignee | ||
Comment 6•4 days ago
|
||
Add OwnedArray<T, N>, a cbindgen-friendly replacement for Box<[T; N]>.
OwnedArray provides a compact allocation-backed container for a fixed number
of elements while exposing a simple representation to generated C++ bindings.
This utility is expected to be useful in other cases in the future. As an
immediate follow-up, it will be used by CSSMathClamp reification.
| Assignee | ||
Comment 7•4 days ago
|
||
This patch introduces infrastructure for reifying clamp() expressions into
CSSMathClamp objects as part of the CSS Typed OM implementation.
A new MathClamp type is added to represent clamp() expressions, mirroring the
CSSMathClamp object, and is integrated into the MathValue enum.
This is an incremental step, support for additional expressions will be added
in follow-up patches.
| Assignee | ||
Comment 8•3 days ago
|
||
Add a CSSNumericValue.parse() test for calc() subtraction.
The new test verifies that subtraction is reified as CSSMathSum containing a
CSSMathNegate argument, matching the math expression reification algorithm.
| Assignee | ||
Comment 9•3 days ago
|
||
This patch introduces infrastructure for reifying subtraction expressions into
CSSMathNegate objects as part of the CSS Typed OM implementation.
A new MathNegate type is added to represent subtraction expressions, mirroring
the CSSMathNegate object, and is integrated into the MathValue enum.
This is an incremental step, support for additional expressions will be added
in follow-up patches.
| Assignee | ||
Comment 10•3 days ago
|
||
This patch introduces initial plumbing for reifying inversion expressions into
CSSMathInvert objects as part of the CSS Typed OM implementation.
A new MathInvert type is added to represent inversion expressions, mirroring
the CSSMathInvert object, and is integrated into the MathValue enum.
The actual reification remains unsupported for now, because division is
currently simplified or normalized away in all cases (except possibly
expressions involving colors, which are not supported by Typed OM math
expressions).
This is another incremental step; support for additional expressions will be
added in follow-up patches.
| Assignee | ||
Comment 11•3 days ago
|
||
Add a CSSNumericValue.parse() test for calc() multiplication.
The new test verifies that multiplication is reified as CSSMathProduct and can
contain nested CSSMathSum, CSSMathMin, and CSSMathMax expressions, matching the math expression reification algorithm.
| Assignee | ||
Comment 12•3 days ago
|
||
This patch introduces infrastructure for reifying multiplication expressions
into CSSMathProduct objects as part of the CSS Typed OM implementation.
A new MathProduct type is added to represent multiplication expressions,
mirroring the CSSMathProduct object, and is integrated into the MathValue
enum.
As a final integration step, this patch completes math expression reification
support.
Updated•2 days ago
|
| Assignee | ||
Comment 13•2 days ago
|
||
Add a CSSNumericValue.parse() test for calc() division.
The new test verifies that division is reified as CSSMathProduct containing a
CSSMathInvert argument, matching the math expression reification algorithm.
| Assignee | ||
Comment 14•2 days ago
|
||
This patch completes support for reifying division expressions into
CSSMathInvert objects as part of the CSS Typed OM implementation.
A previous patch added the underlying CSSMathInvert infrastructure, but the
actual reification path remained unsupported. In particular, CSSMathInvert
reification depends on CSSMathProduct support, and division expressions were
believed to be simplified or normalized away before reification.
A new WPT uncovered a valid expression that preserves division in the
calculation tree, allowing the final CSSMathInvert reification support to be
implemented and tested.
| Assignee | ||
Comment 15•2 days ago
|
||
Add a CSSNumericValue.parse() test for calc() complex expression.
The new test verifies that a complex expression is reified as a nested
CSSMathSum containing CSSMathNegate and CSSMathProduct arguments, matching the
math expression reification algorithm.
| Assignee | ||
Comment 16•2 days ago
|
||
Remove the uninitialized CSSMathValue internal type and the corresponding
placeholder handling from CSSMathValue.
All CSSMathValue-derived objects now use concrete internal types, so the
uninitialized placeholder used during incremental implementation is no longer
needed.
| Assignee | ||
Comment 17•2 days ago
|
||
Remove the Maybe<> wrappers from the helpers that convert CSSNumericValue
derived objects back to their Style* counterparts for Stylo.
Now that CSSMathValue derived objects always have a concrete internal type,
these conversions no longer need to handle uninitialized values.
Updated•2 days ago
|
Description
•