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

Side by Side Diff: LayoutTests/fast/forms/label/label-event-order.html

Issue 21005002: Order of actions for labeled control should be focus then click. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/forms/label/label-event-order-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 html>
2 <body>
3 <script src="../../js/resources/js-test-pre.js"></script>
4 <label><input type="checkbox">Label for a checkbox</label>
5 <script>
6 description('Event order for a labeled control should be "focus" then "change"') ;
7 var label = document.querySelector('label');
8 var checkbox = document.querySelector('input');
9 var focusCount = 0;
10 var changeCount = 0;
11 checkbox.addEventListener('focus', function() {
12 debug('"focus" event has been dispatched.');
13 focusCount++;
14 shouldBe('changeCount', '0');
15 }, false);
16 checkbox.addEventListener('change', function() {
17 debug('"change" event has been dispatched.');
18 changeCount++;
19 shouldBe('focusCount', '1');
20 }, false);
21 label.click();
22 label.remove();
23 </script>
24 <script src="../../js/resources/js-test-post.js"></script>
25 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/label/label-event-order-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698