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