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

Unified Diff: LayoutTests/fast/forms/label/selection-disabled-label.html

Issue 722143002: Labels with user-select: none should pass events to control element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed Layout tests Created 6 years, 1 month 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/selection-disabled-label-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/label/selection-disabled-label.html
diff --git a/LayoutTests/fast/forms/label/selection-disabled-label.html b/LayoutTests/fast/forms/label/selection-disabled-label.html
new file mode 100644
index 0000000000000000000000000000000000000000..179a20460d5424c83e794f2369146d270828f8d5
--- /dev/null
+++ b/LayoutTests/fast/forms/label/selection-disabled-label.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+span {
+ user-select: none;
+ -webkit-user-select: none;
+}
+</style>
+<div>
+ Select, some text from this line!!!
+</div>
+<label class="label">
+ <input type="checkbox"/>
+ <span id='span'>Click Me</span>
+</label>
+<div id='console'></div>
+
+<script>
+description('Tests that the click event is passed when selection is disabaled' +
+ ' on label');
+
+var span = document.getElementById('span');
+testWithDoubleClick(span);
+shouldBeEqualToString('window.getSelection().toString()', '');
+
+var div = document.querySelector('div');
+testWithDoubleClick(div);
+shouldBeEqualToString('window.getSelection().toString()', 'Select');
+
+shouldBeFalse("document.querySelector('input').checked");
+
+span.click();
+shouldBeTrue("document.querySelector('input').checked");
+
+span.click();
+shouldBeFalse("document.querySelector('input').checked");
+
+div.style.display = 'none';
+span.style.display = 'none';
+
+function testWithDoubleClick(element)
+{
+ eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/label/selection-disabled-label-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698