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

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

mercurial