1 |
wakaba |
1.1 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
2 |
|
|
<head> |
3 |
|
|
<title>createElement ().localName</title> |
4 |
|
|
</head> |
5 |
|
|
<body> |
6 |
|
|
<p id="result">FAIL (not executed)</p> |
7 |
|
|
<script type="text/javascript"> |
8 |
|
|
var result = document.getElementById ('result'); |
9 |
|
|
result.firstChild.data = 'FAIL'; |
10 |
|
|
var el = document.createElement ('prefix:elementName'); |
11 |
|
|
if (typeof (el.localName) == 'undefined') { |
12 |
|
|
result.firstChild.data = 'FAIL (undefined)'; |
13 |
|
|
} else if (el.localName == null) { |
14 |
|
|
result.firstChild.data = 'PASS (as per DOM3)'; |
15 |
|
|
} else if (el.localName == 'prefix:elementname') { |
16 |
|
|
result.firstChild.data = 'FAIL (lowercase)'; |
17 |
|
|
} else if (el.localName == 'prefix:elementName') { |
18 |
|
|
result.firstChild.data = 'FAIL (as is)'; |
19 |
|
|
} else if (el.localName == 'PREFIX:ELEMENTNAME') { |
20 |
|
|
result.firstChild.data = 'FAIL (uppercase)'; |
21 |
|
|
} else { |
22 |
|
|
result.firstChild.data = 'FAIL'; |
23 |
|
|
} |
24 |
|
|
</script> |
25 |
|
|
</body> |
26 |
|
|
</html> |