Files
sousa-gecko/testing/web-platform/tests/css/css-values/random-invalid.tentative.html
T
moonira 71ed208995 Bug 2034053 [wpt PR 59389] - Make random ident optional in the grammar, a=testonly
Automatic update from web-platform-tests
Make random ident optional in the grammar

New syntax:

<random-key> = auto | <random-name> | fixed <number [0,1]>
<random-cache-key> = <dashed-ident> || element-scoped
                       || [ property-scoped | property-index-scoped
                            | <random-ua-ident> ]
<random-ua-ident> = <custom-ident>

https://drafts.csswg.org/css-values-5/#typedef-random-key

Bug: 413385732
Change-Id: Iadf7c344df480ec8b72a093d8aa417c9007512d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7776936
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Munira Tursunova <moonira@google.com>
Cr-Commit-Position: refs/heads/main@{#1618240}

--

wpt-commits: 86e05bfda87c0146be40384d09c0aa946713f1a4
wpt-pr: 59389
2026-04-28 18:13:22 +00:00

49 lines
2.8 KiB
HTML

<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-values-5/#random">
<link rel="author" title="sam@webkit.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script>
<script>
test_invalid_value('width', 'random()');
test_invalid_value('width', 'random( )');
test_invalid_value('width', 'random(,)');
test_invalid_value('width', 'random(1px, )');
test_invalid_value('width', 'random(,1px)');
test_invalid_value('width', 'random(1px)');
test_invalid_value('width', 'random(1px,2px,)');
test_invalid_value('width', 'random(1px,2px,1px,)');
test_invalid_value('width', 'random(1px,2px,1px foo)');
test_invalid_value('width', 'random(foo, 1px, 2px)');
test_invalid_value('width', 'random("foo", 1px, 2px)');
test_invalid_value('width', 'random("--foo", 1px, 2px)');
test_invalid_value('width', 'random(element-shared foo, 1px, 2px)');
test_invalid_value('width', 'random(element-shared 1px, 2px)');
test_invalid_value('width', 'random(1px, 2px, 1px, element-shared)');
test_invalid_value('width', 'random(--foo --bar, 1px, 2px)');
test_invalid_value('width', 'random(fixed 0.5 element-shared, 1px, 2px)');
test_invalid_value('width', 'random(fixed 0.5 auto, 1px, 2px)');
test_invalid_value('width', 'random(fixed 0.5 --foo, 1px, 2px)');
test_invalid_value('width', 'random(fixed 0.5px, 1px, 2px)');
test_invalid_value('width', 'random(fixed 0.5%, 1px, 2px)');
test_invalid_value('width', 'random(fixed -1, 1px, 2px)');
test_invalid_value('width', 'random(10deg, 20deg)');
test_invalid_value('width', 'random(element-scoped --foo --bar, 1px, 2px)');
test_invalid_value('width', 'random(element-scoped uawidth, 1px, 2px)');
test_invalid_value('width', 'random(foo element-scoped, 1px, 2px)');
test_invalid_value('width', 'random(element-scoped 1px, 2px)');
test_invalid_value('width', 'random(--foo element-scoped element-scoped, 1px, 2px)');
test_invalid_value('width', 'random(property-scoped --foo ua-width, 1px, 2px)');
test_invalid_value('width', 'random(property-scoped ua-width-1, 1px, 2px)');
test_invalid_value('width', 'random(--foo element-scoped property-scoped element-scoped, 1px, 2px)');
test_invalid_value('width', 'random(foo property-scoped, 1px, 2px)');
test_invalid_value('width', 'random(property-scoped 1px, 2px)');
test_invalid_value('width', 'random(property-scoped property-index-scoped, 1px, 2px)');
test_invalid_value('width', 'random(property-index-scoped --foo property-scoped, 1px, 2px)');
test_invalid_value('width', 'random(property-index-scoped ua-width-1, 1px, 2px)');
test_invalid_value('width', 'random(foo property-index-scoped, 1px, 2px)');
test_invalid_value('width', 'random(property-index-scoped 1px, 2px)');
test_invalid_value('width', 'random(property-index-scoped property-scoped, 1px, 2px)');
</script>