Skip to content

Commit 2d95146

Browse files
andruudchromium-wpt-export-bot
authored andcommitted
[ident] Support ident() in container/container-name
This CL adds support for ident() in the container and container-name properties. Since the behavior within at-rule preludes is not specified [1], this CL just includes a basic crash test for "@container ident(...)" as a provisional safeguard. [1] w3c/csswg-drafts#12219 Bug: 384930424 Change-Id: I200e8f1c516ebe69e48f97048014c3f65beac349
1 parent f969452 commit 2d95146

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<title>CSS Conditional: The ident() function in @container/container-name</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-values-5/#ident">
4+
<link rel="help" href="https://drafts.csswg.org/css-conditional-5/#container-rule">
5+
<link rel="help" href="https://drafts.csswg.org/css-conditional-5/#container-name">
6+
<script src="/resources/testharness.js"></script>
7+
<script src="/resources/testharnessreport.js"></script>
8+
<script src="/css/support/computed-testcommon.js"></script>
9+
<div id=target></div>
10+
<script>
11+
let actual_ident = 'ident("--myident" calc(42 * sign(1em - 1px)))';
12+
let expected_ident = '--myident42';
13+
14+
// https://drafts.csswg.org/css-conditional-5/#container-name
15+
test_computed_value('container-name', actual_ident, expected_ident);
16+
test_computed_value('container-name', `--c ${actual_ident}`,
17+
`--c ${expected_ident}`);
18+
19+
// https://drafts.csswg.org/css-conditional-5/#container-shorthand
20+
test_computed_value('container', actual_ident, expected_ident);
21+
test_computed_value('container', `--c ${actual_ident} / size`,
22+
`--c ${expected_ident} / size`);
23+
24+
</script>

0 commit comments

Comments
 (0)