Closed Bug 1932649 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 49311 - Make ConsumeNumberOrPercent() not crash on unresolvable calc().

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

Steinar H. Gunderson <sesse@chromium.org> wrote:

Make ConsumeNumberOrPercent() not crash on unresolvable calc().

Instead of calling GetDoubleValue() on percentage calc expressions,
we just return them directly, and then add a new rule saying that
ComputeNumber() on them returns the percentage value divided by 100.
This avoids crashes when we try to force them during parsing.

This also takes us halfway towards fixing the opacity-valid.html test;
we no longer convert it into just a double (without surrounding calc()),
but since we don't properly simplify comparison expressions containing
percentages, we don't simplify as much as we should either, so the test
is still broken. (And even after that, we'd probably need to convert
percentages to decimals inside calc for such properties.)

Change-Id: I8e0e25c35d3df82da75cfb1cf551d7f25d825696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6037437
Reviewed-by: Anders Hartvoll Ruud \<andruud@chromium.org>
Commit-Queue: Steinar H Gunderson \<sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1386209}

PR 49311 applied with additional changes from upstream: 4110ada1b66a0d7f2470dc32e4c9366284c7d4bc
Component: web-platform-tests → Layout
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 2 subtests

Status Summary

Firefox

OK : 1
FAIL: 2

Chrome

OK : 1
PASS: 2

Safari

OK : 1
PASS: 2

Links

GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6ef49a46449c [wpt PR 49311] - Make ConsumeNumberOrPercent() not crash on unresolvable calc()., a=testonly https://hg.mozilla.org/integration/autoland/rev/34e1a1467ed0 [wpt PR 49311] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.