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
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
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
28 baseCharsSingle.testEach(composeName, checkValidName);
\r
29 baseCharsRanges.testEach(composeName, checkValidName);
\r
30 }, 'Registering valid custom element types with base char');
\r
33 ideographicCharsSingle.testEach(composeName, checkValidName);
\r
34 ideographicCharsRanges.testEach(composeName, checkValidName);
\r
35 }, 'Registering valid custom element types with ideographic char');
\r
38 digitCharsRanges.testEach(composeName, checkValidName);
\r
39 }, 'Registering valid custom element types with digit chars');
\r
42 (new CharsArray(['.', '-', '_'])).testEach(composeName, checkValidName)
\r
43 }, 'Registering valid custom element types with characters \'.\', \'-\', \'_\'');
\r
46 combiningChars.testEach(composeName, checkValidName);
\r
47 }, 'Registering valid custom element types with combining char');
\r
50 extenderChars.testEach(composeName, checkValidName);
\r
51 }, 'Registering valid custom element types with extender char');
\r