Automatic update from web-platform-tests [ident] Implement ident() function fundamentals The ident() function allows identifiers to be constructed dynamically by e.g. concatenating strings and integers. This CL implements the "bare minimum" to get the feature going, and only supports view-transition-name for now. It may accidentally already work in other properties. If that's the case, then future CLs will land WPTs for those properties gradually. Note that this feature has several open questions, and this CL does not try to answer all of them. Some important ones are filed as dependencies of Issue 384930424. Bug: 384930424 Change-Id: I0fea0eb3163c3ac3fead8a139220c571a1aa5628 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6551725 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1461990} -- wpt-commits: 50787b55380d0310268cc40f02242908b41c6c42 wpt-pr: 52605 Differential Revision: https://phabricator.services.mozilla.com/D250683
35 lines
1.4 KiB
HTML
35 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<title>CSS Values: The ident() Function (parsing)</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-values-5/#ident">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/css/support/parsing-testcommon.js"></script>
|
|
<script>
|
|
// Any property that accepts <custom-ident> will do.
|
|
let prop = 'view-transition-name';
|
|
|
|
test_invalid_value(prop, 'ident()');
|
|
test_invalid_value(prop, 'ident( )');
|
|
test_invalid_value(prop, 'ident(rgb(1, 2, 3))');
|
|
test_invalid_value(prop, 'ident(5px)');
|
|
|
|
test_valid_value(prop, 'ident(myident)');
|
|
test_valid_value(prop, 'ident( myident)', 'ident(myident)');
|
|
test_valid_value(prop, 'ident(myident )', 'ident(myident)');
|
|
test_valid_value(prop, 'ident("myident")');
|
|
test_valid_value(prop, 'ident("myident" 3)');
|
|
test_valid_value(prop, 'ident(3 "myident")');
|
|
test_valid_value(prop, 'ident("my" "ident")');
|
|
test_valid_value(prop, 'ident(my "ident")');
|
|
test_valid_value(prop, 'ident("my" ident)');
|
|
test_valid_value(prop, 'ident(my ident)');
|
|
test_valid_value(prop, 'ident(-- myident)');
|
|
test_valid_value(prop, 'ident(my 3 3 3 3 ident)')
|
|
|
|
// Check for support in specific properties (WIP):
|
|
let ident = 'ident("myident" 42)';
|
|
|
|
// https://drafts.csswg.org/css-view-transitions/#view-transition-name-prop
|
|
test_valid_value('view-transition-name', ident);
|
|
</script>
|