Index: LayoutTests/fast/dom/shadow/tooltips-in-shadow.html |
diff --git a/LayoutTests/fast/dom/shadow/tooltips-in-shadow.html b/LayoutTests/fast/dom/shadow/tooltips-in-shadow.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..321d737ea35756b679c9f92b2262210309093338 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/shadow/tooltips-in-shadow.html |
@@ -0,0 +1,60 @@ |
+<!DOCTYPE html> |
+<html> |
+<body onload="test()"> |
+<script src="../../js/resources/js-test-pre.js"></script> |
+<script src="resources/shadow-dom.js"></script> |
+<div id="container"> |
+</div> |
+ |
+<script> |
+window.jsTestIsAsync = true; |
+ |
+function setup() |
+{ |
+ var D = createDOM; |
+ var S = createShadowRoot; |
+ var cases = []; |
+ |
+ label1 = 'Case1: Non-Nested'; |
+ container.appendChild(D('div', {'id': 'host1'}, S(D('a', {'id': 'target1', 'title': label1}, document.createTextNode("Hello1"))))); |
+ cases.push({ target: getNodeInShadowTreeStack('host1/target1'), expected: label1 }); |
+ |
+ label2 = 'Case 2: Nested'; |
+ container.appendChild(D('div', {'id': 'host2'}, S(D('div', {'id': 'host2b'}, S(D('a', {'id': 'target2', 'title': label2}, document.createTextNode("Hello2"))))))); |
+ cases.push({ target: getNodeInShadowTreeStack('host2/host2b/target2'), expected: label2 }); |
+ |
+ label3 = 'Case 3: Multiple Shadow'; |
+ container.appendChild(D('div', {'id': 'host3'}, S(D('div', {'id': 'scope3a'})), S(D('a', {'id': 'scope3b', 'title': label3 }, document.createTextNode("Hello3"))))); |
dglazkov
2013/05/13 16:11:42
It would be cool to start using <template> + a cus
Hajime Morrita
2013/05/14 00:13:53
Um... next time :-)
It would be more useful when w
|
+ cases.push({ target: getNodeInShadowTreeStack('host3//scope3b'), expected: label3 }); |
+ |
+ return cases; |
+} |
+ |
+function moveTo(target) |
+{ |
+ if (window.eventSender) { |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(target.offsetLeft, target.offsetTop + target.offsetHeight / 2); |
+ } |
+} |
+ |
+function test() |
+{ |
+ var harnesses = setup(); |
+ |
+ for (var i = 0; i < harnesses.length; i++) { |
+ harness = harnesses[i]; |
+ moveTo(harness.target); |
+ if (window.testRunner) |
+ debug("Test for " + harness.expected); |
+ shouldBe("harness.expected", "testRunner.tooltipText"); |
+ } |
+ |
+ container.style.display = "none"; |
+ finishJSTest(); |
+ |
+} |
+</script> |
+<script src="../../js/resources/js-test-post.js"></script> |
+</body> |
+</html> |