Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / selection-setSelectionRange-focusing.html
blobbf437bdf38f84219d70fa12890fc0fe7eeecea16
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script type="text/javascript">
6 description('Test for crbug.com/393504 :HTMLTextAreaElement.setSelectionRange should not change focus.');
7 window.jsTestIsAsync = true;
8 window.onload = function () {
9 shouldBe("document.activeElement", "document.body");
10 input.setSelectionRange(0, 0);
11 shouldBe("document.activeElement", "document.body");
12 input.setSelectionRange(2, 3);
13 shouldBe("document.activeElement", "document.body");
14 text.setSelectionRange(0, 0);
15 shouldBe("document.activeElement", "document.body");
16 text.setSelectionRange(2, 3);
17 shouldBe("document.activeElement", "document.body");
18 window.finishJSTest();
20 </script>
21 </head>
22 <body>
23 <input id="input" type="text" value="text1"/>
24 <textarea id="text" >text2</textarea>
25 </body>
26 </html>