Closed Bug 1575417 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 18574 - Support percentage comparison resolution against negative reference values

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

Support percentage comparison resolution against negative reference values

It's a very edge case that a percentage may be resolved against a
negative value, which is allowed only in 'background-position' property.

To support this without massively changing existing code, this patch
adds an indicator flag to |CSSMathFunctionValue|, so that when the flag
is set, the resolution of calculated percentage values is delayed to when
a reference value is available. When the flag is not set, we still use
the existing code path where a calculated percentage value can be
resolved immediately.

Together with this patch is a test suite on parsing and evaluation of
comparisons on percentages.

Bug: 825895, 978682
Change-Id: I2a6aabd48313ccda82b50f6dc00fd62c4548bc84
Reviewed-on: https://chromium-review.googlesource.com/1762970
WPT-Export-Revision: fb2ca7bc74a29c4f81857e681125899b73df847a

Component: web-platform-tests → Layout
Product: Testing → Core
Ran 3 tests and 62 subtests
OK     : 2
PASS   : 49
FAIL   : 14

New tests that have failures or other problems:
/css/css-backgrounds/background-position-negative-percentage-comparison.html: FAIL
/css/css-values/minmax-percentage-computed.html
    Property margin-left value 'calc(max(10%, 20%) * 2)' computes to '160px': FAIL
    Property margin-left value 'calc(max(10%, 20%) + 5%)' computes to '100px': FAIL
    Property margin-left value 'calc(max(10%, 20%) - 5%)' computes to '60px': FAIL
    Property margin-left value 'calc(max(10%, 20%) / 2)' computes to '40px': FAIL
    Property margin-left value 'calc(min(10%, 20%) * 2)' computes to '80px': FAIL
    Property margin-left value 'calc(min(10%, 20%) + 5%)' computes to '60px': FAIL
    Property margin-left value 'calc(min(10%, 20%) + max(10%, 5%))' computes to '80px': FAIL
    Property margin-left value 'calc(min(10%, 20%) - 5%)' computes to '20px': FAIL
    Property margin-left value 'calc(min(10%, 20%) / 2)' computes to '20px': FAIL
    Property margin-left value 'max(1%)' computes to '4px': FAIL
    Property margin-left value 'max(10%, min(20%, 15%))' computes to '60px': FAIL
    Property margin-left value 'min(1%)' computes to '4px': FAIL
    Property margin-left value 'min(20%, max(10%, 15%))' computes to '60px': FAIL
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e5e59e33b55f
[wpt PR 18574] - Support percentage comparison resolution against negative reference values, a=testonly
https://hg.mozilla.org/integration/mozilla-inbound/rev/82eed622a6a8
[wpt PR 18574] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.