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

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

Issue 258933006: Fix selection of label having control element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function log(msg)
tkent 2014/04/29 23:36:09 Please remove this function, include ../../resourc
deepak.sa 2014/05/02 06:18:46 Done.
6 {
7 document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
8 }
9
10 function testWithDoubleClick(element)
11 {
12 eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop);
13 eventSender.mouseDown();
14 eventSender.mouseUp();
15 eventSender.mouseDown();
16 eventSender.mouseUp();
17 }
18
19 function checkSelection()
20 {
21 if ((window.getSelection().toString() == "Some"))
22 log("PASS selected text is :\"" + window.getSelection().toString() + "\" ");
tkent 2014/04/29 23:36:09 Please use shouldBeEqualToString() defined in js-t
deepak.sa 2014/05/02 06:18:46 Done.
23 else
24 log("FAIL selected text is :\"" + window.getSelection().toString() + "\" ");
25 }
26
27 function test()
28 {
29 if (window.testRunner) {
30 var labelElement = document.getElementById("labelWithInput");
31 testRunner.dumpAsText();
32 testWithDoubleClick(labelElement);
33 checkSelection();
34
35 document.getElementById('labelWithInput').style.display = "none";
36 } else
37 log("This test needs window.testRunner and window.eventSender to work.") ;
38 }
39
40 </script>
41 </head>
42 <body onload="test()">
43 <label id="labelWithInput" for="inputText">Some Text associated with input</labe l>
44 <input id="inputText" type='text'></input>
keishi 2014/04/30 01:13:14 nit: input should not have an end tag.
deepak.sa 2014/05/02 06:18:46 Done.
45 <pre id="console"></pre>
46 </body>
47 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/selectors/label-selection-expected.txt » ('j') | Source/core/html/HTMLLabelElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698