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

Side by Side Diff: LayoutTests/fast/dom/custom/element-names.html

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing Created 6 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 | Annotate | Revision Log
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 <body> 4 <body>
5 <script> 5 <script>
6 function createRegisterParameters() { 6 function createRegisterParameters() {
7 return { 7 return {
8 prototype: Object.create(HTMLElement.prototype, { thisIsPrototype: { val ue: true } }) 8 prototype: Object.create(HTMLElement.prototype, { thisIsPrototype: { val ue: true } })
9 }; 9 };
10 } 10 }
11 11
12 test(function () { 12 test(function () {
13 var invalidNames = [ 13 var invalidNames = [
14 // Hyphen missing: 14 // Hyphen missing:
15 'foo', 15 'foo',
16 'xfoo', 16 'xfoo',
17 // Reserved names: 17 // Reserved names:
18 // hyphen-containing names from the applicable specifications, 18 // hyphen-containing names from the applicable specifications,
19 // namely the SVG and the MathML. 19 // namely the SVG and the MathML.
20 'annotation-xml', 20 'annotation-xml'
21 'font-face',
22 'font-face-src',
23 'font-face-uri',
24 'font-face-format',
25 'font-face-name',
26 'missing-glyph'
27 ]; 21 ];
28 22
29 for (var i = 0; i < invalidNames.length; i++) { 23 for (var i = 0; i < invalidNames.length; i++) {
30 var invalidName = invalidNames[i]; 24 var invalidName = invalidNames[i];
31 assert_throws('SYNTAX_ERR', function (){ 25 assert_throws('SYNTAX_ERR', function (){
32 document.registerElement(invalidName, createRegisterParameters()); 26 document.registerElement(invalidName, createRegisterParameters());
33 }, 'register invalid custom element name: ' + invalidName); 27 }, 'register invalid custom element name: ' + invalidName);
34 } 28 }
35 29
36 }, 'invalid and reserved names'); 30 }, 'invalid and reserved names');
(...skipping 16 matching lines...) Expand all
53 'y--bar' : 'Y--BAR' 47 'y--bar' : 'Y--BAR'
54 }; 48 };
55 for(var elementName in validNameTagMap) { 49 for(var elementName in validNameTagMap) {
56 var expectedTagName = validNameTagMap[elementName]; 50 var expectedTagName = validNameTagMap[elementName];
57 var tagName = (new (document.registerElement(elementName, createRegister Parameters()))()).tagName; 51 var tagName = (new (document.registerElement(elementName, createRegister Parameters()))()).tagName;
58 assert_equals(tagName, expectedTagName, tagName + ' must be treated as a custom element'); 52 assert_equals(tagName, expectedTagName, tagName + ' must be treated as a custom element');
59 } 53 }
60 }, 'strange but valid names'); 54 }, 'strange but valid names');
61 55
62 </script> 56 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698