browser/devtools/webconsole/test/test-console-output-04.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html dir="ltr" lang="en-US">
     3 <head>
     4   <meta charset="utf-8">
     5   <title>Test the web console output - 04</title>
     6   <!--
     7   - Any copyright is dedicated to the Public Domain.
     8   - http://creativecommons.org/publicdomain/zero/1.0/
     9   -->
    10 </head>
    11 <body>
    12   <p>hello world!</p>
    13   <script type="text/javascript">
    14 function testTextNode() {
    15   return document.querySelector("p").childNodes[0];
    16 }
    18 function testCommentNode() {
    19   return document.head.childNodes[5];
    20 }
    22 function testDocumentFragment() {
    23   var frag = document.createDocumentFragment();
    25   var div = document.createElement("div");
    26   div.id = "foo1";
    27   div.className = "bar";
    28   frag.appendChild(div);
    30   var span = document.createElement("span");
    31   span.id = "foo2";
    32   span.textContent = "hello world";
    33   div.appendChild(span);
    35   var div2 = document.createElement("div");
    36   div2.id = "foo3";
    37   frag.appendChild(div2);
    39   return frag;
    40 }
    42 function testError() {
    43   try {
    44     window.foobar("a");
    45   } catch (ex) {
    46     return ex;
    47   }
    48   return null;
    49 }
    51 function testDOMException() {
    52   try {
    53     var foo = document.querySelector("foo;()bar!");
    54   } catch (ex) {
    55     return ex;
    56   }
    57   return null;
    58 }
    60 function testCSSStyleDeclaration() {
    61   document.body.style = 'color: green; font-size: 2em';
    62   return document.body.style;
    63 }
    65 function testStyleSheetList() {
    66   var style = document.querySelector("style");
    67   if (!style) {
    68     style = document.createElement("style");
    69     style.textContent = "p, div { color: blue; font-weight: bold }\n" +
    70                         "@media print { p { background-color: yellow } }";
    71     document.head.appendChild(style);
    72   }
    73   return document.styleSheets;
    74 }
    75   </script>
    76 </body>
    77 </html>

mercurial