OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Document::nodesFromRect : basic text nodes and links test - bug 47795</
title> | 4 <title>Document::nodesFromRect : basic text nodes and links test - bug 47795</
title> |
5 <style type="text/css"> @import "resources/nodesFromRect.css"; </style> | 5 <style type="text/css"> @import "resources/nodesFromRect.css"; </style> |
6 <script src="../../../resources/js-test.js"></script> | 6 <script src="../../../resources/js-test.js"></script> |
7 <script src="resources/nodesFromRect.js"></script> | 7 <script src="resources/nodesFromRect.js"></script> |
8 <script type="application/javascript"> | 8 <script type="application/javascript"> |
9 function runTest() | 9 function runTest() |
10 { | 10 { |
(...skipping 11 matching lines...) Expand all Loading... |
22 var centerA1 = getCenterFor(e.a1); | 22 var centerA1 = getCenterFor(e.a1); |
23 var centerA2 = getCenterFor(e.a2); | 23 var centerA2 = getCenterFor(e.a2); |
24 var centerA3 = getCenterFor(e.a3); | 24 var centerA3 = getCenterFor(e.a3); |
25 var topP1 = getTopFor(e.p1); | 25 var topP1 = getTopFor(e.p1); |
26 var topA1 = getTopFor(e.a1); | 26 var topA1 = getTopFor(e.a1); |
27 var centerText = { x : (centerA2.x + centerA1.x) / 2, y : centerA1.y }; //
text node between a1 and a2 | 27 var centerText = { x : (centerA2.x + centerA1.x) / 2, y : centerA1.y }; //
text node between a1 and a2 |
28 | 28 |
29 check(centerA1.x, centerA1.y, 0, 0, 0, 0, [e.a1.firstChild]); | 29 check(centerA1.x, centerA1.y, 0, 0, 0, 0, [e.a1.firstChild]); |
30 check(centerA1.x, centerA1.y, topA1.y - topP1.y, 0, 0, 0, [e.a1.firstChild
, e.a1, e.p1]); | 30 check(centerA1.x, centerA1.y, topA1.y - topP1.y, 0, 0, 0, [e.a1.firstChild
, e.a1, e.p1]); |
31 | 31 |
32 check(centerA1.x, centerA1.y, 0, 0, centerA3.y - centerA1.y, 0, [e.a3.firs
tChild, e.a3, e.p1, e.a1.firstChild, e.a1]); | 32 check(centerA1.x, centerA1.y, 0, 0, centerA3.y - centerA1.y, 0, [e.a3.firs
tChild, e.a3, e.a1, e.p1, e.a1.firstChild]); |
33 check(centerA1.x, centerA1.y, 0, centerText.x - centerA1.x, 0, 0, [e.p1.ch
ildNodes[2], e.a1.firstChild, e.a1, e.p1]); | 33 check(centerA1.x, centerA1.y, 0, centerText.x - centerA1.x, 0, 0, [e.p1.ch
ildNodes[2], e.a1.firstChild, e.a1, e.p1]); |
34 check(centerA1.x, centerA1.y, 0, centerA2.x - centerA1.x, 0, 0, [e.a2.firs
tChild, e.a2, e.p1.childNodes[2], e.a1.firstChild, e.a1, e.p1]); | 34 check(centerA1.x, centerA1.y, 0, centerA2.x - centerA1.x, 0, 0, [e.a2.firs
tChild, e.a2, e.p1.childNodes[2], e.a1.firstChild, e.a1, e.p1]); |
35 check(centerA1.x, centerA1.y, 0, centerA2.x - centerA1.x, centerA3.y - cen
terA1.y, 0, [e.a3.firstChild, e.a3, e.p1, e.a2.firstChild, e.a2, e.p1.childNodes
[2], e.a1.firstChild, e.a1]); | 35 check(centerA1.x, centerA1.y, 0, centerA2.x - centerA1.x, centerA3.y - cen
terA1.y, 0, [e.a3.firstChild, e.a3, e.a2, e.a1, e.p1, e.a2.firstChild, e.p1.chil
dNodes[2], e.a1.firstChild]); |
36 | 36 |
37 } | 37 } |
38 window.onload = runTest; | 38 window.onload = runTest; |
39 </script> | 39 </script> |
40 </head> | 40 </head> |
41 <body id="body"> | 41 <body id="body"> |
42 <p id="p1"> | 42 <p id="p1"> |
43 <a href="#" id="a1">A</a> / <a href="#" id="a2">B</a><br/><a href="#" id="a3
">C</a> | 43 <a href="#" id="a1">A</a> / <a href="#" id="a2">B</a><br/><a href="#" id="a3
">C</a> |
44 </p> | 44 </p> |
45 | 45 |
46 <span id="console"></span> | 46 <span id="console"></span> |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
OLD | NEW |