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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head>
4 </head>
5 <body onload="runTest();"> 3 <body onload="runTest();">
6 <div style="-webkit-transform: translateZ(0); padding: 20px;"> 4
7 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgb(0, 255, 0)">< img width="320" height="240" src="resources/dice.png"></a> 5 <template id="shadow-tree">
6 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgb(0, 255, 0)">< content></content></a>
7 </template>
8
9 <div id="host" style="-webkit-transform: translateZ(0); padding: 20px;">
10 <img width="320" height="240" src="resources/dice.png">
8 </div> 11 </div>
12
9 <script> 13 <script>
14 var shadowRoot = document.querySelector('#host').createShadowRoot();
15 shadowRoot.appendChild(document.importNode(document.querySelector('#shadow-tree' ).content, true));
16 var targetLink = shadowRoot.querySelector('#targetLink');
17
10 function runTest() { 18 function runTest() {
11 var clientRect = document.getElementById('targetLink').getBoundingClientRect (); 19 var clientRect = targetLink.getBoundingClientRect();
12 x = (clientRect.left + clientRect.right) / 2; 20 x = (clientRect.left + clientRect.right) / 2;
13 y = (clientRect.top + clientRect.bottom) / 2; 21 y = (clientRect.top + clientRect.bottom) / 2;
14 if (window.testRunner) { 22 if (window.testRunner) {
15 testRunner.dumpAsTextWithPixelResults(); 23 testRunner.dumpAsTextWithPixelResults();
16 testRunner.waitUntilDone(); 24 testRunner.waitUntilDone();
17 } 25 }
18 26
19 if (window.eventSender) { 27 if (window.eventSender) {
20 eventSender.gestureShowPress(x, y); 28 eventSender.gestureShowPress(x, y);
21 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); 29 window.setTimeout(function() { window.testRunner.notifyDone(); }, 0);
22 } else { 30 } else {
23 debug("This test requires DumpRenderTree."); 31 debug("This test requires DumpRenderTree.");
24 debug("This test is successful if the image below is covered in a green rectangle."); 32 debug("This test is successful if the image below is covered in a green rectangle.");
25 } 33 }
26 } 34 }
27 </script> 35 </script>
28 </script>
29 </body> 36 </body>
30 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698