Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/listbox-hit-test-zoomed.html

Issue 1509853008: Move select/option/optgroup-related tests in fast/forms to fast/forms/select. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style type="text/css" media="screen">
5 body { overflow: hidden; }
6 html {
7 zoom: 120%;
8 }
9 #sl1 option {
10 font-size: 15px;
11 padding: 0;
12 }
13 </style>
14 <script>
15 var sl;
16 window.jsTestIsAsync = true;
17
18 function test() {
19 description("Make sure mouse operations on listbox SELECT element work well even if it is zoomed.");
20 sl = document.getElementById("sl1");
21
22 mouseDownOnSelect(1);
23 shouldBe("sl.selectedIndex", "1");
24
25 mouseDownOnSelect(6);
26 shouldBe("sl.selectedIndex", "6");
27
28 finishJSTest();
29 }
30
31 function mouseDownOnSelect(index) {
32 var itemHeight = (sl.scrollHeight - 20) * 1.2 / sl.length;
33 var borderPaddingTop = 20 * 1.2;
34 var borderPaddingLeft = 20 * 1.2;
35 var y = index * itemHeight - window.pageYOffset + borderPaddingTop + itemHei ght / 2;
36
37 var clickX = sl.offsetLeft * 1.2 + borderPaddingLeft + 5;
38 var clickY = sl.offsetTop * 1.2 + y;
39 eventSender.mouseMoveTo(clickX, clickY);
40 eventSender.mouseDown();
41 eventSender.mouseUp();
42 }
43 </script>
44 <script src="../../resources/js-test.js"></script>
45 </head>
46 <body onload="test()">
47
48 <select id="sl1" multiple style="height: 160px; border: 10px solid; padding: 10p x;">
49 <option>one</option>
50 <option>two</option>
51 <option>three</option>
52 <option>four</option>
53 <option>five</option>
54 <option>six</option>
55 <option>seven</option>
56 <option>eight</option>
57 <option>nine</option>
58 <option>ten</option>
59 <option>eleven</option>
60 <option>twelve</option>
61 <option>thirteen</option>
62 <option>fourteen</option>
63 <option>fifteen</option>
64 <option>sixteen</option>
65 <option>seventeen</option>
66 </select>
67
68 </body>
69 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698