Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree.html

Issue 448593002: Make Gesture Tap be aware of Shadow DOM. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update LinkHighlight Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698