Missing cursor/caret showing in search field on google.com
[WebKit-https.git] / LayoutTests / editing / selection / ios / do-not-hide-selection-in-visible-field.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <meta name="viewport" content="width=device-width, initial-scale=1">
5     <script src="../../../resources/ui-helper.js"></script>
6     <script src="../../../resources/js-test.js"></script>
7     <style>
8         html, body {
9             width: 100%;
10             height: 100%;
11             margin: 0;
12             padding: 0;
13         }
14
15         form {
16             overflow: hidden;
17         }
18
19         input, p {
20             font-size: 20px;
21             width: 300px;
22         }
23
24         .fixed {
25             position: fixed;
26             width: 100%;
27             height: 100%;
28             top: 0;
29             left: 0;
30             overflow: auto;
31         }
32
33         button {
34             position: absolute;
35             top: 40px;
36         }
37     </style>
38 </head>
39 <body>
40     <form>
41         <div class="fixed">
42             <input type="search" />
43         </div>
44     </form>
45     <button>Click me</button>
46     <p id="description"></p>
47     <p id="console"></p>
48 </body>
49 <script>
50     jsTestIsAsync = true;
51
52     description("This test verifies platform selection UI is not incorrectly suppressed when the editable element is visible. To manually run the test, tap the button to focus the search field, and confirm that the caret view appears in the field.");
53
54     const button = document.querySelector("button");
55     button.addEventListener("click", () => document.querySelector("input").focus());
56
57     addEventListener("load", async () => {
58         if (!window.testRunner)
59             return;
60
61         await UIHelper.activateElementAndWaitForInputSession(button);
62
63         caretRect = null;
64         while (!caretRect || !caretRect.width || !caretRect.height)
65             caretRect = await UIHelper.getUICaretViewRect();
66
67         shouldBe("caretRect.top", "7");
68         shouldBe("caretRect.left", "11");
69         shouldBe("caretRect.width", "2");
70         shouldBe("caretRect.height", "25");
71         finishJSTest();
72     });
73 </script>
74 </html>