|
19 | 19 | * predict exactly what value the input should take on for events at
|
20 | 20 | * certain coordinates.)
|
21 | 21 | */
|
22 |
| - input { margin: 0 !important; width: 200px !important; padding-inline: 100px; } |
| 22 | + input { margin: 0 ! important; width: 200px ! important; } |
23 | 23 | </style>
|
24 | 24 | </head>
|
25 | 25 | <body>
|
26 | 26 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=846380">Mozilla Bug 846380</a>
|
27 | 27 | <p id="display"></p>
|
28 | 28 | <div id="content">
|
29 |
| - <input id="range" type="range"><br> |
30 |
| - <input id="range-appearance-none" type="range" style="appearance: none"> |
| 29 | + <input id="range" type="range"> |
31 | 30 | </div>
|
32 | 31 | <pre id="test">
|
33 | 32 | <script type="application/javascript">
|
|
41 | 40 | * This test checks how the value of <input type=range> changes in response to
|
42 | 41 | * various mouse and touch events.
|
43 | 42 | **/
|
44 |
| -SimpleTest.expectAssertions(0, 2); // bug 1917867 |
45 | 43 | SimpleTest.waitForExplicitFinish();
|
46 | 44 | SimpleTest.waitForFocus(function() {
|
47 |
| - for (let element of document.querySelectorAll("input[type=range]")) { |
48 |
| - test(element, synthesizeMouse, "click", "mousedown", "mousemove", "mouseup"); |
49 |
| - test(element, synthesizeTouch, "tap", "touchstart", "touchmove", "touchend"); |
50 |
| - } |
| 45 | + test(synthesizeMouse, "click", "mousedown", "mousemove", "mouseup"); |
| 46 | + test(synthesizeTouch, "tap", "touchstart", "touchmove", "touchend"); |
51 | 47 | SimpleTest.finish();
|
52 | 48 | });
|
53 | 49 |
|
|
66 | 62 | document.body.clientWidth;
|
67 | 63 | }
|
68 | 64 |
|
69 |
| -function test(elem, synthesizeFunc, clickOrTap, startName, moveName, endName) { |
70 |
| - info(`Testing ${elem.id}`); |
71 |
| - |
| 65 | +function test(synthesizeFunc, clickOrTap, startName, moveName, endName) { |
| 66 | + var elem = document.getElementById("range"); |
72 | 67 | elem.focus();
|
73 | 68 | flush();
|
74 | 69 |
|
|
79 | 74 | var paddingLeft = parseFloat(window.getComputedStyle(elem).paddingLeft);
|
80 | 75 | var paddingTop = parseFloat(window.getComputedStyle(elem).paddingTop);
|
81 | 76 |
|
82 |
| - // If themed then we use our border-box size. |
83 |
| - if (elem.style.appearance != "none") { |
84 |
| - width += borderLeft * 2 + paddingLeft * 2; |
85 |
| - borderLeft = 0; |
86 |
| - paddingLeft = 0; |
87 |
| - } |
88 |
| - |
89 | 77 | // Extrema for mouse/touch events:
|
90 | 78 | var midY = height / 2 + borderTop + paddingTop;
|
91 | 79 | var minX = borderLeft + paddingLeft;
|
|
218 | 206 | synthesizeKey("KEY_Home");
|
219 | 207 | // The KEY_Home tests are disabled until I can figure out why they fail on Android -jwatt
|
220 | 208 | //is(elem.value, MINIMUM_OF_RANGE, "Test KEY_Home during a drag sets the value to the minimum of the range");
|
221 |
| - synthesizeFunc(elem, maxX+100, midY, { type: moveName }); |
| 209 | + synthesizeFunc(elem, midX+100, midY, { type: moveName }); |
222 | 210 | is(elem.value, MAXIMUM_OF_RANGE, "Test " + moveName + " outside range after key press that occurred during a drag changes the value");
|
223 | 211 | synthesizeFunc(elem, midX, midY, { type: moveName });
|
224 | 212 | is(elem.value, MIDDLE_OF_RANGE, "Test " + moveName + " in middle of range");
|
|
0 commit comments