REGRESSION (r229828): web view doesn’t update or respond to resizing until client...
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WebKitCocoa / dragstart-change-selection-offscreen.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta name="viewport" content="width=device-width, initial-scale=1">
5 <style>
6 body {
7     font-size: 200px;
8 }
9
10 #offscreen {
11     position: absolute;
12     top: -500vh;
13     left: -500vw;
14 }
15 </style>
16 </head>
17 </body>
18 <div id="onscreen">DRAG ME</div>
19 <div id="offscreen">FAR OFFSCREEN</div>
20 <script>
21 function selectChildNodesOfElement(element)
22 {
23     let range = document.createRange();
24     range.setStartBefore(element.childNodes[0])
25     range.setEndAfter(element.childNodes[element.childNodes.length - 1]);
26     getSelection().removeAllRanges();
27     getSelection().addRange(range);
28 }
29 selectChildNodesOfElement(onscreen);
30 document.body.addEventListener("dragstart", () => selectChildNodesOfElement(offscreen));
31 </script>
32 </body>
33 </html>