1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/webconsole/test/test-console-output-dom-elements.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 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 - 05</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 class="body-class" id="body-id"> 1.15 + <p some-attribute="some-value">hello world!</p> 1.16 + <iframe src="data:text/html,<p>hello from iframe</p>"></iframe> 1.17 + <div class="some classname here with more classnames here"></div> 1.18 + <script type="text/javascript"> 1.19 +function testBodyNode() { 1.20 + return document.body; 1.21 +} 1.22 + 1.23 +function testDocumentElement() { 1.24 + return document.documentElement; 1.25 +} 1.26 + 1.27 +function testDocument() { 1.28 + return document; 1.29 +} 1.30 + 1.31 +function testNode() { 1.32 + return document.querySelector("p"); 1.33 +} 1.34 + 1.35 +function testNodeList() { 1.36 + return document.querySelectorAll("*"); 1.37 +} 1.38 + 1.39 +function testNodeInIframe() { 1.40 + return document.querySelector("iframe").contentWindow.document.querySelector("p"); 1.41 +} 1.42 + 1.43 +function testDocumentFragment() { 1.44 + var frag = document.createDocumentFragment(); 1.45 + 1.46 + var span = document.createElement("span"); 1.47 + span.className = 'foo'; 1.48 + span.dataset.lolz = 'hehe'; 1.49 + 1.50 + var div = document.createElement('div') 1.51 + div.id = 'fragdiv'; 1.52 + 1.53 + frag.appendChild(span); 1.54 + frag.appendChild(div); 1.55 + 1.56 + return frag; 1.57 +} 1.58 + 1.59 +function testNodeInDocumentFragment() { 1.60 + var frag = testDocumentFragment(); 1.61 + return frag.firstChild; 1.62 +} 1.63 + 1.64 +function testUnattachedNode() { 1.65 + var p = document.createElement("p"); 1.66 + p.className = "such-class"; 1.67 + p.dataset.data = "such-data"; 1.68 + return p; 1.69 +} 1.70 + </script> 1.71 +</body> 1.72 +</html>