Closed Bug 1961971 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 52096 - Always add parens when serializing math operations.

Categories

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

task

Tracking

()

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

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

Always add parens when serializing math operations.

Our serialization logic currently serializes a + b * c where it should
be (a + (b * c)); change it to match the spec. Note that this may
create top-level parens, which the serializing math function must
remove; this again matches how the spec thinks. (This reverts the
calc((1 / x)) behavior that I erroneously added; it really should be
calc(1 / x).)

This fixes a lot of tests, but introduces a regression that we can
hopefully fix in a coming patch; since our tree is binary, we will
serialize non-binary sums or products as ((a + b) + c) instead of
(a + b + c) as they should be. This doesn't actually happen that
often, though, because it requires abc to be either of different
units or otherwise impossible to simplify.

Bug: 40118274
Change-Id: I737faf134c4601682dd230cd573be3a4826d414e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6459003
Commit-Queue: Steinar H Gunderson \<sesse@chromium.org>
Reviewed-by: Daniil Sakhapov \<sakhapov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1449863}

PR 52096 applied with additional changes from upstream: 7d36ceb8b9bf13b5393fe050f346d414b4a8e5db, 650766152171c347ff4eba444514a38870d36576
Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

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

Total 6 tests and 19 subtests

Status Summary

Firefox

OK : 5
PASS : 1136
FAIL : 69
ERROR: 1

Chrome

OK : 6
PASS : 1193
FAIL : 34

Safari

OK : 6
PASS : 1156
FAIL : 71

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

  • /css/css-typed-om/stylevalue-serialization/cssTransformValue.tentative.html [wpt.fyi]: ERROR [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-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt] (Chrome: OK, Safari: OK)
  • /css/css-fonts/font-shorthand-serialization-font-stretch.html [wpt.fyi]
    • calc() transformation into keywords: FAIL (Chrome: FAIL, Safari: FAIL)
  • /css/css-values/calc-size/animation/calc-size-interpolation-expansion.html [wpt.fyi]
    • value at progress 0.75 in animation of "height" from "auto" to "calc-size(any, 0px)": FAIL (Chrome: FAIL, Safari: FAIL)
    • value at progress 0.75 in animation of "height" from "0px" to "calc-size(calc-size(min-content, size + 20px), 2 * size)": FAIL (Chrome: FAIL, Safari: FAIL)
    • value at progress 0.75 in animation of "height" from "calc-size(min-content, size * 4)" to "calc-size(calc-size(min-content, size + 20px), 2 * size)": FAIL (Chrome: FAIL, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(fit-content, 20px)" to "calc-size(calc-size(fit-content, 40px), size)": FAIL (Chrome: PASS, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(any, 20px)" to "calc-size(calc-size(fit-content, 40px), size)": FAIL (Chrome: PASS, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(calc-size(any, 30px), 20px)" to "calc-size(calc-size(fit-content, 40px), size)": FAIL (Chrome: PASS, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(fit-content, 20px)" to "calc-size(calc-size(fit-content, 3 * size + 10px), min(size + 20px, 2 * size - 30px) + 2 * size + 80px)": FAIL (Chrome: FAIL, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(50%, size)" to "calc-size(calc-size(45%, (2 * size)), size + 20px)": FAIL (Chrome: FAIL, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(40%, size)" to "calc-size(calc-size(10px, (2 * size)), size + 20px)": FAIL (Chrome: FAIL, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(80px, size)" to "calc-size(calc-size(10px, (2 * size)), size + 20px)": FAIL (Chrome: PASS, Safari: FAIL)
    • value at progress 0.75 in animation of "width" from "calc-size(80px, size)" to "calc-size(calc-size(any, 20px), size + 20px)": FAIL (Chrome: PASS, Safari: FAIL)
  • /css/css-values/calc-size/calc-size-parsing.html [wpt.fyi]
    • e.style['width'] = "calc-size(auto, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['min-width'] = "calc-size(auto, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['height'] = "calc-size(auto, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['min-height'] = "calc-size(auto, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['height'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['max-width'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['max-height'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['min-width'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['min-height'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['block-size'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['inline-size'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['max-block-size'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['max-inline-size'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['min-block-size'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['min-inline-size'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(fit-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['height'] = "calc-size(min-content, size * 2)" should set the property value: FAIL (Chrome: FAIL, Safari: FAIL)
    • e.style['max-width'] = "calc-size(max-content, size / 2)" should set the property value: FAIL (Chrome: FAIL, Safari: FAIL)
    • e.style['max-height'] = "calc-size(fit-content, 30px + size / 2)" should set the property value: FAIL (Chrome: FAIL, Safari: FAIL)
    • e.style['width'] = "calc-size(fit-content, 50% + size / 2)" should set the property value: FAIL (Chrome: FAIL, Safari: FAIL)
    • e.style['width'] = "calc-size(any, 25em)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(any, 40%)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(any, 50px + 30%)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(calc-size(any, 30px), size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(10px, sign(size) * size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(30px, 25em)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(calc-size(any, 30px), 25em)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(calc-size(2in, 30px), 25em)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(calc-size(min-content, 30px), 25em)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(calc-size(min-content, size), size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['flex-basis'] = "calc-size(any, 50px)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['flex-basis'] = "calc-size(auto, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['flex-basis'] = "calc-size(min-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['flex-basis'] = "calc-size(max-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['flex-basis'] = "calc-size(fit-content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['flex-basis'] = "calc-size(content, size)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
    • e.style['width'] = "calc-size(0px, 0px)" should set the property value: FAIL (Chrome: PASS, Safari: FAIL)
  • /css/css-values/calc-size/calc-size-typed-om.html [wpt.fyi]
    • computedStyleMap serialization of width: calc-size(auto, size): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(fit-content, size): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of height: calc-size(min-content, size * 2): FAIL (Chrome: FAIL, Safari: FAIL)
    • computedStyleMap serialization of max-width: calc-size(max-content, size / 2): FAIL (Chrome: FAIL, Safari: FAIL)
    • computedStyleMap serialization of max-height: calc-size(fit-content, 30px + size / 2): FAIL (Chrome: FAIL, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(fit-content, 50% + size / 2): FAIL (Chrome: FAIL, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(any, 30px): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(any, 25em): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(any, 40%): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(any, 50px + 30%): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(any, min(30px, 2em)): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(10px, sign(size) * size): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(30px, 25em): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(calc-size(any, 30px), size): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(calc-size(any, 30px), 25em): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(calc-size(2in, 30px), 25em): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(calc-size(min-content, 30px), 25em): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(calc-size(min-content, size), size): FAIL (Chrome: PASS, Safari: FAIL)
    • computedStyleMap serialization of width: calc-size(calc-size(fit-content, size * 2), size): FAIL (Chrome: FAIL, Safari: FAIL)

Tests Disabled in Gecko Infrastructure

  • /css/css-typed-om/stylevalue-serialization/cssTransformValue.tentative.html [wpt.fyi]: ERROR [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-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt] (Chrome: OK, Safari: OK) linked bug:Bug 1960654
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6b1bdf690d71 [wpt PR 52096] - Always add parens when serializing math operations., a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
You need to log in before you can comment on or make changes to this bug.