blob: 580c96121ae52e9b13a7475d8da5e6f50ac3b9bd (
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
33
34
35
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
<script>
<![CDATA[
function test() {
if (window.testRunner)
testRunner.dumpAsText();
try {
serialized = (new XMLSerializer()).serializeToString(document.getElementById("testDiv\"'&<>"));
if (serialized == "<div xmlns=\"http://www.w3.org/1999/xhtml\" id=\"testDiv"'&<>\"/>" ||
serialized == "<div xmlns=\"http://www.w3.org/1999/xhtml\" id=\"testDiv"'&<>\"></div>" ||
serialized == "<div xmlns=\"http://www.w3.org/1999/xhtml\" id=\"testDiv"'&<>\"/>" ||
serialized == "<div xmlns=\"http://www.w3.org/1999/xhtml\" id=\"testDiv"'&<>\"></div>")
document.getElementById("result").textContent = "SUCCESS";
else
document.getElementById("result").textContent = "FAIL: " + (new XMLSerializer()).serializeToString(document.getElementsByTagName('div')[1]);
} catch (ex) {
alert(ex);
}
}
]]>
</script>
</head>
<body onload="test();">
<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11998">bug 11998</a>:
Incorrect serialization of quotation marks in XML attributes.</p>
<div id="result">FAIL: cannot find an element.</div>
<!-- Currently, WebKit doesn't serialize the namespace unless it's explicitly specified, bug 5262 -->
<div xmlns="http://www.w3.org/1999/xhtml" id="testDiv"'&<>"/>
</body>
</html>
|