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

Side by Side Diff: trunk/LayoutTests/fast/forms/range/slider-zoomed.html

Issue 1184693003: Revert 196987 "Don't invoke default actions for MouseEvents gene..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 5 years, 6 months 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 | Annotate | Revision Log
Property Changes:
Deleted: svn:mime-type
## -1 +0,0 ##
-text/html
\ No newline at end of property
Deleted: svn:eol-style
## -1 +0,0 ##
-LF
\ No newline at end of property
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 3 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4 <title>slider-transformed</title> 4 <title>slider-transformed</title>
5 <style type="text/css" media="screen"> 5 <style type="text/css" media="screen">
6 html { 6 html {
7 /* zoom: 120%;*/ 7 /* zoom: 120%;*/
8 } 8 }
9 input[type="range"] { 9 input[type="range"] {
10 width: 200px; 10 width: 200px;
11 } 11 }
12 12
13 #results { 13 #results {
14 margin-top: 60px; 14 margin-top: 60px;
15 } 15 }
16 </style> 16 </style>
17 <script type="text/javascript" charset="utf-8"> 17 <script type="text/javascript" charset="utf-8">
18 if (window.testRunner) 18 if (window.testRunner)
19 testRunner.dumpAsText(); 19 testRunner.dumpAsText();
20
21 function dispatchEvent(eventType, clientX, clientY)
22 {
23 var ev = document.createEvent("MouseEvent");
24 ev.initMouseEvent(eventType, true, true, window, 1, 1, 1, clientX, clientY , false, false, false, false, 0, document);
25 var target = document.elementFromPoint(ev.clientX, ev.clientY);
26 target.dispatchEvent(ev);
27 }
20 28
21 function test() 29 function test()
22 { 30 {
23 // For some reason the slider needs mouseup/mousedown, not just a "click" 31 // For some reason the slider needs mouseup/mousedown, not just a "click"
24 eventSender.mouseMoveTo(150, 15); 32 dispatchEvent("mousedown", 150, 15);
25 eventSender.mouseDown(0); 33 dispatchEvent("mouseup", 150, 15);
26 eventSender.mouseUp(0);
27 34
28 const expectedValue = 72; 35 const expectedValue = 72;
29 var val = document.getElementById('slider').value; 36 var val = document.getElementById('slider').value;
30 var result; 37 var result;
31 if (val == expectedValue) 38 if (val == expectedValue)
32 result = "PASS: slider value set to " + expectedValue; 39 result = "PASS: slider value set to " + expectedValue;
33 else 40 else
34 result = "FAIL: expected slider value " + expectedValue + ", got " + val ; 41 result = "FAIL: expected slider value " + expectedValue + ", got " + val ;
35 document.getElementById('results').innerHTML = result; 42 document.getElementById('results').innerHTML = result;
36 } 43 }
37 </script> 44 </script>
38 </head> 45 </head>
39 <body onload="test()"> 46 <body onload="test()">
40 <input type="range" id="slider" min="0" max="100" value="10"> 47 <input type="range" id="slider" min="0" max="100" value="10">
41 <div id="results"> 48 <div id="results">
42 </div> 49 </div>
43 </body> 50 </body>
44 </html> 51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698