[iOS 14] A couple of tests in editing/selection/ios fail after <rdar://problem/60978283>
[WebKit-https.git] / LayoutTests / editing / selection / ios / selection-extends-into-overflow-area.html
1 <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
2 <html>
3 <head>
4     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
5     <title></title>
6     <style>
7         #editable {
8             width: 300px;
9             height: 300px;
10             border: 1px solid black;
11             font-family: monospace;
12             line-height: 1.5em;
13         }
14         
15         .output {
16             margin-left: 60px;
17         }
18     </style>
19     <script src="../../../resources/ui-helper.js"></script>
20     <script>
21         if (window.testRunner) {
22             testRunner.dumpAsText();
23             testRunner.waitUntilDone();
24         }
25
26         function rectToString(rect)
27         {
28             return `(left = ${Math.round(rect.left)}, top = ${Math.round(rect.top)}, width = ${Math.round(rect.width)}, height = ${Math.round(rect.height)})`;
29         }
30
31         async function runTest()
32         {
33             let container = document.getElementById('editable');
34             await UIHelper.activateAndWaitForInputSessionAt(25, 25);
35             await UIHelper.callFunctionAndWaitForEvent(() => UIHelper.doubleTapElement(target), document, "selectionchange");
36             await UIHelper.ensurePresentationUpdate();
37             let rectsString = "";
38             for (let rect of await UIHelper.getUISelectionRects())
39                 rectsString += rectToString(rect) + ' ';
40
41             document.querySelector("#selection-rects").textContent = rectsString;
42             if (window.testRunner)
43                 testRunner.notifyDone();
44         }
45         
46         window.addEventListener('load', runTest, false);
47     </script>
48 </head>
49 <body>
50     <div id="editable" contenteditable>
51         line<br>
52         line<br>
53         line<br>
54         line<br>
55         line<br>
56         line<br>
57         line<br>
58         line<br>
59         line<br>
60         line<br>
61         line<br>
62         line<br>
63         line<br>
64         line<br>
65         line<br>
66         line<br>
67         line<br>
68         line<br>
69         line<br>
70         line<br>
71         <span id="target">line</span><br>
72         line<br>
73         line<br>
74         line<br>
75         line<br>
76         line<br>
77     </div>
78
79 <div class="output">Selection rects: <span id="selection-rects"></span></div>
80
81 </body>
82 </html>