|
4 | 4 | <link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api/#supported-syntax-strings" />
|
5 | 5 | <script src="/resources/testharness.js"></script>
|
6 | 6 | <script src="/resources/testharnessreport.js"></script>
|
| 7 | +<script src="./resources/utils.js"></script> |
7 | 8 | <script>
|
8 |
| -test_count = 0; |
9 | 9 |
|
10 |
| -function assert_valid(syntax, initialValue) { |
11 |
| - // No actual assertions, this just shouldn't throw |
12 |
| - test(function() { |
13 |
| - var name = '--syntax-test-' + (test_count++); |
14 |
| - CSS.registerProperty({name: name, syntax: syntax, initialValue: initialValue, inherits: false}); |
15 |
| - }, "syntax:'" + syntax + "', initialValue:'" + initialValue + "' is valid"); |
16 |
| -} |
17 |
| - |
18 |
| -function assert_invalid(syntax, initialValue) { |
19 |
| - test(function(){ |
20 |
| - var name = '--syntax-test-' + (test_count++); |
21 |
| - assert_throws_dom("SyntaxError", |
22 |
| - () => CSS.registerProperty({name: name, syntax: syntax, initialValue: initialValue, inherits: false})); |
23 |
| - }, "syntax:'" + syntax + "', initialValue:'" + initialValue + "' is invalid"); |
24 |
| -} |
| 10 | +let assert_valid = test_initial_value_valid; |
| 11 | +let assert_invalid = test_initial_value_invalid; |
25 | 12 |
|
26 | 13 | assert_valid("*", "a");
|
27 | 14 | assert_valid(" * ", "b");
|
|
47 | 34 | assert_valid("<length>", "10px /*:)*/");
|
48 | 35 | assert_valid("<length>", " calc(-2px)");
|
49 | 36 | assert_valid("<length>", "calc(2px*4 + 10px)");
|
50 |
| -assert_valid("<length>", "calc(5px * 3px / 6px)"); |
51 | 37 | assert_valid("<length>", "7.1e-4cm");
|
52 | 38 | assert_valid("<length>", "calc(7in - 12px)");
|
53 | 39 | assert_valid("<length>", "calc(15px + (sign(100vh - 10px) * 5px))");
|
|
0 commit comments