Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / html / details-clone.html
blob0aa5523c8e56af6a7debf5ce25721724acda8ff0
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 function runTest()
7 var targetDetails = document.getElementById("targetDetails");
8 var clonedDetails = targetDetails.cloneNode(true);
9 document.body.appendChild(clonedDetails);
10 var targetSummary = document.getElementById("targetSummary");
11 var clonedSummary = targetSummary.cloneNode(true);
12 targetDetails.appendChild(clonedSummary);
14 if (!window.internals)
15 return;
17 // On cloned <details>, marker shadow element should be created
18 var targetDetailsSummaryShadow = internals.shadowRoot(targetDetails.querySelector("summary"));
19 targetMarkerPseudoId = internals.shadowPseudoId(targetDetailsSummaryShadow.firstChild);
20 var clonedDetailsSummaryShadow = internals.shadowRoot(clonedDetails.querySelector("summary"));
21 clonedMarkerPseudoId = internals.shadowPseudoId(clonedDetailsSummaryShadow.firstChild);
22 shouldBe("targetMarkerPseudoId", "clonedMarkerPseudoId");
24 </script>
25 <body onload="runTest()">
26 <p id="description">Test to clone details and summary elements</p>
27 <div id="console"></div>
28 <details id="targetDetails" open>
29 <summary id="targetSummary"></summary>
30 </details>
31 </body>
32 </html>