summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/test-console-output-dom-elements.html
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/webconsole/test/test-console-output-dom-elements.html')
-rw-r--r--devtools/client/webconsole/test/test-console-output-dom-elements.html91
1 files changed, 91 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/test-console-output-dom-elements.html b/devtools/client/webconsole/test/test-console-output-dom-elements.html
new file mode 100644
index 000000000..5acabfa3f
--- /dev/null
+++ b/devtools/client/webconsole/test/test-console-output-dom-elements.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML>
+<html dir="ltr" lang="en-US">
+<head>
+ <meta charset="utf-8">
+ <title>Test the web console output - dom elements</title>
+ <!--
+ - Any copyright is dedicated to the Public Domain.
+ - http://creativecommons.org/publicdomain/zero/1.0/
+ -->
+</head>
+<body class="body-class" id="body-id">
+ <p some-attribute="some-value">hello world!</p>
+ <p id="lots-of-attributes" a b c d e f g h i j k l m n></p>
+ <!--
+ Be sure we have a charset in our iframe's data URI, otherwise we get the following extra
+ console output message:
+ "The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it."
+ This wouldn't be a big deal, but when we look for a "<p>" in our `waitForMessage` helper,
+ this extra encoding warning line contains the data URI source, returning a message
+ that was unexpected
+ -->
+ <iframe src="data:text/html;charset=US-ASCII,<p>hello from iframe</p>"></iframe>
+ <div class="some classname here with more classnames here"></div>
+ <svg>
+ <clipPath>
+ <rect x="0" y="0" width="10" height="5"></rect>
+ </clipPath>
+ </svg>
+ <script type="text/javascript">
+function testBodyNode() {
+ return document.body;
+}
+
+function testDocumentElement() {
+ return document.documentElement;
+}
+
+function testLotsOfAttributes() {
+ return document.querySelector("#lots-of-attributes");
+}
+
+function testDocument() {
+ return document;
+}
+
+function testNode() {
+ return document.querySelector("p");
+}
+
+function testSvgNode() {
+ return document.querySelector("clipPath");
+}
+
+function testNodeList() {
+ return document.querySelectorAll("body *");
+}
+
+function testNodeInIframe() {
+ return document.querySelector("iframe").contentWindow.document.querySelector("p");
+}
+
+function testDocumentFragment() {
+ var frag = document.createDocumentFragment();
+
+ var span = document.createElement("span");
+ span.className = 'foo';
+ span.dataset.lolz = 'hehe';
+
+ var div = document.createElement('div')
+ div.id = 'fragdiv';
+
+ frag.appendChild(span);
+ frag.appendChild(div);
+
+ return frag;
+}
+
+function testNodeInDocumentFragment() {
+ var frag = testDocumentFragment();
+ return frag.firstChild;
+}
+
+function testUnattachedNode() {
+ var p = document.createElement("p");
+ p.className = "such-class";
+ p.dataset.data = "such-data";
+ return p;
+}
+ </script>
+</body>
+</html>