diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2012-11-24 23:32:56 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2012-11-24 23:32:56 +0000 |
commit | 50b7b41ab7c06462517a348b88b644157a1d4852 (patch) | |
tree | ea782824c219b41b75deae9c2e2d1be8a1047c12 /test/js | |
parent | 9a1a1209be4461eb3b7ff40eed23aa35ab0c54e2 (diff) | |
parent | ec43456e4bf0968bc68b437733199ad2af609c1e (diff) | |
download | netsurf-50b7b41ab7c06462517a348b88b644157a1d4852.tar.gz netsurf-50b7b41ab7c06462517a348b88b644157a1d4852.tar.bz2 |
Merge branch 'master' of git://git.netsurf-browser.org/netsurf into chris/frame-scroll
Diffstat (limited to 'test/js')
-rw-r--r-- | test/js/dom-document-enumerate.html | 26 | ||||
-rw-r--r-- | test/js/dom-element-childElementCount.html | 11 | ||||
-rw-r--r-- | test/js/dom-element-firstElementChild.html (renamed from test/js/doc-dom1.html) | 0 | ||||
-rw-r--r-- | test/js/dom-element-lastElementChild.html | 11 | ||||
-rw-r--r-- | test/js/dom-element-next_prev_ElementSibling.html | 14 | ||||
-rw-r--r-- | test/js/event-onload.html | 29 | ||||
-rw-r--r-- | test/js/index.html | 7 | ||||
-rw-r--r-- | test/js/location-enumerate.html | 26 | ||||
-rw-r--r-- | test/js/window-enumerate.html | 26 |
9 files changed, 149 insertions, 1 deletions
diff --git a/test/js/dom-document-enumerate.html b/test/js/dom-document-enumerate.html new file mode 100644 index 000000000..18146ab8a --- /dev/null +++ b/test/js/dom-document-enumerate.html @@ -0,0 +1,26 @@ +<html> +<head> +<title>document interface enumeration</title> +<link rel="stylesheet" type="text/css" href="tst.css"> +</head> +<body> +<h1>Document interface enumeration</h1> + +<script> +function output(x,y) { + document.body.appendChild(document.createTextNode(x)); + document.body.appendChild(document.createTextNode("(")); + if (y != undefined) { + document.body.appendChild(document.createTextNode(y.length)); + } + document.body.appendChild(document.createTextNode(") = ")); + document.body.appendChild(document.createTextNode(y)); + document.body.appendChild(document.createElement('br')); +} + +for(var key in document) { + output(key, document[key]); +} +</script> +</body> +</html> diff --git a/test/js/dom-element-childElementCount.html b/test/js/dom-element-childElementCount.html new file mode 100644 index 000000000..ec4b7f89a --- /dev/null +++ b/test/js/dom-element-childElementCount.html @@ -0,0 +1,11 @@ +<html> +<head> +<link rel="stylesheet" type="text/css" href="tst.css"> +<title>DOM childElementCount reference</title> +</head> +<body> +<h1>DOM childElementCount reference</h1> +<p><b>head.childElementCount:</b> <script>document.write(document.head.childElementCount);</script></p> +<p><b>body.childElementCount:</b> <script>document.write(document.body.childElementCount);</script></p> +</body> +</html> diff --git a/test/js/doc-dom1.html b/test/js/dom-element-firstElementChild.html index 2d7762d00..2d7762d00 100644 --- a/test/js/doc-dom1.html +++ b/test/js/dom-element-firstElementChild.html diff --git a/test/js/dom-element-lastElementChild.html b/test/js/dom-element-lastElementChild.html new file mode 100644 index 000000000..e4e9f11cb --- /dev/null +++ b/test/js/dom-element-lastElementChild.html @@ -0,0 +1,11 @@ +<html> +<head> +<link rel="stylesheet" type="text/css" href="tst.css"> +<title>DOM lastElementChild reference</title> +</head> +<body> +<h1>DOM lastElementChild reference</h1> +<p><b>head.lastElementChild:</b> <script>document.write(document.head.lastElementChild.textContent);</script></p> +<p><b>body.lastElementChild:</b> <script>document.write(document.body.lastElementChild.textContent);</script></p> +</body> +</html> diff --git a/test/js/dom-element-next_prev_ElementSibling.html b/test/js/dom-element-next_prev_ElementSibling.html new file mode 100644 index 000000000..85263cc17 --- /dev/null +++ b/test/js/dom-element-next_prev_ElementSibling.html @@ -0,0 +1,14 @@ +<html> +<head> +<title>DOM previousElementSibling and nextElementSibling reference</title> +<!-- comment node should be skipped --> +<link rel="stylesheet" type="text/css" href="tst.css"> +</head> +<body> +<h1>DOM previousElementSibling and nextElementSibling reference</h1> +<!-- comment node should be skipped --> +<p><b>head.lastElementChild.previousElementSibling:</b> <script>document.write(document.head.lastElementChild.previousElementSibling.textContent);</script></p> +<!-- comment node should be skipped --> +<p><b>body.firstElementChild.nextElementSibling:</b> <script>document.write(document.body.firstElementChild.nextElementSibling.textContent);</script></p> +</body> +</html> diff --git a/test/js/event-onload.html b/test/js/event-onload.html new file mode 100644 index 000000000..aede985a4 --- /dev/null +++ b/test/js/event-onload.html @@ -0,0 +1,29 @@ +<html> +<head> +<title>createTextNode onload example</title> + +<script type="text/javascript"> + +function addTextNode() +{ +var newtext = document.createTextNode(" Some text added dynamically. "); +var para = document.getElementById("p1"); +para.appendChild(newtext); +} + +</script> +</head> + +<body> +<div style="border: 1px solid red"> +<p id="p1">First line of paragraph.<br /></p> +</div><br /> + +<button onclick="addTextNode();">add another textNode.</button> + +<script> +window.onload = addTextNode; +</script> + +</body> +</html> diff --git a/test/js/index.html b/test/js/index.html index f02c4df32..7a17c95d3 100644 --- a/test/js/index.html +++ b/test/js/index.html @@ -8,6 +8,7 @@ <h2>Window</h2> <ul> <li><a href="window.lately.html">location</a></li> +<li><a href="window-enumerate.html">enumerate</a></li> </ul> <h2>Document write</h2> @@ -24,7 +25,10 @@ <h2>DOM tests</h2> <h3>Reference method tests</h3> <ul> -<li><a href="doc-dom1.html">firstElementChild</a></li> +<li><a href="dom-element-firstElementChild.html">firstElementChild</a></li> +<li><a href="dom-element-lastElementChild.html">lastElementChild</a></li> +<li><a href="dom-element-next_prev_ElementSibling.html">previousElementSibling nextElementSibling</a></li> +<li><a href="dom-element-childElementCount.html">childElementCount</a></li> <li><a href="doc-dom2.html">getElementById</a></li> <li><a href="dom-getElementsByTagName.html">getElementsByTagName</a></li> @@ -33,6 +37,7 @@ <ul> <li><a href="dom-node-enumerate.html">Node element interface</a></li> <li><a href="dom-body-enumerate.html">Body element interface</a></li> +<li><a href="dom-document-enumerate.html">Document interface</a></li> </ul> <h3>Document element specific</h3> <ul> diff --git a/test/js/location-enumerate.html b/test/js/location-enumerate.html new file mode 100644 index 000000000..d455c7535 --- /dev/null +++ b/test/js/location-enumerate.html @@ -0,0 +1,26 @@ +<html> +<head> +<title>location interface enumeration</title> +<link rel="stylesheet" type="text/css" href="tst.css"> +</head> +<body> +<h1>location interface enumeration</h1> + +<script> +function output(x,y) { + document.body.appendChild(document.createTextNode(x)); + document.body.appendChild(document.createTextNode("(")); + if (y != undefined) { + document.body.appendChild(document.createTextNode(y.length)); + } + document.body.appendChild(document.createTextNode(") = ")); + document.body.appendChild(document.createTextNode(y)); + document.body.appendChild(document.createElement('br')); +} + +for(var key in location) { + output(key, location[key]); +} +</script> +</body> +</html> diff --git a/test/js/window-enumerate.html b/test/js/window-enumerate.html new file mode 100644 index 000000000..92a3111ae --- /dev/null +++ b/test/js/window-enumerate.html @@ -0,0 +1,26 @@ +<html> +<head> +<title>window interface enumeration</title> +<link rel="stylesheet" type="text/css" href="tst.css"> +</head> +<body> +<h1>window interface enumeration</h1> + +<script> +function output(x,y) { + document.body.appendChild(document.createTextNode(x)); + document.body.appendChild(document.createTextNode("(")); + if (y != undefined) { + document.body.appendChild(document.createTextNode(y.length)); + } + document.body.appendChild(document.createTextNode(") = ")); + document.body.appendChild(document.createTextNode(y)); + document.body.appendChild(document.createElement('br')); +} + +for(var key in window) { + output(key, window[key]); +} +</script> +</body> +</html> |