Avoid extra work and allocations when resolving non-length calc expressions.
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: emilio, Assigned: sajidanwar)
References
Details
Attachments
(2 files)
Bug 2035572 introduces a pattern like:
calc.node.with_computed_context(context).resolve()
Where with_computed_context will traverse the tree and allocate a bunch of nodes, and resolve() will do the same again.
Instead, it seems it'd be easier to just pass an Option<&Context> down to resolve() and friends, or something along those lines?
| Assignee | ||
Comment 1•4 months ago
|
||
Updated•4 months ago
|
| Assignee | ||
Comment 2•4 months ago
|
||
Backed out for causing wpt failures @calc-infinity-nan-computed.html.
| Assignee | ||
Comment 6•3 months ago
|
||
Failure here was from having moved the normalize(value).min(f32::MAX).max(f32::MIN) to inside the CalcNumeric::resolve, which made that fire on the computed angle degrees before performing the Infinity/NaN → 0deg replacement. That causes the Infinity values to turn into f32::MAX/MIN which are nonsensical for angles.
Going to push an update to the patch to move the normalize/min/max back out to the individual callers so that it can be skipped for angle.
Comment 8•3 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/839c4f0555e6
https://hg.mozilla.org/mozilla-central/rev/c5b468db452a
Updated•3 months ago
|
Description
•