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

Side by Side Diff: LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status.html

Issue 594093002: Fix for mouse capture and release on ClearButtonElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7
8 <input id="input" type="date" style="font-family:ahem; font-size:16px;">
9 <button id="js-btn-test" type="button"></button>
10
11 <script>
12 description('Tests, after clicking mouse on clearInputButton of date input type, will release mouse capture in case of preventdefault.');
13
14 var input = document.getElementById('input');
15 input.value = '2345-07-19';
16 var center = input.offsetHeight / 2;
17 var spinButtonOffset = 26;
18 var clearButtonOffset = 45;
19
20 var btn = document.getElementById('js-btn-test');
21 var output = '';
22
23 function mouseClickOn(x, y)
24 {
25 if (!window.eventSender)
26 return;
27 eventSender.mouseMoveTo(x + input.offsetLeft, y + input.offsetTop);
28 eventSender.mouseDown();
29 eventSender.mouseUp();
30 }
31
32 btn.addEventListener('click', function ()
33 {
34 output = 'Clicked';
35 });
36
37 document.addEventListener('mouseup', function (evt)
38 {
39 evt.preventDefault();
40 });
41
42 mouseClickOn(input.offsetWidth - clearButtonOffset/2 - spinButtonOffset, center) ;
keishi 2014/10/21 10:25:45 The appearance of clear buttons can change in the
Paritosh Kumar 2014/10/21 10:46:21 Done.
43 shouldBeEqualToString('input.value', '');
44
45 var clickEvent = document.createEvent('MouseEvent');
46 clickEvent.initEvent('click', true, true);
47 document.getElementById('js-btn-test').dispatchEvent(clickEvent);
48 shouldBeEqualToString('output', 'Clicked');
49 </script>
50 </body>
51 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698