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

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: Use useMockHighlight() 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
« no previous file with comments | « no previous file | LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 52%
copy from LayoutTests/compositing/gestures/gesture-tapHighlight-img.html
copy to LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree.html
index 04fa3dd42678d9ec327b274d6b5b02c761243eb7..f9e2f410d594ddaa8143bb69348b1a44b409590d 100644
--- a/LayoutTests/compositing/gestures/gesture-tapHighlight-img.html
+++ b/LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree.html
@@ -1,17 +1,24 @@
<!DOCTYPE html>
<html>
-<head>
<script src="resources/link-highlight-helper.js"></script>
-<link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
-</head>
<body onload="runTest();">
-<div style="-webkit-transform: translateZ(0); padding: 20px;">
-<a href="" id="targetLink" class="opaqueHighlight"><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>
+useMockHighlight();
+var shadowRoot = document.querySelector('#host').createShadowRoot();
+shadowRoot.appendChild(document.importNode(document.querySelector('#shadow-tree').content, true));
+var targetLink = shadowRoot.querySelector('#targetLink');
+
function runTest() {
- useMockHighlight();
- 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) {
@@ -24,10 +31,9 @@ function runTest() {
window.setTimeout(function() { window.testRunner.notifyDone(); }, 0);
} else {
debug("This test requires DumpRenderTree.");
- debug("This test is successful if the image below is covered in a green rectangle.");
+ debug("This test is successful if the image below is covered in a green box with square ranges.");
}
}
</script>
-</script>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/compositing/gestures/gesture-tapHighlight-shadow-tree-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698