|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <meta charset="utf-8"> |
|
5 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
8 </head> |
|
9 <body> |
|
10 <p id="display"></p> |
|
11 <div id="content" style="display: none"> |
|
12 </div> |
|
13 <div id="testDiv"> </div> |
|
14 <script> |
|
15 var textNode = testDiv.firstChild; |
|
16 var range = new Range(); |
|
17 range.selectNodeContents(textNode); |
|
18 is(range.getClientRects().length, 1, "Text node should have a rectangle"); |
|
19 var rect = range.getClientRects()[0]; |
|
20 ok(rect.left > 0, "Rectangle x should be greater than zero"); |
|
21 ok(rect.top > 0, "Rectangle y should be greater than zero"); |
|
22 is(rect.width, 0, "Rectangle should be zero width"); |
|
23 is(rect.height, 0, "Rectangle should be zero height"); |
|
24 </script> |
|
25 </body> |
|
26 </html> |