1 <html style=
"-webkit-writing-mode:horizontal-tb;">
11 outline:
1px solid blue;
21 -webkit-margin-before:
5px;
26 <body style=
"-webkit-writing-mode:vertical-rl; width:800px">
28 <div class=
"columns" style=
"width: 80px;">
29 one line two lines three lines
30 <div class=
"float" id=
"f1">
33 text runs here next to the float
35 <!-- In this case, the float fits, but then the main content causes the break
36 to occur earlier and the float gets split. -->
37 <div class=
"columns" style=
"width: 75px;">
38 one line two lines three lines
39 <div class=
"float" id=
"f2">
42 text runs here next to the float
44 <!-- In this case, the float paginates after its second line. -->
45 <div class=
"columns" style=
"width: 70px;">
46 one line two lines three lines
47 <div class=
"float" id=
"f3">
50 text runs here next to the float
52 <!-- In this case, the float paginates after its first line. -->
53 <div class=
"columns" style=
"width: 70px;">
54 one line two lines three lines and some more
55 <div class=
"float" id=
"f4">
58 text runs here next to the float
60 <!-- In this case, the float paginates after its third line. -->
61 <div class=
"columns" style=
"width: 45px;">
63 <div class=
"float" id=
"f5">
64 and one five line float
66 text runs here next to the float
69 <pre id=
"result"></pre>
71 function floatOffset(float)
73 var range
= document
.createRange();
74 range
.setStart(float, 0);
75 range
.setEnd(float, 0);
77 var rect
= range
.getBoundingClientRect();
78 var parentRect
= float.parentNode
.getBoundingClientRect();
79 return { width
: rect
.left
- parentRect
.left
, height
: rect
.top
- parentRect
.top
};
92 while (test
= tests
.shift()) {
93 var float = document
.getElementById(test
[0]);
94 var result
= floatOffset(float);
95 var passed
= result
.width
=== test
[1] && result
.height
=== test
[2]
96 float.style
.color
= passed
? "green" : "red";
99 alert(result
.width
+ " " + result
.height
);
103 if (window
.testRunner
) {
104 testRunner
.dumpAsText();
105 document
.getElementById("tests").style
.display
= "none";
108 document
.getElementById("result").innerText
= failures
? "FAIL: " + failures
+ " cases failed" : "PASS";