Fix API test after r241728
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WebKitCocoa / image-and-file-upload.html
1 <DOCTYPE !html>
2 <html>
3 <head>
4 <meta charset="utf8">
5 <meta name="viewport" content="width=device-width">
6 <style>
7     body {
8         width: 100%;
9         height: 100%;
10         margin: 0;
11     }
12
13     #source, #destination {
14         width: 200px;
15         height: 200px;
16     }
17
18     #destination {
19         border: red 1px solid;
20     }
21 </style>
22 <script>
23     function runTest() {
24         destination.addEventListener("dragenter", event => event.preventDefault());
25         destination.addEventListener("dragover", event => event.preventDefault());
26         destination.addEventListener("drop", event => {
27             filecount.textContent = event.dataTransfer.files.length;
28             destination.setAttribute("src", URL.createObjectURL(event.dataTransfer.files[0]));
29             event.preventDefault();
30         });
31     }
32
33     function destinationLoaded() {
34         imageload.textContent = "true";
35         imageload.style.color = "green";
36     }
37 </script>
38 </head>
39 <body onload="runTest()">
40     <div><img id="source" src="icon.png"></img></div>
41     <img onload="destinationLoaded()" src="" id="destination"></img>
42     <div id="output">
43         <div>Number of files: <span id="filecount">N/A</span></div>
44         <div>Image loaded? <span style="color: red" id="imageload">false</span></div>
45     </div>
46 </body>
47 </html>