Closed Bug 1804802 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 37414 - Fix a bug in CSSNumericValue parsing

Categories

(Core :: DOM: CSS Object Model, task, P4)

task

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

Fix a bug in CSSNumericValue parsing

In CSSNumericValue parsing, there's a part of code that tries to merge
consecutive binary operations (e.g., a + b + c) into a variable
Typed OM operation node. The code was written before the introduction
of min/max/clamp, and incorrectly loops into such nodes, and then tries
to convert a min/max/clamp as a binary arithmetic operation.

This patch makes it aware that there are comparison nodes in the
expression tree and therefore fixes the bug.

Fixed: 1395232
Change-Id: Iff12c5f26785effa716b705630c21219935f9861
Reviewed-on: https://chromium-review.googlesource.com/4090552
WPT-Export-Revision: 02ac4fea5ef796efbf7aa97b2099c9ab24e9fa96

Component: web-platform-tests → DOM: CSS Object Model
Product: Testing → Core

CI Results

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

Total 1 tests and 11 subtests

Status Summary

Firefox

OK : 1
FAIL : 11

Chrome

CRASH: 1

Safari

OK : 1
FAIL : 11

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /css/css-typed-om/stylevalue-subclasses/numeric-objects/parse.tentative.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-isolated-process-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: CRASH, Safari: OK)
    • Parsing an invalid string throws SyntaxError: FAIL (Safari: FAIL)
    • Parsing a string with a non numeric token throws SyntaxError: FAIL (Safari: FAIL)
    • Parsing a string with left over numeric tokens throws SyntaxError: FAIL (Safari: FAIL)
    • Parsing a calc with incompatible units throws a SyntaxError: FAIL (Safari: FAIL)
    • Parsing a <dimension-token> with invalid units throws a SyntaxError: FAIL (Safari: FAIL)
    • Parsing ignores surrounding spaces: FAIL (Safari: FAIL)
    • Parsing min() is successful: FAIL (Safari: FAIL)
    • Parsing max() is successful: FAIL (Safari: FAIL)
    • Parsing clamp() is successful: FAIL (Safari: FAIL)
    • Parsing sum of multiple min() is successful: FAIL (Safari: FAIL)
    • Parsing product of multiple min() is successful: FAIL (Safari: FAIL)

Tests Disabled in Gecko Infrastructure

  • /css/css-typed-om/stylevalue-subclasses/numeric-objects/parse.tentative.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-isolated-process-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: CRASH, Safari: OK)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7041a2e5b24f [wpt PR 37414] - Fix a bug in CSSNumericValue parsing, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
You need to log in before you can comment on or make changes to this bug.