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/tests/js/docfrag.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/tests/js/docfrag.html')
-rw-r--r-- | dom/tests/js/docfrag.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/dom/tests/js/docfrag.html b/dom/tests/js/docfrag.html new file mode 100644 index 000000000..f5520c945 --- /dev/null +++ b/dom/tests/js/docfrag.html @@ -0,0 +1,39 @@ +<HTML> +<HEAD> +<SCRIPT> +function docFragAppendTest() { + var d = document.createDocumentFragment(); + d.appendChild(document.createTextNode(" Hello")); + var b = document.createElement("B") + b.appendChild(document.createTextNode(" there")); + d.appendChild(b); + p = document.getElementById("appendTest"); + p.appendChild(d); + alert("This number should be 0: " + d.childNodes.length); +} +function docFragReplaceTest() { + var d = document.createDocumentFragment(); + d.appendChild(document.createTextNode(" new")); + var b = document.createElement("B") + b.appendChild(document.createTextNode(" ones")); + d.appendChild(b); + p = document.getElementById("replaceTest"); + s = document.getElementById("replaceSpan"); + if (null != s) { + p.replaceChild(d, s); + } + alert("This number should be 0: " + d.childNodes.length); +} +</SCRIPT> +</HEAD> +<BODY> +<H1>Document Fragment test</H1> + +<P ID="appendTest">If this test works, clicking on this <A href="" onclick="docFragAppendTest(); return false;">link</A> will add two words to the end of this paragraph.</P> + +<P ID="replaceTest"> +Clicking on this <A href="" onclick="docFragReplaceTest(); return false;">link</A> will replace the following two words with new ones: <span id="replaceSpan">two words</span>. +</P> + +</BODY> +</HTML>
\ No newline at end of file |