| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 5 <script src="./elements-panel-shadow-selection-on-refresh.js"></script> |
| 6 <script> |
| 7 |
| 8 function test() |
| 9 { |
| 10 InspectorTest.runTestSuite([ |
| 11 function setup(next) |
| 12 { |
| 13 WebInspector.settingForTest("showUAShadowDOM").set(true); |
| 14 InspectorTest.expandElementsTree(next); |
| 15 }, |
| 16 |
| 17 function testClosedShadowRootChild(next) |
| 18 { |
| 19 InspectorTest.findNode(isClosedShadowRootChild, InspectorTest.select
ReloadAndDump.bind(null, next)); |
| 20 }, |
| 21 |
| 22 function testUserAgentShadowRootChild(next) |
| 23 { |
| 24 InspectorTest.findNode(isUserAgentShadowRootChild, InspectorTest.sel
ectReloadAndDump.bind(null, next)); |
| 25 }, |
| 26 ]); |
| 27 |
| 28 function isClosedShadowRoot(node) |
| 29 { |
| 30 return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRoot
Types.Closed; |
| 31 } |
| 32 |
| 33 function isUserAgentShadowRoot(node) |
| 34 { |
| 35 return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRoot
Types.UserAgent; |
| 36 } |
| 37 |
| 38 function isClosedShadowRootChild(node) |
| 39 { |
| 40 return isClosedShadowRoot(node.parentNode); |
| 41 } |
| 42 |
| 43 function isUserAgentShadowRootChild(node) |
| 44 { |
| 45 return isUserAgentShadowRoot(node.parentNode); |
| 46 } |
| 47 } |
| 48 |
| 49 </script> |
| 50 </head> |
| 51 |
| 52 <body onload="runTest()"> |
| 53 <p> |
| 54 Tests that elements panel preserves selected shadow DOM node on page refresh. |
| 55 </p> |
| 56 <span id="hostElement"></span><span id="closedHostElement"></span> |
| 57 <script> |
| 58 var root = document.getElementById("hostElement").createShadowRoot(); |
| 59 root.innerHTML = "<input type='text'>"; |
| 60 var closedRoot = document.getElementById("closedHostElement").attachShadow({mode
: 'closed'}); |
| 61 closedRoot.innerHTML = "<button></button>"; |
| 62 </script> |
| 63 </body> |
| 64 </html> |
| OLD | NEW |