Closed Bug 2077616 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63209 - Disallow percentage in calc() for <length>

Categories

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

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(1 file)

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

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

Rune Lillesveen <futhark@chromium.org> wrote:

Disallow percentage in calc() for <length>

We should not allow values such as calc(4px * sign(10%)) as a valid
\<length>.

Adjusted test_invalid_length() tests lacking a calc() wrapper which
made them incorrectly pass without the changes here.

This CL also disallows percentage in \<length> for these cases:

calc(4px * sign(10% / 10%)
calc(4px * (10% / 10%))

There are open issues against the spec:

https://github.com/w3c/csswg-drafts/issues/14300
https://github.com/w3c/csswg-drafts/issues/12204
https://github.com/w3c/csswg-drafts/issues/10017

The two latter aligns with the current Firefox Nightly.

It should be noted that we already disallowed percentages for other
value types such as \<angle> and \<resolution>.

Fixes a UAF issue where CalcHandles() are accessed from multiple
threads computing length values in a canvas worker thread.

Turn DCHECK() into CHECK() for IsMainThread() to crash instead of
doing cross thread access to CalcHandles().

Bug: 416644951, 567611695
Change-Id: I1e4be23733b3139d16986e3848323a99248f72f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8482545
Commit-Queue: Rune Lillesveen \<futhark@chromium.org>
Reviewed-by: David Baron \<dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1709882}

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Attached file Notable wpt changes —

CI Results

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

Total 545 tests and 23 subtests

Status Summary

Firefox

OK : 1[GitHub] 279[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 308[Gecko-linux2404-64-debug] 309[Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 23[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 54[GitHub] 6198[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 6362[Gecko-android-em-14-x86_64-debug-geckoview] 6363[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 6380[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL : 4106[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 4152[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 4167[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
TIMEOUT: 1

Chrome

OK : 1
PASS : 50
CRASH : 1
FAIL : 3

Safari

OK : 1
PASS : 52
FAIL : 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

(See attachment for full changes)

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: