Bug 1811203 [wpt PR 38059] - Bail out if there is trailing stuff after parsing color...
commit95ccd88b410d5a2d3d80b3245690062e1ed94b9b
authorErgün Erdoğmuş <ergunsh@chromium.org>
Fri, 27 Jan 2023 14:14:11 +0000 (27 14:14 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Wed, 1 Feb 2023 13:59:34 +0000 (1 13:59 +0000)
tree2b3d1f4c50c78f202fca27eb4936d219a4679723
parentf541315b878fd6a04157058a31749b294e51963e
Bug 1811203 [wpt PR 38059] - Bail out if there is trailing stuff after parsing color-mix parameters, a=testonly

Automatic update from web-platform-tests
Bail out if there is trailing stuff after parsing color-mix parameters

`color-mix` syntax is defined as `color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2})` which I'd interpret as:

* It contains precisely 3 parameters
* First parameter is <color-interpolation-method>
* The other two parameters are of the form `[<color> && <percentage [0, 100>?]`

`[<color> && <percentage [0, 100>?]` I read as:

* There should be precisely 2 components or 1 component: color and the optional percentage and they can appear in any order.

So, when I put another component to a parameter, it won't match the syntax anymore.

[1]: https://www.w3.org/TR/css-values-4/#number-value

Bug: 1362022
Change-Id: I4b0b258c1499ba89621f332b942bed7eb36e5483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4177164
Reviewed-by: Aaron Krajeski <aaronhk@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1095727}

--

wpt-commits: 4eba0e18bc2721a8ae32cd62f65e0045af217f89
wpt-pr: 38059
testing/web-platform/tests/css/css-color/parsing/color-invalid-color-mix-function.html