OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <script> |
| 4 if (window.testRunner) |
| 5 testRunner.dumpAsText(); |
| 6 if (window.internals) |
| 7 internals.settings.setRegionBasedColumnsEnabled(true); |
| 8 </script> |
| 9 <body style="margin-left:10px; margin-top:15px;"> |
| 10 <div style="-webkit-columns:3; columns:3;" id="mc"> |
| 11 <div id="elm1" class="rodent">elm1</div> |
| 12 <br> |
| 13 <div> |
| 14 <div id="elm2" class="rodent">elm2</div> |
| 15 <div id="elm3" class="rodent">elm3</div> |
| 16 </div> |
| 17 <div id="elm4" class="rodent">elm4</div> |
| 18 <div id="elm5" class="rodent">elm5</div> |
| 19 </div> |
| 20 <p id="console"></p> |
| 21 <script> |
| 22 var mc = document.getElementById('mc'); |
| 23 var elm1 = document.getElementById('elm1'); |
| 24 var elm2 = document.getElementById('elm2'); |
| 25 var elm3 = document.getElementById('elm3'); |
| 26 var elm4 = document.getElementById('elm4'); |
| 27 var elm5 = document.getElementById('elm5'); |
| 28 shouldBe("mc.offsetLeft", "10"); |
| 29 shouldBe("mc.offsetTop", "15"); |
| 30 |
| 31 shouldBe("elm1.offsetLeft", "mc.offsetLeft"); |
| 32 shouldBe("elm1.offsetTop", "mc.offsetTop"); |
| 33 shouldBeGreaterThan("elm2.offsetLeft", "elm1.offsetLeft"); |
| 34 shouldBe("elm2.offsetTop", "elm1.offsetTop"); |
| 35 shouldBe("elm3.offsetLeft", "elm2.offsetLeft"); |
| 36 shouldBeGreaterThan("elm3.offsetTop", "elm2.offsetTop"); |
| 37 shouldBeGreaterThan("elm4.offsetLeft", "elm3.offsetLeft"); |
| 38 shouldBe("elm4.offsetTop", "elm1.offsetTop"); |
| 39 shouldBe("elm5.offsetLeft", "elm4.offsetLeft"); |
| 40 shouldBe("elm5.offsetTop", "elm3.offsetTop"); |
| 41 |
| 42 var elements = document.getElementsByClassName('rodent'); |
| 43 for (var i = 0; i < elements.length; i++) { |
| 44 var rects = elements[i].getClientRects(); |
| 45 shouldBe("rects.length", "1"); |
| 46 shouldBe("rects[0].left", "elements[i].offsetLeft"); |
| 47 shouldBe("rects[0].top", "elements[i].offsetTop"); |
| 48 } |
| 49 </script> |
| 50 </body> |
OLD | NEW |