Chromium Code Reviews| Index: LayoutTests/fast/dom/shadow/attr-title-inherit.html |
| diff --git a/LayoutTests/fast/dom/shadow/attr-title-inherit.html b/LayoutTests/fast/dom/shadow/attr-title-inherit.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a9d98abfee2bf7665be3b4445dee0486ae54fe3e |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/shadow/attr-title-inherit.html |
| @@ -0,0 +1,75 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<style> |
| +.target { |
| + background-color:blue; |
| + color:white; |
| + width:100px; height:40px; |
| + margin:10px; |
| +} |
| +</style> |
| +<div id="container"> |
| + <p>To test manually, hover over blue boxes and see if the tooltip says "PASS"</p> |
| + <div id="normal" title="PASS"></div> |
| + <div id="distributed" title="PASS"><div class="target">Distributed</div></div> |
| + <div id="multiple" title="PASS"><div class="target">Distributed to the youngest</div></div> |
| + <div id="multilevel" title="PASS"><div class="target">Multi-level Distributed</div></div> |
| + <div id="older" title="PASS"></div> |
| + <div id="redistributed" title="PASS"><div class="target">Redistributed</div></div> |
| +</div> |
| +<script> |
| +setup({ explicit_done: true }); |
| +var style = "<style>.target { background-color:blue; color:white; width:100px; height:40px; margin:10px; }</style>"; |
| + |
| +if (!window.eventSender || !window.testRunner) |
| + test(function () { assert_unreached(); }, "Cannot automate the tests without eventSender and testRunner"); |
| + |
| +var host = document.getElementById("normal"); |
| +var root = createShadowRootWithInnerHtml(host, style + "<div class=target>Shadow</div>"); |
| +testTooltipTextInShadow("The title of elements in shadow inherits from the document", root.querySelector("div")); |
|
hayato
2015/02/10 11:41:18
root.querySelector(".target") might be better in t
kojii
2015/02/12 09:51:29
Done.
|
| + |
| +host = document.getElementById("distributed"); |
| +createShadowRootWithInnerHtml(host, "<div><content></content></div>"); |
| +testTooltipTextInShadow("The title of distributed elements inherits in the composed tree", host); |
|
hayato
2015/02/10 11:41:18
Looks this should be |#multiple .target| rather th
kojii
2015/02/12 09:51:29
Done.
|
| + |
| +host = document.getElementById("multiple"); |
| +createShadowRootWithInnerHtml(host, "<content></content>"); |
| +createShadowRootWithInnerHtml(host, "<div><content></content></div>"); |
| +testTooltipTextInShadow("The title of distributed elements inherits in the composed tree (multiple shadow roots)", host); |
| + |
| +host = document.getElementById("multilevel"); |
| +var host2ndLevel = createShadowRootWithInnerHtml(host, "<div><content></content></div>").firstChild; |
| +createShadowRootWithInnerHtml(host2ndLevel, "<div><content></content></div>"); |
| +testTooltipTextInShadow("The title of distributed elements inherits in the composed tree (multiple levels)", host); |
| + |
| +host = document.getElementById("older"); |
| +createShadowRootWithInnerHtml(host, style + "<div class=target>Older</div>"); |
| +createShadowRootWithInnerHtml(host, "<div><shadow></shadow></div>"); |
| +testTooltipTextInShadow("The title of elements in older shadow roots inherits in the composed tree", host); |
| + |
| +host = document.getElementById("multiple"); |
| +createShadowRootWithInnerHtml(host, "<content></content>"); |
| +createShadowRootWithInnerHtml(host, "<div><shadow></shadow></div>"); |
| +testTooltipTextInShadow("The title of re-distributed elements inherits in the composed tree (multiple shadow roots)", host); |
| + |
| +function testTooltipTextInShadow(description, element) { |
| + if (!window.eventSender || !window.testRunner) |
| + return; |
| + eventSender.dragMode = false; |
| + eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop + element.offsetHeight / 2); |
| + test(function () { |
| + assert_equals(testRunner.tooltipText, "PASS"); |
| + }, description); |
| +} |
| + |
| +function createShadowRootWithInnerHtml(host, shadowHtml) { |
| + var root = host.createShadowRoot(); |
| + root.innerHTML = shadowHtml; |
| + return root; |
| +} |
| + |
| +if (window.testRunner) |
| + container.style.display = "none"; |
| +done(); |
| +</script> |