Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / block / positioning / hittest-on-relative-positioned-children.html
blob83225b271ae2fbf23e305314f7a6e092a1204229
1 <!DOCTYPE html>
2 <html>
3 <html>
4 <head>
5 <script src="../../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <p id="description">This tests hit testing on relative positioned children. To manually test, select text by a mouse drag
9 starting in the blue box but outside red boxes and ending inside a red box.</p>
10 <div id="tests" style="margin-bottom: 200px; width: 300px; border: solid 5px #ccf;">
11 <div style="position: relative; left: 50px; width: 200px; border: solid 5px #f66;">
12 first line<br>
13 second line<br>
14 third line<br>
15 </div>
16 <div style="position: relative; left: 300px; width: 200px; border: solid 5px #f66;">
17 first line<br>
18 second line<br>
19 third line<br>
20 </div>
21 <div style="position: relative; left: 250px; width: 200px; border: solid 5px #f66;">
22 first line<br>
23 second line<br>
24 third line<br>
25 </div>
26 <div class="testVerticalSelection" style="position: relative; top: 4em; width: 200px; border: solid 5px #f66;">
27 first line<br>
28 second line<br>
29 third line<br>
30 </div>
31 </div>
32 <div id="console"></div>
33 <script>
35 function runTest(boxName, testDiv) {
36 var testVerticalSelection = testDiv.className == 'testVerticalSelection';
38 var expectedString = [null, "first line", "second line", "third line"];
39 for (var line = 1; line <= 3; line++) {
40 var y = testDiv.offsetTop + testDiv.offsetHeight * (line - 1) / 3 + 5;
41 if (testVerticalSelection)
42 eventSender.mouseMoveTo(testDiv.offsetLeft, y - 20);
43 else
44 eventSender.mouseMoveTo(testDiv.offsetLeft - 10, y);
45 eventSender.mouseDown();
47 eventSender.leapForward(200);
49 eventSender.mouseMoveTo(testDiv.offsetLeft + testDiv.offsetWidth - 20, y);
50 eventSender.mouseUp();
52 var actual = window.getSelection().toString();
53 var action = "Selecting line " + line + ' of ' + boxName + ' selected "' + actual + '"';
54 if (actual == expectedString[line])
55 testPassed(action);
56 else
57 testFailed(action + ', expected "' + expectedString[line] + '"')
59 if (testVerticalSelection)
60 break;
64 if (window.testRunner) {
65 var tests = document.getElementById('tests').getElementsByTagName('div');
66 for (var i = 0; i < tests.length; i++)
67 runTest("box " + (i + 1), tests[i]);
68 document.getElementById('tests').style.display = 'none';
71 </script>
72 </body>
73 </html>