1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
6 <title>Test of webkitConvertPointFromNodeToPage function</title>
7 <script src="../../../resources/js-test.js"></script>
8 <style type="text/css" media="screen">
20 -webkit-transform: translate(0px);
24 background-color: #0f0;
32 border: 5px solid blue;
40 -webkit-transform-origin: top left;
41 -webkit-transform: translate(130px, 20px) rotate(-35deg) scale(0.6);
48 -webkit-transform: translate(20px);
52 -webkit-transform: translate(20px);
62 function runTest(name, id, x1, y1, x2, y2)
66 var node = document.getElementById(id);
67 p = webkitConvertPointFromNodeToPage(node, new WebKitPoint(0, 0));
73 debug("Round Trip of (0,0)");
74 p2 = webkitConvertPointFromPageToNode(node, p);
84 p = webkitConvertPointFromNodeToPage(node, new WebKitPoint(5, 40));
94 debug("Round Trip of (5,40)");
95 p2 = webkitConvertPointFromPageToNode(node, p);
107 description("This test exercises the webkitConvertPointFromNodeToPage() function");
109 debug("Test parameter passing - should not crash");
110 var point = webkitConvertPointFromNodeToPage(new WebKitPoint(0, 0));
112 testPassed("Missing parameter test");
114 testFailed("Missing parameter test");
115 debug("Test did not crash and therefore was successful");
117 point = webkitConvertPointFromNodeToPage(null, new WebKitPoint(0, 0));
119 testPassed("null parameter test a");
121 testFailed("null parameter test a");
122 debug("Test did not crash and therefore was successful");
124 point = webkitConvertPointFromNodeToPage(null, null);
126 testPassed("null parameter test b");
128 testFailed("null parameter test b");
129 debug("Test did not crash and therefore was successful");
131 runTest("Test 1", "test1", 8, 13, 13, 53);
132 runTest("Test 2", "test2", 8, 51, 13, 91);
133 runTest("Test 3", "test3", 8, 85, 13, 125);
134 runTest("Test 4", "test4", 8, 119, 13, 159);
135 runTest("Test 5", "test5", 28, 153, 33, 193);
136 runTest("Test 6", "test6", 28, 187, 33, 227);
137 runTest("Test 7", "test7", 8, 239, 13, 279);
138 runTest("Test 8", "test8", 8, 273, 13, 313);
139 runTest("Test 9", "test9", 28, 291, 33, 331);
140 runTest("Test 10", "test10", 28, 309, 33, 349);
141 runTest("Test 11", "test11", 158, 376, 174, 394);
142 runTest("Test 12", "test12", 168, 451, 184, 469);
143 runTest("Test 13", "test13", 28, 487, 33, 527);
145 isSuccessfullyParsed();
153 <h1 id="test1">Test 1 - This is a H1 heading.</h1>
154 <p id="test2">Test 2 - This is a simple paragraph.</p>
155 <p id="test3">Test 3 - This is a paragraph with a <b>nested</b> element.</p>
156 <p id="test4">Test 4 - This is a paragraph with a <b class="border">nested</b> element that has a border.</p>
157 <p id="test5" class="c">Test 5 - This is a transformed paragraph with a <b class="border">nested</b> element that has a border.</p>
158 <p id="test6" class="c">Test 6 - This is a transformed paragraph with a <b class="border">nested</b> element that has a border.<br>And then a second line.</p>
160 <p id="test7">Test 7 - This is a paragraph inside something that does not have a compositing layer.</p>
162 <div id="test8" class="d">
163 Test 8 - This is raw text inside something that does not have a compositing layer.
166 <div id="test9" class="b">
167 Test 9 - This is raw text inside something that has a compositing layer.
168 <div id="test10" class="d">
169 Test 10 - This is raw text inside something that does not have a compositing layer.
174 <p id="test11">Test 11 - This is a rotated and scaled paragraph</p>
178 <p id="test12">Test 12 - This is a rotated and scaled paragraph with a <b class="border">nested</b> element that has a border.</p>
182 <p id="test13">Test 13 - This is a paragraph with a <b class="border">nested</b> element that has a border.</p>
184 <div id="description"></div>
185 <div id="console"></div>