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/html/test/test_a_text.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/html/test/test_a_text.html')
-rw-r--r-- | dom/html/test/test_a_text.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/dom/html/test/test_a_text.html b/dom/html/test/test_a_text.html new file mode 100644 index 000000000..5ffc1995f --- /dev/null +++ b/dom/html/test/test_a_text.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test for a.text</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> + <link rel="help" href="http://www.whatwg.org/html/#dom-a-text"/> +</head> +<body> +<div id="content"> +<a href="a">a b c</a> +<a href="b">a <!--b--> c</a> +<a href="c">a <b>b</b> c</a> +</div> +<pre id="test"> +<script> +var d = document.getElementById("content") + .appendChild(document.createElement("a")); +d.href = "d"; +d.appendChild(document.createTextNode("a ")); +d.appendChild(document.createTextNode("b ")); +d.appendChild(document.createTextNode("c ")); +var expected = ["a b c", "a c", "a b c", "a b c "]; +var list = document.getElementById("content").getElementsByTagName("a"); +for (var i = 0, il = list.length; i < il; ++i) { + is(list[i].text, list[i].textContent); + is(list[i].text, expected[i]); + + list[i].text = "x"; + is(list[i].text, "x"); + is(list[i].textContent, "x"); + is(list[i].firstChild.data, "x"); + is(list[i].childNodes.length, 1); + + list[i].textContent = "y"; + is(list[i].text, "y"); + is(list[i].textContent, "y"); + is(list[i].firstChild.data, "y"); + is(list[i].childNodes.length, 1); +} +</script> +</pre> +</body> +</html> |