Closed Bug 1578921 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 18858 - Do not simplify calc(0px + 0%) into 0px

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 18858 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/18858
Details from upstream follow.

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

Do not simplify calc(0px + 0%) into 0px

Currently, when we create |Length| from calc(), and then create a
CSSPrimitiveValue from that |Length|, we may drop the percentage part
if it's zero.

As discussed at https://github.com/w3c/csswg-drafts/issues/3482, zero
percentages in calcs should be preserved.

Hence, this part ensures that percentage is perserved in calc(0px + 0%)

Note: we may want to preserve 0% in all cases, but that leads to many
test failures, so we leave the investigation to future instead.

This is also preparation for crrev.com/c/1777025, which switches the
implementation of InterpolableLength to a math expression to support
min/max.

Bug: 991672
Change-Id: I386f42a323079cce3d6ee545fa00ef289406e8bf
Reviewed-on: https://chromium-review.googlesource.com/1779721
WPT-Export-Revision: 163bc365b1a9ee019ca752bccfd175f1afb6cfbe

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Ran 1 tests
PASS   : 1
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/203d6c814937
[wpt PR 18858] - Do not simplify calc(0px + 0%) into 0px, a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.