summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/drag-with-div-or-image-as-data-image.html
blob: 1d5a791aab3e55a2561b4aa9871971fbc175e1f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
    <head>
        <title>Test for WebKit bug 24735: Poor setDragImage support on Windows</title>
        <style type="text/css">

            .draggable {
                -webkit-user-drag: element;
                -webkit-user-select: none;
            }
            
            #linkToUseAsImage {
                background-color: silver;
            }
            
            #divToUseAsImage {
                background-color: pink;
            }

        </style>

        <script type="text/javascript">
            function dragDivAndSeeImageDragged()
            {
                event.dataTransfer.setDragImage(document.getElementById("imgToUseAsImage"), event.pageX, event.pageY);
            }
            
            function dragImageAndSeeDivDragged()
            {
                event.dataTransfer.setDragImage(document.getElementById("divToUseAsImage"), event.pageX, event.pageY);
            }
        </script>
    </head>
    <body >
        <h3>Test for <a href='https://bugs.webkit.org/show_bug.cgi?id=24735'>WebKit bug 24735</a>: Poor setDragImage support on Windows</h3>

        <p>Instructions: </p>
        <p>When you drag the first div, the image under the cursor should be of the second image. </p>
        <p>When you drag the first image, the image under the cursor should be of the second div. </p>
        
        <br />
        <br />
        
        <div class="draggable" ondragstart="dragDivAndSeeImageDragged()"> Drag me, I am a div! (first div)</div>
        <br />
        <br />
        <img src="resources/webkit-background.png" class="draggable" ondragstart="dragImageAndSeeDivDragged()" />
        <br />
        <br />
        <img src="resources/drag-image.png" id="imgToUseAsImage" />
        <br />
        <br />
        <div id="divToUseAsImage"> When a drag is started on the image, this is the div that is used as the drag image! (second div)</div>
    
    </body>
</html>