[wpt-sync] Sync PR 56220 - Implement basic support for random() function
Categories
(Core :: CSS Parsing and Computation, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 56220 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/56220
Details from upstream follow.
moonira <moonira@google.com> wrote:
Implement basic support for random() function
Add random function to CSSMathExpressionNode.
Random base value cache [0] is stored on the Document.There are two major remaining things:
Currently we don't store correct property name and property value
index in random caching key [1]. There are failing tests reflecting
that.If a random() function can’t be simplified by computed value time,
then it should compute to its maximally-simplified form,
but with its \<random-value-sharing> set to its random base value, [2].
This currently doesn't work correctly since we just resolve to
computed percentage value instead, i.e. same as min-max percentage
serialization doesn't work correctly in chrome [3].Note: There are some failing tests that allows calc expressions and
random function inside fixed value, like:random(fixed calc(2 / 4), 0px, 100px)
Though according to spec only numbers from 0 to 1
(fixed \<number [0,1]>) should be allowed. These tests
should probably be removed.Tests with invalidation to be added in the next CL.
[0] https://drafts.csswg.org/css-values-5/#random-caching
[1] https://drafts.csswg.org/css-values-5/#random-caching-key
[2] https://drafts.csswg.org/css-values-5/#random
[3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/css/css-values/minmax-percentage-serialize-expected.txt
[4] https://drafts.csswg.org/css-values-5/#valdef-random-fixedBug: 413385732
Change-Id: I350a1c616d69302353c935dd12580f846ec59a53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7170451
Commit-Queue: Munira Tursunova \<moonira@google.com>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1549109}
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests and 72 subtests
Status Summary
Firefox
OK : 1
PASS: 4
FAIL: 68
Chrome
OK : 1
PASS: 4
FAIL: 68
Safari
OK : 1
PASS: 68
FAIL: 4
Links
Details
New Tests That Don't Pass
- /css/css-values/random-computed.tentative.html [wpt.fyi]
- Property scale value 'random(1, 11)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(--foo, 2, 12)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(--foo element-shared, 3, 13)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(element-shared --foo, 4, 14)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(0, 10, 5)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(--foo, 10, 20, 5)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(--foo element-shared, 20, 30, 5)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(element-shared --foo, 30, 40, 5)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(100, 10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(-10, -100)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(-100, -10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(40, 50, -5)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(5 * 1, 30 / 2)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(2 * random(6, 16))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(NaN, 100)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, NaN)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(NaN, NaN)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(NaN, 100, 10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, NaN, 10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(NaN, NaN, 10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(NaN, 100, NaN)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, NaN, NaN)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(NaN, NaN, NaN)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, 100, NaN)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(NaN, 100))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, NaN))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(NaN, NaN))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(NaN, 100, 10))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, NaN, 10))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(NaN, NaN, 10))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(NaN, 100, NaN))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, NaN, NaN))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(NaN, NaN, NaN))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, 100, NaN))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(infinity, 100)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(infinity, infinity)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(infinity, 100, 10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(infinity, infinity, 10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(infinity, 100, infinity)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(infinity, infinity, infinity)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(infinity, 100))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(infinity, infinity))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(infinity, infinity, 10))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(infinity, 100, infinity))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(infinity, infinity, infinity))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(infinity, 100, 10))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, infinity)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, infinity, 10)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, infinity, infinity)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, infinity))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, infinity, 10))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, infinity, infinity))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'random(10, 100, infinity)':
FAIL(Chrome:FAIL, Safari:FAIL) - Property scale value 'calc(10 + random(10, 100, infinity))':
FAIL(Chrome:FAIL, Safari:FAIL) - Property scale value 'random(10, 100, -infinity)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value 'calc(10 + random(10, 100, -infinity))':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value on pseudo element '::before' 'random(7, 17)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value on pseudo element '::before' 'random(--bar, 8, 18)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value on pseudo element '::before' 'random(element-shared, 9, 19)':
FAIL(Chrome:FAIL, Safari:PASS) - Property scale value on pseudo element '::before' 'random(element-shared --foo, 10, 20)':
FAIL(Chrome:FAIL, Safari:PASS) - Property translate value 'random(10%, 100%)':
FAIL(Chrome:FAIL, Safari:PASS) - Property translate value 'random(fixed random(1, 2), 10%, 100%)':
FAIL(Chrome:FAIL, Safari:FAIL) - Property translate value 'random(fixed random(-2, -1), 10%, 100%)':
FAIL(Chrome:FAIL, Safari:FAIL) - Maximum random: 'random(a, b)':
FAIL(Chrome:FAIL, Safari:PASS) - Maximum random - shorthand: random(a, b):
FAIL(Chrome:FAIL, Safari:PASS) - Shared by name within an element: 'random(--identifier, a, b)':
FAIL(Chrome:FAIL, Safari:PASS) - Shared globally: random(--identifier element-shared, a, b):
FAIL(Chrome:FAIL, Safari:PASS) - Fixed: random(fixed <number>, a, b):
FAIL(Chrome:FAIL, Safari:PASS)
- Property scale value 'random(1, 11)':
Comment 4•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c84bc466d176
https://hg.mozilla.org/mozilla-central/rev/a74fcea32978
Description
•