Closed Bug 1613491 Opened 5 years ago Closed 5 years ago

Add some calc() infrastructure to deal with simplification, sorting

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(2 files)

We're going to need a more generic simplification mechanism than what we have right now to implement min() / max() / etc. Cleanup the calc parsing code to do this simplification in the tree of expressions.

For now, we still bail out at parse time if we find an unsimplified min / max / etc in a length / length-percentage value. That is a follow-up.

For now, we still bail out at the stage of getting the calc node into a
CalcLengthPercentage if we couldn't simplify the min() / max() / clamps()
involved.

After this plan is to use just CalcNode everywhere instead of
specified::CalcLengthPercentage, and then modify the computed
CalcLengthPercentage, which would look slightly different as we know all the sum
terms for those are a struct like { Length, Percentage, bool has_percentage } or
such, so all the simplification code for that becomes much simpler, ideally.

Or we could turn CalcNode generic otherwise, if it's too much code... We'll see.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6810e67ed43e Add some calc infrastructure to deal with simplification / sorting / etc. r=heycam
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/21698 for changes under testing/web-platform/tests
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c083885bd068 Make rust generate better code for some of the functions introduced here. r=heycam
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Upstream PR merged by moz-wptsync-bot
Type: defect → enhancement
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: