Closed Bug 1616691 Opened 5 years ago Closed 5 years ago

Implement min() / max() / clamp() for <length> and <length-percentage>

Categories

(Core :: CSS Parsing and Computation, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(8 files)

Once this is done we should be able to call it a day and call this feature complete.

We'll use CalcNode as the specified value representation for <length> and
<length-percentage> values, so they'll have to implement ToCss.

There's one minor issue (two calls to to_css() instead of to_css_impl() which
are addressed later in the series).

We'll have different leaf nodes as we progress in the value computation stage.

Depends on D63395

This is the meat of the patch. There are a couple improvements done in a couple
later patches which should hopefully be straight-forward.

Depends on D63396

So as to avoid allocating an intermediate tree in Rust to resolve
<length-percentage> values.

Depends on D63398

We were serializing calc(10% + 4px) as calc(10% + calc(4px)).

Depends on D63399

We never fast-reject numbers (because they could be part of a product). Without
this refactoring we'd accept stuff like calc(10) and crash during the evaluation
for obvious reasons.

Depends on D63400

Regressions: 1628644
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: