Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>Custom Elements: whenDefined with invalid name</title> | |
| 3 <script src="../../resources/testharness.js"></script> | |
| 4 <script src="../../resources/testharness-helpers.js"></script> | |
| 5 <script src="../../resources/testharnessreport.js"></script> | |
| 6 <script src="resources/custom-elements-helpers.js"></script> | |
| 7 <body> | |
| 8 <script> | |
| 9 | |
| 10 'use strict'; | |
| 11 | |
| 12 test_with_window((w) => { | |
| 13 // https://html.spec.whatwg.org/multipage/scripting.html#valid-custom-element- name | |
| 14 let invalid_names = [ | |
| 15 'annotation-xml', | |
| 16 'color-profile', | |
| 17 'font-face', | |
| 18 'font-face-src', | |
| 19 'font-face-uri', | |
| 20 'font-face-format', | |
| 21 'font-face-name', | |
| 22 'missing-glyph', | |
| 23 'div', 'p', | |
| 24 'nothtmlbutnohyphen', | |
| 25 '-not-initial-a-z', '0not-initial-a-z', 'Not-initial-a-z', | |
| 26 'intermediate-UPPERCASE-letters', | |
| 27 'bad-\u00b6', 'bad-\u00b8', 'bad-\u00bf', 'bad-\u00d7', 'bad-\u00f7', | |
| 28 'bad-\u037e', 'bad-\u037e', 'bad-\u2000', 'bad-\u200e', 'bad-\u203e', | |
| 29 'bad-\u2041', 'bad-\u206f', 'bad-\u2190', 'bad-\u2bff', 'bad-\u2ff0', | |
| 30 'bad-\u3000', 'bad-\ud800', 'bad-\uf8ff', 'bad-\ufdd0', 'bad-\ufdef', | |
| 31 'bad-\ufffe', 'bad-\uffff', 'bad-' + String.fromCodePoint(0xf0000) | |
| 32 ]; | |
| 33 invalid_names.forEach((name) => { | |
| 34 promise_test((t) => { | |
| 35 return promise_rejects(t, new SyntaxError(), w.customElements.whenDefined( name)); | |
|
kojii
2016/06/28 04:26:00
s/new SyntaxError()/'SYNTAX_ERR'/
"new SyntaxErro
| |
| 36 }); | |
| 37 }); | |
| 38 }, 'calling whenDefined() with invalid names should return rejected promise'); | |
| 39 </script> | |
| 40 </body> | |
| OLD | NEW |