Index: LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree.html |
diff --git a/LayoutTests/compositing/gestures/gesture-tapHighlight-img.html b/LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree.html |
similarity index 59% |
copy from LayoutTests/compositing/gestures/gesture-tapHighlight-img.html |
copy to LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree.html |
index a3e9acd709270d547b8f6465e4a5f15a2b47209a..030ccb9e878bda4523fee7237e2a0170ea8eb201 100644 |
--- a/LayoutTests/compositing/gestures/gesture-tapHighlight-img.html |
+++ b/LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree.html |
@@ -1,14 +1,22 @@ |
<!DOCTYPE html> |
<html> |
-<head> |
-</head> |
<body onload="runTest();"> |
-<div style="-webkit-transform: translateZ(0); padding: 20px;"> |
-<a href="" id="targetLink" style="-webkit-tap-highlight-color: rgb(0, 255, 0)"><img width="320" height="240" src="resources/dice.png"></a> |
+ |
+<template id="shadow-tree"> |
+<a href="" id="targetLink" style="-webkit-tap-highlight-color: rgb(0, 255, 0)"><content></content></a> |
+</template> |
+ |
+<div id="host" style="-webkit-transform: translateZ(0); padding: 20px;"> |
+<img width="320" height="240" src="resources/dice.png"> |
</div> |
+ |
<script> |
+var shadowRoot = document.querySelector('#host').createShadowRoot(); |
+shadowRoot.appendChild(document.importNode(document.querySelector('#shadow-tree').content, true)); |
+var targetLink = shadowRoot.querySelector('#targetLink'); |
+ |
function runTest() { |
- var clientRect = document.getElementById('targetLink').getBoundingClientRect(); |
+ var clientRect = targetLink.getBoundingClientRect(); |
x = (clientRect.left + clientRect.right) / 2; |
y = (clientRect.top + clientRect.bottom) / 2; |
if (window.testRunner) { |
@@ -25,6 +33,5 @@ function runTest() { |
} |
} |
</script> |
-</script> |
</body> |
</html> |