Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / doubleclick-whitespace.html
blob7d83fb1fa1e58b5e7415e2f3ae1f294dc2deec1d
1 <html>
2 <head>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 internals.settings.setSmartInsertDeleteEnabled(false);
7 internals.settings.setSelectTrailingWhitespaceEnabled(true);
10 function getPositionOfNode(id)
12 var n = document.getElementById(id);
13 var pos = {x: 0, y: 0};
15 while (n) {
16 pos.x += n.offsetLeft + n.clientLeft;
17 pos.y += n.offsetTop + n.clientTop;
18 n = n.offsetParent;
20 return pos;
23 function doubleClickNode(id)
25 var pos = getPositionOfNode(id);
26 eventSender.mouseMoveTo(pos.x + 2, pos.y + 2);
27 eventSender.mouseDown();
28 eventSender.leapForward(1);
29 eventSender.mouseUp();
30 eventSender.leapForward(100);
31 eventSender.mouseDown();
32 eventSender.leapForward(1);
33 eventSender.mouseUp();
36 function doTest(testId, expectedText)
38 // Simulate a double click.
39 doubleClickNode(testId);
41 // Get the text of the current selection.
42 var sel = window.getSelection();
43 var actualText = sel.getRangeAt(0).toString();
45 if (expectedText == actualText) {
46 log("Passed " + testId);
47 } else {
48 log("Failed " + testId);
49 log(" Expected: " + expectedText);
50 log(" Actual: " + actualText);
55 function runTests()
57 if (window.testRunner) {
58 doTest("test1", "Doubleclickme \u00a0\u00a0\u00a0 ");
59 doTest("test2", "Doubleclickme");
60 doTest("test3", "Doubleclickme \u00a0\u00a0 ");
61 doTest("test4", "Doubleclickme");
62 doTest("test5", "Doubleclickme \u00a0\u00a0");
63 doTest("test6", "Doubleclickme \u00a0\t\t\t\u00a0");
67 function log(msg)
69 var l = document.getElementById('log');
70 l.appendChild(document.createTextNode(msg));
71 l.appendChild(document.createElement('br'));
74 </script>
75 </head>
76 <body onload="runTests()">
77 <p>
78 This tests that double-clicking a word on the Windows platform selects the whitespace after the word.
79 </p>
81 <div>
82 <span id=test1>Doubleclickme &nbsp;&nbsp;&nbsp; |END|</span>
83 </div>
85 <div>
86 <span id=test2>Doubleclickme|END|</span>
87 </div>
89 <div>
90 <span id=test3>Doubleclickme</span> &nbsp;&nbsp;
91 |END|</span>
92 </div>
94 <div>
95 <div>
96 <span id="test4">Doubleclickme</span>
97 </div>
98 &nbsp;&nbsp;&nbsp;|(Should not have been extended into this line)|
99 </div>
101 <div>
102 <span id="test5">Doubleclickme </span> &nbsp;&nbsp;<img src="does-not-exist.png" />&nbsp; &nbsp;
103 </div>
105 <pre>
106 <span id="test6">Doubleclickme </span> &nbsp; &nbsp;|END|
107 </pre>
109 <br/>
110 <pre id=log>
111 </pre>
113 </body>
114 </html>