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

Unified Diff: LayoutTests/fast/forms/label/label-click.html

Issue 291243002: Never ignore HTMLLabelElement's click() calls (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Click may be not a mouse event Created 6 years, 7 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-click-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-click.html
diff --git a/LayoutTests/fast/forms/label/label-click.html b/LayoutTests/fast/forms/label/label-click.html
new file mode 100644
index 0000000000000000000000000000000000000000..1c5ec03b437ea6dcf746e25651d7d70ce5722a5d
--- /dev/null
+++ b/LayoutTests/fast/forms/label/label-click.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<script>
+window.onload = function() {
+ var checkbox = document.getElementById('checkbox');
+ var label = document.getElementById('label');
+
+ shouldBeFalse('checkbox.checked');
+
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(label.offsetLeft, label.offsetTop);
+
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBeTrue('checkbox.checked');
+
+ eventSender.leapForward(1000);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBeFalse('checkbox.checked');
+ }
+
+ label.click();
+ shouldBeTrue('checkbox.checked');
+
+ label.click();
+ shouldBeFalse('checkbox.checked');
+
+ window.getSelection().selectAllChildren(label);
+ label.click();
+ shouldBeTrue('checkbox.checked');
+
+ label.click();
+ shouldBeFalse('checkbox.checked');
+};
+</script>
+<input id="checkbox" type="checkbox">
+<label id="label" for="checkbox">Label</label>
+<div id="console"></div>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/label/label-click-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698