Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / w3c / web-platform-tests / custom-elements / concepts / custom-elements-type-allowed-chars.html
1 <!DOCTYPE html>\r
2 <html>\r
3 <head>\r
4 <title>Chars allowed for custom element type </title>\r
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">\r
6 <meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">\r
7 <meta name="assert" content="The custom element type identifies a custom element interface and is a sequence of characters that must match the NCName production">\r
8 <link rel="help" href="https://dvcs.w3.org/hg/webcomponents/raw-file/default/spec/custom/index.html#concepts">\r
9 <link rel="help" href="http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName">\r
10 <script src="../../../../resources/testharness.js"></script>\r
11 <script src="../../../../resources/testharnessreport.js"></script>\r
12 <script src="../testcommon.js"></script>\r
13 <link rel="stylesheet" href="../../../../resources/testharness.css">\r
14 </head>\r
15 <body>\r
16 <div id="log"></div>\r
17 <script type="text/javascript">\r
18 function composeName(charCode) {\r
19     return 'x-' + String.fromCharCode(charCode) + '-x' + charCode.toString(16);\r
20 }\r
21 \r
22 // NCName definition from http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName\r
23 // NCName     ::= (Letter | '_') (NCNameChar)*\r
24 // NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender\r
25 // Letter     ::= BaseChar | Ideographic\r
26 \r
27 test(function() {\r
28     baseCharsSingle.testEach(composeName, checkValidName);\r
29     baseCharsRanges.testEach(composeName, checkValidName);\r
30 }, 'Registering valid custom element types with base char');\r
31 \r
32 test(function() {\r
33     ideographicCharsSingle.testEach(composeName, checkValidName);\r
34     ideographicCharsRanges.testEach(composeName, checkValidName);\r
35 }, 'Registering valid custom element types with ideographic char');\r
36 \r
37 test(function() {\r
38     digitCharsRanges.testEach(composeName, checkValidName);\r
39 }, 'Registering valid custom element types with digit chars');\r
40 \r
41 test(function() {\r
42     (new CharsArray(['.', '-', '_'])).testEach(composeName, checkValidName)\r
43 }, 'Registering valid custom element types with characters \'.\', \'-\', \'_\'');\r
44 \r
45 test(function() {\r
46     combiningChars.testEach(composeName, checkValidName);\r
47 }, 'Registering valid custom element types with combining char');\r
48 \r
49 test(function() {\r
50     extenderChars.testEach(composeName, checkValidName);\r
51 }, 'Registering valid custom element types with extender char');\r
52 </script>\r
53 </body>\r
54 </html>\r