Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 6 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-counter-styles/counter-style-at-rule/prefix-suffix-syntax.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/counter-style-testcommon.js"></script>
<script>
function test_valid_prefix_suffix(value, expected) {
test_valid_counter_style_descriptor('prefix', value, expected);
test_valid_counter_style_descriptor('suffix', value, expected);
}
function test_invalid_prefix_suffix(value) {
test_invalid_counter_style_descriptor('prefix', value);
test_invalid_counter_style_descriptor('suffix', value);
}
// <symbol>
// <symbol> = <string> | <image> | <custom-ident>
// string values
test_valid_prefix_suffix('"string"');
test_valid_prefix_suffix('"initial"');
test_valid_prefix_suffix('"inherit"');
test_valid_prefix_suffix('"unset"');
// custom-ident values
test_valid_prefix_suffix('custom-ident')
test_invalid_prefix_suffix('initial');
test_invalid_prefix_suffix('inherit');
test_invalid_prefix_suffix('unset');
// image values
test_valid_prefix_suffix('linear-gradient(yellow, blue)');
// Must be exactly one symbol
test_invalid_prefix_suffix('');
test_invalid_prefix_suffix('foo bar');
</script>