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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/hidpi/static/drag-image.html

Issue 1646543002: Create the drag image at target scale factor when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout test Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200/fast/hidpi/static/drag-image-expected.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <style> 2 <style>
3 #image { 3 #image {
4 width: 22px; 4 width: 100px;
5 height: 22px; 5 height: 50px;
oshima 2016/01/27 19:44:51 I'm using skewed size (original image is square) t
6 image-rendering: pixelated; 6 image-rendering: pixelated;
7 } 7 }
8 </style> 8 </style>
9 <body> 9 <body>
10 <!-- Simulate dragging an image and dump the generated drag image. --> 10 <!-- Simulate dragging an image and dump the generated drag image at highder pixel density. -->
11 <img id="image" src="resources/grid-small.png"> 11 <image id="image" srcset="../resources/image-set-1x.png 1x, ../resources/ima ge-set-2x.png 2x">
12 </body> 12 </body>
13 <script> 13 <script>
14 function drag() { 14 function drag() {
15 testRunner.dumpDragImage(); 15 testRunner.dumpDragImage();
16
17 var image = document.getElementById('image'); 16 var image = document.getElementById('image');
18 var startX = image.offsetLeft + image.offsetWidth / 2; 17 var startX = image.offsetLeft + image.offsetWidth / 2;
19 var startY = image.offsetTop + image.offsetHeight / 2; 18 var startY = image.offsetTop + image.offsetHeight / 2;
20 var positionX = startX + image.offsetWidth; 19 var positionX = startX + image.offsetWidth;
21 var positionY = startY + image.offsetHeight; 20 var positionY = startY + image.offsetHeight;
22 21
23 eventSender.dragMode = true; 22 eventSender.dragMode = true;
24 eventSender.mouseMoveTo(startX, startY); 23 eventSender.mouseMoveTo(startX, startY);
25 eventSender.mouseDown(); 24 eventSender.mouseDown();
26 eventSender.mouseMoveTo(positionX, positionY); 25 eventSender.mouseMoveTo(positionX, positionY);
27 eventSender.mouseUp(); 26 eventSender.mouseUp();
28 } 27 }
29 28
30 if (!window.testRunner || !window.eventSender) { 29 if (!window.testRunner || !window.eventSender) {
31 document.write("This test does not work in manual mode."); 30 document.write("This test does not work in manual mode.");
32 } else { 31 } else {
33 window.onload = drag; 32 window.onload = drag;
34 } 33 }
35 </script> 34 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200/fast/hidpi/static/drag-image-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698