Skip to content

Commit 32ea563

Browse files
committed
[css2] Issues 73, 115, 150, 152, 155, 163, 164 of http://wiki.csswg.org/spec/css2.1
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402980
1 parent f9c94e9 commit 32ea563

1 file changed

Lines changed: 34 additions & 29 deletions

File tree

css2/visuren.src

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
22
<html lang="en">
3-
<!-- $Id: visuren.src,v 2.157 2010-04-19 16:12:37 bbos Exp $ -->
3+
<!-- $Id: visuren.src,v 2.158 2010-05-12 15:27:05 bbos Exp $ -->
44
<head>
55
<title>Visual formatting model</title>
66
<meta name="editor" lang="tr" content="Tantek &Ccedil;elik">
@@ -175,8 +175,8 @@ the relative positioning also affects the block box.
175175
rules:</p>
176176

177177
<pre><code class="css">
178-
body { display: inline }
179-
p { display: block }
178+
p { display: inline }
179+
span { display: block }
180180
</code></pre>
181181

182182
<p>were used with this HTML document:</p>
@@ -187,16 +187,18 @@ p { display: block }
187187
&lt;TITLE&gt;Anonymous text interrupted by a block&lt;/TITLE&gt;
188188
&lt;/HEAD&gt;
189189
&lt;BODY&gt;
190-
<em>This is anonymous text before the P.</em>
191-
&lt;P&gt;This is the content of P.&lt;/P&gt;
192-
<em>This is anonymous text after the P.</em>
190+
&lt;P&gt;
191+
<em>This is anonymous text before the SPAN.</em>
192+
&lt;SPAN&gt;This is the content of SPAN.&lt;/SPAN&gt;
193+
<em>This is anonymous text after the SPAN.</em>
194+
&lt;/P&gt;
193195
&lt;/BODY&gt;
194196
</code></pre>
195197

196-
<p>The BODY element contains a chunk (C1) of anonymous text followed
198+
<p>The P element contains a chunk (C1) of anonymous text followed
197199
by a block-level element followed by another chunk (C2) of anonymous
198-
text. The resulting boxes would be an anonymous block box around the BODY,
199-
containing an anonymous block box around C1, the P block box, and
200+
text. The resulting boxes would be an anonymous block box around the P,
201+
containing an anonymous block box around C1, the SPAN block box, and
200202
another anonymous block box around C2.
201203
</p></div>
202204

@@ -209,7 +211,7 @@ margins will be 0.
209211
<p>
210212
Properties set on elements that cause anonymous block boxes to be
211213
generated still apply to the boxes and content of that element. For
212-
example, if a border had been set on the BODY element in the above
214+
example, if a border had been set on the P element in the above
213215
example, the border would be drawn around C1 (open at the end of the
214216
line) and C2 (open at the start of the line).
215217
</p>
@@ -1294,46 +1296,49 @@ contexts.</a>
12941296
<a href="#run-in">run-in boxes</a>,
12951297
this property applies to the final block box to which the run-in box belongs.
12961298
</p>
1297-
<p><dfn id="clearance">Clearance</dfn> is introduced as spacing above the margin-top of an element. It is used to push the element vertically (typically downward), past the float.
1298-
</p>
1299+
12991300
<p>Values have the following meanings when applied to non-floating
13001301
block boxes:</p>
13011302

13021303
<dl>
13031304
<dt><strong>left</strong></dt>
13041305

1305-
<dd>The clearance of the generated box is set to the amount necessary to place the
1306-
top border edge below the bottom outer edge of any left-floating
1307-
boxes that resulted from elements earlier in the source document.
1306+
<dd>Requires that the top border edge of the box be below the bottom
1307+
outer edge of any left-floating boxes that resulted from elements
1308+
earlier in the source document.
13081309
</dd>
13091310

13101311
<dt><strong>right</strong></dt>
13111312

1312-
<dd>The clearance of the generated box is set to the amount necessary to place the
1313-
top border edge below the bottom outer edge of any right-floating
1314-
boxes that resulted from elements earlier in the source document.
1313+
<dd>Requires that the top border edge of the box be below the bottom
1314+
outer edge of any right-floating boxes that resulted from elements
1315+
earlier in the source document.
13151316
</dd>
13161317

13171318
<dt><strong>both</strong></dt>
13181319

1319-
<dd>The clearance of the generated box is set to the amount necessary to place the
1320-
top border edge below the bottom outer edge of any right-floating
1321-
and left-floating boxes that resulted from elements earlier in the
1322-
source document.
1320+
<dd>Requires that the top border edge of the box be below the bottom
1321+
outer edge of any right-floating and left-floating boxes that resulted
1322+
from elements earlier in the source document.
13231323
</dd>
13241324

13251325
<dt><strong>none</strong></dt>
13261326

13271327
<dd>No constraint on the box's position with respect to floats.</dd>
13281328
</dl>
13291329

1330+
<p>Values other than 'none' potentially introduce <dfn
1331+
id="clearance">clearance.</dfn> Clearance inhibits margin collapsing
1332+
and acts as spacing above the margin-top of an element. It is used to
1333+
push the element vertically past the float.
1334+
13301335
<p>
13311336
Computing the clearance of an element on which 'clear' is set is done by first determining the hypothetical position of the element's top border edge within its parent block. This position is determined after the top margin of the element has been collapsed with previous adjacent margins (including the top margin of the parent block).
13321337
</p>
13331338
<p>
13341339
If this hypothetical position of the element's top border edge is not
1335-
past the relevant floats, then its clearance must be set to the
1336-
greater of:
1340+
past the relevant floats, then clearance is introduced and must be set
1341+
to the greater of:
13371342
</p>
13381343
<ol>
13391344
<li>The amount necessary to place the border edge of the block even
@@ -1356,7 +1361,7 @@ greater of:
13561361
</ul>
13571362
</ol>
13581363
<p class=note>
1359-
Note: The clearance can be negative.
1364+
Note: The clearance can be negative or zero.
13601365

13611366
<div class=example>
13621367
<p>An example of negative clearance is this situation, in which the
@@ -1378,10 +1383,10 @@ padding):
13781383
margins would collapse and the last paragraph's top border edge would
13791384
be flush with the top of the floating paragraph. But the 'clear'
13801385
requires the top border edge to be <em>below</em> the float, i.e., 2em
1381-
lower. That means that the margins must not collapse and clearance
1382-
must be added such that <var>clearance</var> + <var>margin-top</var> =
1383-
2em, i.e., <var>clearance</var> = 2em - <var>margin-top</var> = 2em -
1384-
3em = -1em.
1386+
lower. This means that clearance must be introduced. Accordingly, the
1387+
margins no longer collapse and the amount of clearance is set so that
1388+
clearance + margin-top = 2em, i.e., clearance = 2em - margin-top = 2em
1389+
- 3em = -1em.
13851390
</div>
13861391

13871392
<p>When the property is set on floating elements, it results in a

0 commit comments

Comments
 (0)