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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/webconsole/test/test-console-output-04.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,77 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html dir="ltr" lang="en-US">
     1.6 +<head>
     1.7 +  <meta charset="utf-8">
     1.8 +  <title>Test the web console output - 04</title>
     1.9 +  <!--
    1.10 +  - Any copyright is dedicated to the Public Domain.
    1.11 +  - http://creativecommons.org/publicdomain/zero/1.0/
    1.12 +  -->
    1.13 +</head>
    1.14 +<body>
    1.15 +  <p>hello world!</p>
    1.16 +  <script type="text/javascript">
    1.17 +function testTextNode() {
    1.18 +  return document.querySelector("p").childNodes[0];
    1.19 +}
    1.20 +
    1.21 +function testCommentNode() {
    1.22 +  return document.head.childNodes[5];
    1.23 +}
    1.24 +
    1.25 +function testDocumentFragment() {
    1.26 +  var frag = document.createDocumentFragment();
    1.27 +
    1.28 +  var div = document.createElement("div");
    1.29 +  div.id = "foo1";
    1.30 +  div.className = "bar";
    1.31 +  frag.appendChild(div);
    1.32 +
    1.33 +  var span = document.createElement("span");
    1.34 +  span.id = "foo2";
    1.35 +  span.textContent = "hello world";
    1.36 +  div.appendChild(span);
    1.37 +
    1.38 +  var div2 = document.createElement("div");
    1.39 +  div2.id = "foo3";
    1.40 +  frag.appendChild(div2);
    1.41 +
    1.42 +  return frag;
    1.43 +}
    1.44 +
    1.45 +function testError() {
    1.46 +  try {
    1.47 +    window.foobar("a");
    1.48 +  } catch (ex) {
    1.49 +    return ex;
    1.50 +  }
    1.51 +  return null;
    1.52 +}
    1.53 +
    1.54 +function testDOMException() {
    1.55 +  try {
    1.56 +    var foo = document.querySelector("foo;()bar!");
    1.57 +  } catch (ex) {
    1.58 +    return ex;
    1.59 +  }
    1.60 +  return null;
    1.61 +}
    1.62 +
    1.63 +function testCSSStyleDeclaration() {
    1.64 +  document.body.style = 'color: green; font-size: 2em';
    1.65 +  return document.body.style;
    1.66 +}
    1.67 +
    1.68 +function testStyleSheetList() {
    1.69 +  var style = document.querySelector("style");
    1.70 +  if (!style) {
    1.71 +    style = document.createElement("style");
    1.72 +    style.textContent = "p, div { color: blue; font-weight: bold }\n" +
    1.73 +                        "@media print { p { background-color: yellow } }";
    1.74 +    document.head.appendChild(style);
    1.75 +  }
    1.76 +  return document.styleSheets;
    1.77 +}
    1.78 +  </script>
    1.79 +</body>
    1.80 +</html>

mercurial