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

Side by Side Diff: LayoutTests/editing/pasteboard/drop-inputtext-acquires-style.html

Issue 222023002: focus() behaviour differs depending on how value is set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing Created 6 years, 8 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
1 <html> 1 <html>
2 <script> 2 <script>
3 if (window.testRunner) 3 if (window.testRunner)
4 testRunner.dumpAsText(); 4 testRunner.dumpAsText();
5 </script> 5 </script>
6 <div>This test checks that the plain text dropped into a styled text region will acquire the appropriate style.</div> 6 <div>This test checks that the plain text dropped into a styled text region will acquire the appropriate style.</div>
7 <p>To run this test manually, drag the text in the input element below into the bold text region. The dropped text should be bold. 7 <p>To run this test manually, drag the text in the input element below into the bold text region. The dropped text should be bold.
8 Click the verify button to check.</p> 8 Click the verify button to check.</p>
9 <input type="button" value="Verify" onClick="verifier()"> 9 <input type="button" value="Verify" onClick="verifier()">
10 <br /> 10 <br />
11 <input id="grabme" value="Drag this text" > 11 <input id="grabme" value="Drag this text" >
12 <br /> 12 <br />
13 <b contenteditable="true" id="destination">Drag the text from the above input el ement into this bold text</b> 13 <b contenteditable="true" id="destination">Drag the text from the above input el ement into this bold text</b>
14 <ul id="console"></ul> 14 <ul id="console"></ul>
15 15
16 <script> 16 <script>
17 function log(message) { 17 function log(message) {
18 var console = document.getElementById("console"); 18 var console = document.getElementById("console");
19 var li = document.createElement("li"); 19 var li = document.createElement("li");
20 var pre = document.createElement("pre"); 20 var pre = document.createElement("pre");
21 pre.appendChild(document.createTextNode(message)); 21 pre.appendChild(document.createTextNode(message));
22 li.appendChild(pre); 22 li.appendChild(pre);
23 console.appendChild(li); 23 console.appendChild(li);
24 } 24 }
25 25
26 function runTest() { 26 function runTest() {
27 var textToDrag = document.getElementById("grabme"); 27 var textToDrag = document.getElementById("grabme");
28 textToDrag.focus(); 28 textToDrag.select();
29 29
30 if (!window.testRunner) 30 if (!window.testRunner)
31 return; 31 return;
32 32
33 var x = textToDrag.offsetLeft + textToDrag.offsetWidth / 2; 33 var x = textToDrag.offsetLeft + textToDrag.offsetWidth / 2;
34 var y = textToDrag.offsetTop + textToDrag.offsetHeight / 2; 34 var y = textToDrag.offsetTop + textToDrag.offsetHeight / 2;
35 35
36 eventSender.mouseMoveTo(x, y); 36 eventSender.mouseMoveTo(x, y);
37 37
38 eventSender.mouseDown(); 38 eventSender.mouseDown();
(...skipping 15 matching lines...) Expand all
54 log(document.getElementById("destination").outerHTML); 54 log(document.getElementById("destination").outerHTML);
55 if (document.getElementById("destination").childNodes.length == 1) 55 if (document.getElementById("destination").childNodes.length == 1)
56 log("SUCCESS"); 56 log("SUCCESS");
57 else 57 else
58 log("FAILURE"); 58 log("FAILURE");
59 } 59 }
60 60
61 runTest(); 61 runTest();
62 </script> 62 </script>
63 </html> 63 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698