Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / drag-select-1.html
blob0e8b251c4a31716846aea0576171c29a9d3154fe
1 <p>This tests for a drag select crasher.</p>
2 <div id="div" contenteditable="true"><span id="start">Start here.</span> <input id="end" type="text"></div>
3 <ul id="console"></ul>
5 <script>
6 function log(str) {
7 var li = document.createElement("li");
8 li.appendChild(document.createTextNode(str));
9 var console = document.getElementById("console");
10 console.appendChild(li);
12 function shouldBe(expected, actual) {
13 if (expected != actual)
14 log("Failure. Expected: " + expected + ", Actual: " + actual);
15 else
16 log("Passed");
18 alert( 5 / 29);
19 if (window.testRunner) {
21 var div = document.getElementById("div");
22 var sel = window.getSelection();
23 sel.collapse(div, 0);
25 var start = document.getElementById("start");
26 var startx = -8 + start.offsetLeft + start.offsetWidth / 2;
27 var starty = start.offsetTop + start.offsetHeight / 2;
28 eventSender.mouseMoveTo(startx, starty);
29 eventSender.mouseDown();
31 var end = document.getElementById("end");
32 endx = -8 + end.offsetLeft + end.offsetWidth / 2;
33 endy = end.offsetTop + end.offsetHeight / 2;
35 var steps = 20;
36 for (var i = 1; i <= steps; i++) {
37 eventSender.mouseMoveTo(startx + Math.abs(startx - endx) * (i / steps), starty + Math.abs(starty - endy) * (i / steps));
40 eventSender.mouseMoveTo(endx, endy);
41 eventSender.mouseUp();
44 } else {
45 log("This uses the eventSender to perform a drag select. To run it manually, mouse down over 'start here' and drag to the left, over the input field.");
47 </script>