| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Tests getBoundingClientRect for collapsed ranges</title> | 4 <title>Tests getBoundingClientRect for collapsed ranges</title> |
| 5 <script src="../../../resources/testharness.js"></script> | 5 <script src="../../../resources/testharness.js"></script> |
| 6 <script src="../../../resources/testharnessreport.js"></script> | 6 <script src="../../../resources/testharnessreport.js"></script> |
| 7 </head> | 7 </head> |
| 8 <style> |
| 9 p {visibility: hidden;} |
| 10 </style> |
| 8 <body> | 11 <body> |
| 9 <p> | 12 <p> |
| 10 Tests that Range::getBoundingClientRect returns top and left | 13 Tests that Range::getBoundingClientRect returns top and left |
| 11 coordinates for collapsed ranges as mandated by the spec. | 14 coordinates for collapsed ranges as mandated by the spec. |
| 12 </p> | 15 </p> |
| 13 <script> | 16 <script> |
| 14 function topLeftPosition(rect) | 17 function topLeftPosition(rect) |
| 15 { | 18 { |
| 16 return rect.top + ', ' + rect.left; | 19 return rect.top + ', ' + rect.left; |
| 17 } | 20 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 57 |
| 55 assert_equals( | 58 assert_equals( |
| 56 topLeftPosition(collapsed.getBoundingClientRect()), | 59 topLeftPosition(collapsed.getBoundingClientRect()), |
| 57 topRightPosition(range.getBoundingClientRect()), | 60 topRightPosition(range.getBoundingClientRect()), |
| 58 'Position of collapsed rect should match right edge of ' + | 61 'Position of collapsed rect should match right edge of ' + |
| 59 'non-collapsed range.'); | 62 'non-collapsed range.'); |
| 60 }, 'Check position for collapsed range.'); | 63 }, 'Check position for collapsed range.'); |
| 61 </script> | 64 </script> |
| 62 </body> | 65 </body> |
| 63 </html> | 66 </html> |
| OLD | NEW |