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

Side by Side Diff: LayoutTests/fast/forms/label/label-selection-by-dragging.html

Issue 556813002: Fix behavior of label associated with control element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing comments Created 6 years, 3 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <script src="../../../resources/js-test.js"></script>
4
5 <label id="labelWithInput" for="inputText">Some, Text associated with input</lab el>
6 <input type="checkbox" id="checkbox" checked>
7
8 <script>
9 description('Test the value of checkbox after selecting the associated label\'s text');
10
11 var labelElement = document.getElementById('labelWithInput');
12 var checkbox = document.getElementById('checkbox');
13
14 testByDraggingOnLabel(labelElement);
15
16 // As checkbox is already checked, dragging over the label text,
17 // should only select the text and not change the value of
18 // checkbox.
19 shouldBeTrue('checkbox.checked');
20
21 // To check if selection happened or not.
22 shouldBeEqualToString('window.getSelection().toString()', 'Some, Text associated with input');
23
24 labelElement.style.display = 'none';
25
26 function testByDraggingOnLabel(element)
27 {
28 eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop + element.offs etHeight / 2);
29 eventSender.mouseDown();
30 eventSender.mouseMoveTo(element.offsetLeft + element.offsetWidth, element.of fsetTop + element.offsetHeight / 2);
31 eventSender.mouseUp();
32 }
33 </script>
34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698