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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/label/label-event-order-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/label/label-event-order.html
diff --git a/LayoutTests/fast/forms/label/label-event-order.html b/LayoutTests/fast/forms/label/label-event-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..974a8aa44a8116ce6484c53fac2b18a2835f1367
--- /dev/null
+++ b/LayoutTests/fast/forms/label/label-event-order.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<body>
+<script src="../../js/resources/js-test-pre.js"></script>
+<label><input type="checkbox">Label for a checkbox</label>
+<script>
+description('Event order for a labeled control should be "focus" then "change"');
+var label = document.querySelector('label');
+var checkbox = document.querySelector('input');
+var focusCount = 0;
+var changeCount = 0;
+checkbox.addEventListener('focus', function() {
+ debug('"focus" event has been dispatched.');
+ focusCount++;
+ shouldBe('changeCount', '0');
+}, false);
+checkbox.addEventListener('change', function() {
+ debug('"change" event has been dispatched.');
+ changeCount++;
+ shouldBe('focusCount', '1');
+}, false);
+label.click();
+label.remove();
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
« 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