diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/base/test/test_bug744830.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/base/test/test_bug744830.html')
-rw-r--r-- | dom/base/test/test_bug744830.html | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/dom/base/test/test_bug744830.html b/dom/base/test/test_bug744830.html new file mode 100644 index 000000000..4376b7447 --- /dev/null +++ b/dom/base/test/test_bug744830.html @@ -0,0 +1,132 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=744830 +--> +<head> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=166235">Mozilla Bug 166235</a> +<div id="testnodes"><span>hi</span> there <!-- mon ami --></div> +<pre id="test"> +<script type="application/javascript"> + var t = document.getElementById('testnodes'); + is(t.innerHTML, + "<span>hi</span> there <!-- mon ami -->", + "comment nodes should be included"); + + var PI = document.createProcessingInstruction('foo', 'bar="1.0"'); + t.appendChild(PI); + is(t.innerHTML, '<span>hi</span> there <!-- mon ami --><?foo bar="1.0">', + "pi nodes should be included"); + + t.innerHTML = null; + t.appendChild(document.createElement("textarea")); + t.firstChild.appendChild(document.createTextNode("\nhello")); + // This is the old behavior. Spec requires something else. + is(t.innerHTML, "<textarea>\nhello</textarea>", + "No extra newlines should be inserted to the textarea!"); + + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg:svg")); + t.firstChild.textContent = "<foo>"; + is(t.innerHTML, "<svg><foo></svg>"); + + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "math:math")); + t.firstChild.textContent = "<foo>"; + is(t.innerHTML, "<math><foo></math>"); + + // Prefix is serialized if element isn't HTML/SVG/MathML + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.example.org", "ex:example")); + t.firstChild.textContent = "<foo>"; + is(t.innerHTML, "<ex:example><foo></ex:example>"); + + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.example.org", "example")); + t.firstChild.textContent = "<foo>"; + is(t.innerHTML, "<example><foo></example>"); + + t.firstChild.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:lang", "us-en"); + is(t.innerHTML, '<example xml:lang="us-en"><foo></example>'); + + t.firstChild.setAttributeNS("http://www.w3.org/1999/xlink", "href", "foo"); + is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo"><foo></example>'); + + t.firstChild.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://foo"); + is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo"><foo></example>'); + + t.firstChild.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:bar", "http://bar"); + is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar"><foo></example>'); + + t.firstChild.setAttributeNS("http://www.helloworldns.org", "hello:world", "!"); + is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar" hello:world="!"><foo></example>'); + + t.firstChild.setAttribute("foo", '-"&\xA0-'); + is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar" hello:world="!" foo="-"& -"><foo></example>'); + + t.innerHTML = null; + t.appendChild(document.createElement("div")); + t.firstChild.appendChild(document.implementation + .createDocument(null, null, null) + .createCDATASection("foo")); + is(t.innerHTML, '<div>foo</div>'); + + t.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<div>1&2<3>4 </div>'); + + t.innerHTML = null; + t.appendChild(document.createElement("script")); + t.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<script>1&2<3>4\xA0\u003C/script>'); + + t.innerHTML = null; + t.appendChild(document.createElement("style")); + t.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<style>1&2<3>4\xA0\u003C/style>'); + + t.innerHTML = null; + t.appendChild(document.createElement("span")); + t.firstChild.setAttributeNS("ext", "attr", "foo"); + t.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<span attr="foo">1&2<3>4 \u003C/span>'); + + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + is(t.firstChild.namespaceURI, "http://www.w3.org/2000/svg"); + t.firstChild.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "script")); + is(t.firstChild.firstChild.namespaceURI, "http://www.w3.org/2000/svg"); + t.firstChild.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<svg><script>1&2<3>4 \u003C/script></svg>'); + + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + is(t.firstChild.namespaceURI, "http://www.w3.org/2000/svg"); + t.firstChild.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "style")); + is(t.firstChild.firstChild.namespaceURI, "http://www.w3.org/2000/svg"); + t.firstChild.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<svg><style>1&2<3>4 \u003C/style></svg>'); + + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "math")); + is(t.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML"); + t.firstChild.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "script")); + is(t.firstChild.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML"); + t.firstChild.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<math><script>1&2<3>4 \u003C/script></math>'); + + t.innerHTML = null; + t.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "math")); + is(t.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML"); + t.firstChild.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "style")); + is(t.firstChild.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML"); + t.firstChild.firstChild.textContent = "1&2<3>4\xA0"; + is(t.innerHTML, '<math><style>1&2<3>4 \u003C/style></math>'); +</script> +</pre> +</body> +</html> + |