Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: third_party/WebKit/LayoutTests/custom-properties/register-property.html

Issue 2405153002: Remove CSS.unregisterProperty as the WG resolved to remove it for now (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-properties/unregister-property.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 // Tests for error checking during property registration 5 // Tests for error checking during property registration
6 6
7 test(function() { 7 test(function() {
8 assert_throws(new TypeError(), () => CSS.registerProperty()); 8 assert_throws(new TypeError(), () => CSS.registerProperty());
9 assert_throws(new TypeError(), () => CSS.registerProperty(undefined)); 9 assert_throws(new TypeError(), () => CSS.registerProperty(undefined));
10 assert_throws(new TypeError(), () => CSS.registerProperty(true)); 10 assert_throws(new TypeError(), () => CSS.registerProperty(true));
(...skipping 14 matching lines...) Expand all
25 assert_throws(new SyntaxError(), () => CSS.registerProperty({name: ''})); 25 assert_throws(new SyntaxError(), () => CSS.registerProperty({name: ''}));
26 assert_throws(new SyntaxError(), () => CSS.registerProperty({name: '\\--name '})); 26 assert_throws(new SyntaxError(), () => CSS.registerProperty({name: '\\--name '}));
27 }, "registerProperty requires a name matching <custom-property-name>"); 27 }, "registerProperty requires a name matching <custom-property-name>");
28 28
29 test(function() { 29 test(function() {
30 CSS.registerProperty({name: '--syntax-test-1', syntax: '*'}); 30 CSS.registerProperty({name: '--syntax-test-1', syntax: '*'});
31 CSS.registerProperty({name: '--syntax-test-2', syntax: ' * '}); 31 CSS.registerProperty({name: '--syntax-test-2', syntax: ' * '});
32 assert_throws(new SyntaxError(), 32 assert_throws(new SyntaxError(),
33 () => CSS.registerProperty({name: '--syntax-test-3', syntax: 'length'})) ; 33 () => CSS.registerProperty({name: '--syntax-test-3', syntax: 'length'})) ;
34 }, "registerProperty only allows omitting initialValue is syntax is '*'"); 34 }, "registerProperty only allows omitting initialValue is syntax is '*'");
35
36 test(function() {
37 CSS.registerProperty({name: '--re-register', syntax: '<length>', initialValu e: '0px'});
38 assert_throws({name: 'InvalidModificationError'},
39 () => CSS.registerProperty({name: '--re-register', syntax: '<percentage> ', initialValue: '0%'}));
40 }, "registerProperty fails for an already registered property");
35 </script> 41 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-properties/unregister-property.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698