Process Swap on Navigation causes many webpages to hang due to attempted process...
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WebKitCocoa / link-and-target-div.html
1 <meta name="viewport" content="width=device-width, initial-scale=1.0">
2 <style>
3 body {
4     width: 100%;
5     height: 100%;
6     margin: 0;
7 }
8
9 a, #target {
10     width: 100%;
11     height: 200px;
12     font-size: 200px;
13     white-space: nowrap;
14 }
15
16 #target {
17     border: black 1px solid;
18 }
19
20 code {
21     color: green;
22 }
23 </style>
24 <div><a id="source" href="https://www.apple.com">Hello world</a></div>
25 <div id="target"></div>
26 <div id="output"></div>
27 <script>
28 source.addEventListener("dragstart", event => logOutput("dragstart"));
29 source.addEventListener("dragend", event => logOutput("dragend"));
30 target.addEventListener("dragenter", event => event.preventDefault());
31 target.addEventListener("dragover", event => event.preventDefault());
32 target.addEventListener("drop", event => {
33     target.innerHTML = "<code>PASS</code>";
34     event.preventDefault();
35 });
36 function logOutput(message)
37 {
38     if (output.innerHTML.length)
39         message = ` ${message}`;
40     output.insertAdjacentHTML("beforeend", `<code>${message}</code>`);
41 }
42 </script>