browser/devtools/webconsole/test/test-console-output-dom-elements.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html dir="ltr" lang="en-US">
michael@0 3 <head>
michael@0 4 <meta charset="utf-8">
michael@0 5 <title>Test the web console output - 05</title>
michael@0 6 <!--
michael@0 7 - Any copyright is dedicated to the Public Domain.
michael@0 8 - http://creativecommons.org/publicdomain/zero/1.0/
michael@0 9 -->
michael@0 10 </head>
michael@0 11 <body class="body-class" id="body-id">
michael@0 12 <p some-attribute="some-value">hello world!</p>
michael@0 13 <iframe src="data:text/html,<p>hello from iframe</p>"></iframe>
michael@0 14 <div class="some classname here with more classnames here"></div>
michael@0 15 <script type="text/javascript">
michael@0 16 function testBodyNode() {
michael@0 17 return document.body;
michael@0 18 }
michael@0 19
michael@0 20 function testDocumentElement() {
michael@0 21 return document.documentElement;
michael@0 22 }
michael@0 23
michael@0 24 function testDocument() {
michael@0 25 return document;
michael@0 26 }
michael@0 27
michael@0 28 function testNode() {
michael@0 29 return document.querySelector("p");
michael@0 30 }
michael@0 31
michael@0 32 function testNodeList() {
michael@0 33 return document.querySelectorAll("*");
michael@0 34 }
michael@0 35
michael@0 36 function testNodeInIframe() {
michael@0 37 return document.querySelector("iframe").contentWindow.document.querySelector("p");
michael@0 38 }
michael@0 39
michael@0 40 function testDocumentFragment() {
michael@0 41 var frag = document.createDocumentFragment();
michael@0 42
michael@0 43 var span = document.createElement("span");
michael@0 44 span.className = 'foo';
michael@0 45 span.dataset.lolz = 'hehe';
michael@0 46
michael@0 47 var div = document.createElement('div')
michael@0 48 div.id = 'fragdiv';
michael@0 49
michael@0 50 frag.appendChild(span);
michael@0 51 frag.appendChild(div);
michael@0 52
michael@0 53 return frag;
michael@0 54 }
michael@0 55
michael@0 56 function testNodeInDocumentFragment() {
michael@0 57 var frag = testDocumentFragment();
michael@0 58 return frag.firstChild;
michael@0 59 }
michael@0 60
michael@0 61 function testUnattachedNode() {
michael@0 62 var p = document.createElement("p");
michael@0 63 p.className = "such-class";
michael@0 64 p.dataset.data = "such-data";
michael@0 65 return p;
michael@0 66 }
michael@0 67 </script>
michael@0 68 </body>
michael@0 69 </html>

mercurial