2 <script src=
"../../resources/js-test.js"></script>
4 description("Test that getBoundingClientRect works as expected on a float in the second column");
7 <div id=
"multicol" style=
"-webkit-column-count:2; -webkit-column-gap:0; column-fill:auto; height:300px; width:600px;">
8 <div style=
"height:280px;"></div>
9 <div id=
"f1" style=
"border:5px solid black; float:left;">
10 <img style=
"display:block; width:140px; height:80px;">
14 function floatOffset(float)
16 var parentRect
= document
.getElementById("multicol").getBoundingClientRect();
17 var rect
= float.getBoundingClientRect();
18 return { left
: rect
.left
- parentRect
.left
, top
: rect
.top
- parentRect
.top
};
21 var result
= floatOffset(document
.getElementById("f1"));
22 shouldBe("result.left", "300");
23 shouldBe("result.top", "0");