diff options
Diffstat (limited to 'LayoutTests/fast/dom/Text')
4 files changed, 55 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/Text/replaceWholeText-expected.txt b/LayoutTests/fast/dom/Text/replaceWholeText-expected.txt new file mode 100644 index 0000000..8301ec6 --- /dev/null +++ b/LayoutTests/fast/dom/Text/replaceWholeText-expected.txt @@ -0,0 +1,13 @@ +Test wholeText and replaceWholeText + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS textB.wholeText is 'AB' +PASS para.textContent is 'ABC' +PASS textB.wholeText is 'XYZ' +PASS para.textContent is 'XYZC' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/Text/replaceWholeText.html b/LayoutTests/fast/dom/Text/replaceWholeText.html new file mode 100644 index 0000000..7ac41cf --- /dev/null +++ b/LayoutTests/fast/dom/Text/replaceWholeText.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/replaceWholeText.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html new file mode 100644 index 0000000..1951c43 --- /dev/null +++ b/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="YOUR_JS_FILE_HERE"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js b/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js new file mode 100644 index 0000000..33b6dc8 --- /dev/null +++ b/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js @@ -0,0 +1,16 @@ +description("Test wholeText and replaceWholeText") + +var para = document.createElement('p'); +para.appendChild(document.createTextNode('A')); +var textB = document.createTextNode('B'); +para.appendChild(textB); +para.appendChild(document.createElement('p')); +para.appendChild(document.createTextNode('C')); + +shouldBe("textB.wholeText", "'AB'"); +shouldBe("para.textContent", "'ABC'"); +textB.replaceWholeText("XYZ"); +shouldBe("textB.wholeText", "'XYZ'"); +shouldBe("para.textContent", "'XYZC'"); + +var successfullyParsed = true; |