summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-invalid-names.html
blob: 8c2ba0f4533e6ff2080b424f260260ce041e2338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../../js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Test various valid name for elements according to the definition of DOM Level 2.")

var nameList = [
                // Invalid first Char
                '0ascii',
                '.Ascii',
                '-Ascii',
                ' ascii',
                '	ascii',
                '֑sc.ii',
                '⃣scii',
                'िascii',
                'ʳascii',
                // Invalid other char
                'asc i',
                'asc	i',
                'asciiⅦ'
                ];

for (var i in nameList)
    shouldThrow("document.createElement('" + nameList[i] +"')", "'InvalidCharacterError: The string contains invalid characters.'");
</script>
</body>
</html>