3 <style type=
"text/css" media=
"screen">
5 -webkit-column-count:
3;
6 -webkit-column-gap:
0px;
12 border: solid
1px red;
15 input[
type=
"number"] {
31 var res
= document
.getElementById('res');
32 res
.innerHTML
= res
.innerHTML
+ msg
+ "<br>";
35 function pageX(runner
) {
38 acc
+= runner
.offsetLeft
;
39 runner
= runner
.offsetParent
;
44 function pageY(runner
) {
47 acc
+= runner
.offsetTop
;
48 runner
= runner
.offsetParent
;
53 function testIt(formIndex
, colIndex
, ofsX
, expected
)
55 const form
= document
.getElementById("f" + formIndex
);
56 const column
= document
.getElementById("c" + formIndex
+ "0");
57 const colWidth
= Math
.floor(form
.offsetWidth
/ numCols
);
59 const spinId
= "c" + formIndex
+ colIndex
;
60 const spin
= document
.getElementById(spinId
);
63 const clickX
= pageX(column
) + colWidth
* colIndex
+ ofsX
;
64 const clickY
= pageY(column
) + Math
.floor(spin
.offsetHeight
/ 3);
66 eventSender
.mouseMoveTo(clickX
, clickY
);
67 eventSender
.mouseDown();
68 eventSender
.mouseUp();
69 eventSender
.mouseMoveTo(0, 0);
71 if (spin
.value
== expected
)
72 log("PASSED " + spinId
);
74 log("FAILED " + spinId
+ " expected=" + expected
+ " got=" + spin
.value
+ " " + clickX
+ "@" + clickY
);
77 function installMouseTracker() {
78 document
.body
.onmousemove = function(e
) {
79 var resultBox
= document
.getElementById("mousepos");
80 var offsets
= "element id: " + e
.target
.id
+ "<br> clientX: " + e
.clientX
+ " clientY: " + e
.clientY
+ "<br>";
81 offsets
+= "offsetX: " + e
.offsetX
+ " offsetY: " + e
.offsetY
;
82 resultBox
.innerHTML
= offsets
;
88 if (!window
.testRunner
) {
89 installMouseTracker();
93 testRunner
.dumpAsText();
95 for (var formIndex
= 0; formIndex
< numForms
; formIndex
++) {
96 for (var colIndex
= 0; colIndex
< numCols
; colIndex
++) {
97 testIt(formIndex
, colIndex
, 93, 10);
103 <body onload=
"test()">
104 <h1>Spin In Multi-Coulumn
</h1>
105 This is test cases for
<a href=
"https://webkit.org/b/70898">BUG
70898</a>.
109 <input id=
"c00" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
110 <input id=
"c01" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
111 <input id=
"c02" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
117 <input id=
"c10" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
118 <input id=
"c11" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
119 <input id=
"c12" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
126 <input id=
"c20" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
127 <input id=
"c21" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
128 <input id=
"c22" type=
"number" min=
"0" max=
"100" step=
"10" /><br />
134 <table border=
"0" cellpadding=
"0" cellspacing=
"0">
135 <tr><td><input id=
"c30" type=
"number" min=
"0" max=
"100" step=
"10" /></td></tr>
136 <tr><td><input id=
"c31" type=
"number" min=
"0" max=
"100" step=
"10" /></td></tr>
137 <tr><td><input id=
"c32" type=
"number" min=
"0" max=
"100" step=
"10" /></td></tr>
142 <div id=
"mousepos"></div>