OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style>body { margin:0; }</style> |
| 5 <div style="columns:4; column-gap:10px; column-fill:auto; width:430px; height:10
0px;"> |
| 6 <div id="outer" style="margin-top:10px; height:450px;"> |
| 7 <div style="height:10px;"></div> |
| 8 <div id="first" style="height:100px;"></div> |
| 9 <div id="rightFloat" style="float:right; width:50px; height:90px;"></div
> |
| 10 <div id="tableCell" style="display:table-cell; width:20px; height:180px;
"></div> |
| 11 <div id="fullSingleColumn" style="height:100px;"></div> |
| 12 </div> |
| 13 </div> |
| 14 <script> |
| 15 test(function() { |
| 16 var rects = document.getElementById("outer").getClientRects(); |
| 17 assert_equals(rects.length, 5); |
| 18 assert_equals(rects[0].left, 0); |
| 19 assert_equals(rects[0].top, 10); |
| 20 assert_equals(rects[0].right, 100); |
| 21 assert_equals(rects[0].bottom, 100); |
| 22 assert_equals(rects[1].left, 110); |
| 23 assert_equals(rects[1].top, 0); |
| 24 assert_equals(rects[1].right, 210); |
| 25 assert_equals(rects[1].bottom, 100); |
| 26 assert_equals(rects[2].left, 220); |
| 27 assert_equals(rects[2].top, 0); |
| 28 assert_equals(rects[2].right, 320); |
| 29 assert_equals(rects[2].bottom, 100); |
| 30 assert_equals(rects[3].left, 330); |
| 31 assert_equals(rects[3].top, 0); |
| 32 assert_equals(rects[3].right, 430); |
| 33 assert_equals(rects[3].bottom, 100); |
| 34 assert_equals(rects[4].left, 440); |
| 35 assert_equals(rects[4].top, 0); |
| 36 assert_equals(rects[4].right, 540); |
| 37 assert_equals(rects[4].bottom, 60); |
| 38 }, "#outer"); |
| 39 |
| 40 test(function() { |
| 41 var rects = document.getElementById("first").getClientRects(); |
| 42 assert_equals(rects.length, 2); |
| 43 assert_equals(rects[0].left, 0); |
| 44 assert_equals(rects[0].top, 20); |
| 45 assert_equals(rects[0].right, 100); |
| 46 assert_equals(rects[0].bottom, 100); |
| 47 assert_equals(rects[1].left, 110); |
| 48 assert_equals(rects[1].top, 0); |
| 49 assert_equals(rects[1].right, 210); |
| 50 assert_equals(rects[1].bottom, 20); |
| 51 }, "#first"); |
| 52 |
| 53 test(function() { |
| 54 var rects = document.getElementById("rightFloat").getClientRects(); |
| 55 assert_equals(rects.length, 2); |
| 56 assert_equals(rects[0].left, 160); |
| 57 assert_equals(rects[0].top, 20); |
| 58 assert_equals(rects[0].right, 210); |
| 59 assert_equals(rects[0].bottom, 100); |
| 60 assert_equals(rects[1].left, 270); |
| 61 assert_equals(rects[1].top, 0); |
| 62 assert_equals(rects[1].right, 320); |
| 63 assert_equals(rects[1].bottom, 10); |
| 64 }, "#rightFloat"); |
| 65 |
| 66 test(function() { |
| 67 var rects = document.getElementById("tableCell").getClientRects(); |
| 68 assert_equals(rects.length, 2); |
| 69 assert_equals(rects[0].left, 110); |
| 70 assert_equals(rects[0].top, 20); |
| 71 assert_equals(rects[0].right, 130); |
| 72 assert_equals(rects[0].bottom, 100); |
| 73 assert_equals(rects[1].left, 220); |
| 74 assert_equals(rects[1].top, 0); |
| 75 assert_equals(rects[1].right, 240); |
| 76 assert_equals(rects[1].bottom, 100); |
| 77 }, "#tableCell"); |
| 78 |
| 79 test(function() { |
| 80 var rects = document.getElementById("fullSingleColumn").getClientRects()
; |
| 81 assert_equals(rects.length, 1); |
| 82 assert_equals(rects[0].left, 330); |
| 83 assert_equals(rects[0].top, 0); |
| 84 assert_equals(rects[0].right, 430); |
| 85 assert_equals(rects[0].bottom, 100); |
| 86 }, "#fullSingleColumn"); |
| 87 </script> |
OLD | NEW |