6 -moz-column-width:
100px;
7 -webkit-column-width:
100px;
14 display: inline-block;
33 <p> Bug
<a href=
"http://webkit.org/b/34875">34875</a>: offsetLeft broken within CSS3 columns
</p>
34 <p>There should not be any red spans visible.
</p>
36 This test checks that offsetLeft and offsetTop return correct values when used
37 on elements contained in multiple columns. We put a number of red spans (of
38 arbitrary size) in a multi-column div. The script at the end creates an
39 identically sized green span for each of the red spans, and places it at the
40 offsetLeft and offsetTop of the red span, using absolute position. This ensures
41 that the green span completely covers the red span.
45 <span class=
"size1"></span>
46 <span class=
"size2"></span>
47 <span class=
"size2"></span>
48 <span class=
"size3"></span>
49 <span class=
"size2"></span>
50 <span class=
"size1"></span>
53 <span class=
"size2"></span>
54 <span class=
"size1"></span>
55 <span class=
"size3"></span>
56 <span class=
"size3"></span>
57 <span class=
"size2"></span>
58 <span class=
"size3"></span>
59 <span class=
"size1"></span>
60 <span class=
"size2"></span>
61 <span class=
"size2"></span>
62 <span class=
"size2"></span>
63 <span class=
"size3"></span>
64 <span class=
"size2"></span>
65 <span class=
"size3"></span>
66 <span class=
"size1"></span>
67 <span class=
"size3"></span>
68 <span class=
"size3"></span>
69 <span class=
"size3"></span>
70 <span class=
"size2"></span>
71 <span class=
"size3"></span>
74 <span class=
"size3"></span>
75 <span class=
"size2"></span>
76 <span class=
"size1"></span>
77 <span class=
"size1"></span>
78 <span class=
"size2"></span>
79 <span class=
"size2"></span>
81 <span class=
"size2"></span>
82 <span class=
"size1"></span>
83 <span class=
"size3"></span>
84 <span class=
"size3"></span>
85 <span class=
"size1"></span>
86 <span class=
"size3"></span>
87 <span class=
"size3"></span>
88 <span class=
"size2"></span>
90 <span class=
"size2"></span>
91 <span class=
"size3"></span>
92 <span class=
"size1"></span>
93 <span class=
"size3"></span>
94 <span class=
"size3"></span>
95 <span class=
"size2"></span>
96 <span class=
"size1"></span>
97 <span class=
"size1"></span>
98 <span class=
"size2"></span>
99 <span class=
"size2"></span>
100 <span class=
"size2"></span>
101 <span class=
"size1"></span>
102 <span class=
"size3"></span>
104 <span class=
"size3"></span>
105 <span class=
"size1"></span>
106 <span class=
"size3"></span>
107 <span class=
"size3"></span>
108 <span class=
"size2"></span>
109 <span class=
"size2"></span>
111 <span class=
"size3"></span>
112 <span class=
"size1"></span>
113 <span class=
"size3"></span>
117 var body
= document
.getElementsByTagName("body")[0];
118 var multicol
= document
.getElementById("multicol");
119 var spans
= multicol
.getElementsByTagName("span");
120 for (var i
= 0; i
< spans
.length
; ++i
) {
122 var cover
= document
.createElement("span");
123 cover
.setAttribute("class", item
.getAttribute("class"));
124 cover
.setAttribute("style", "background: green; " +
126 "position: absolute; " +
127 "left: " + item
.offsetLeft
+ "px; " +
128 "top: " + item
.offsetTop
+ "px;");
129 body
.appendChild(cover
);