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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/images/drag-image-descendant-painting-sibling.html

Issue 1982943002: Drag images should paint descendants that are painting siblings of the dragged element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments & rebase Created 4 years, 6 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/fast/images/drag-image-descendant-painting-sibling-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 body { 3 #draggable {
4 background-color: red; 4 position: relative;
5 width: 100px;
6 height: 100px;
7 background: red;
8 -webkit-user-drag: element;
5 } 9 }
6 10
7 #image { 11 #descendant-painting-sibling {
8 width: 50px; 12 position: relative;
9 height: 50px; 13 width: 100px;
10 background-image: url('resources/grid-transparent.png'); 14 height: 100px;
11 -webkit-user-drag: element; 15 background: green;
16 -webkit-user-drag: none;
12 } 17 }
13 </style> 18 </style>
14 <body> 19 <div id="draggable">
15 <!-- Simulate dragging an element and dump the generated drag image. 20 <div id="descendant-painting-sibling"></div>
16 The expected result should be the same as the input image, 21 </div>
17 without seeing a red background. --> 22 This test passes if the generated drag image is a 100x100 green box.
18 <div id="image"></div> 23 The purpose of this test is to verify elements that are descendants of the dragg ed element
19 </body> 24 but paint into an ancestor stacking context are correctly included in the drag i mage.
20 <script> 25 <script>
21 function drag() { 26 function drag() {
22 testRunner.dumpDragImage(); 27 testRunner.dumpDragImage();
23 28
24 var image = document.getElementById('image'); 29 var image = document.getElementById('draggable');
25 var startX = image.offsetLeft + image.offsetWidth / 2; 30 var startX = image.offsetLeft + image.offsetWidth / 2;
26 var startY = image.offsetTop + image.offsetHeight / 2; 31 var startY = image.offsetTop + image.offsetHeight / 2;
27 var positionX = startX + image.offsetWidth; 32 var positionX = startX + image.offsetWidth;
28 var positionY = startY + image.offsetHeight; 33 var positionY = startY + image.offsetHeight;
29 34
30 eventSender.dragMode = true; 35 eventSender.dragMode = true;
31 eventSender.mouseMoveTo(startX, startY); 36 eventSender.mouseMoveTo(startX, startY);
32 eventSender.mouseDown(); 37 eventSender.mouseDown();
33 eventSender.mouseMoveTo(positionX, positionY); 38 eventSender.mouseMoveTo(positionX, positionY);
34 eventSender.mouseUp(); 39 eventSender.mouseUp();
35 } 40 }
36 41
37 if (!window.testRunner || !window.eventSender) { 42 if (!window.testRunner || !window.eventSender) {
38 document.write("This test does not work in manual mode."); 43 document.write("This test does not work in manual mode.");
39 } else { 44 } else {
40 window.onload = drag; 45 window.onload = drag;
41 } 46 }
42 </script> 47 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/images/drag-image-descendant-painting-sibling-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698