11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22<html lang="en">
3- <!-- $Id: visuren.src,v 2.91 2003-01-17 21:25:06 bbos Exp $ -->
3+ <!-- $Id: visuren.src,v 2.92 2003-01-21 16:35:04 bbos Exp $ -->
44<head>
55<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66<title>Visual formatting model</title>
7- <!-- Changed by: Tantek Celik, 2002-12-16 -->
7+ <!-- Changed by: Tantek Celik, 2003-01-20 -->
88<style type="text/css">
99.current,.proposed { background:#feb }
1010ins.proposed { background:#bfb }
@@ -897,6 +897,34 @@ either it fits or there are no more floats present.
897897Any content in the current line before a floated box is reflowed
898898in the first available line on the other side of the float.
899899</p>
900+ <div class="example">
901+ <p><strong>Example.</strong>
902+ In the following document fragment, the containing block is too short
903+ to contain the content, so the content gets moved to below the floats
904+ where it is aligned in the line box according to the text-align
905+ property.
906+ </p>
907+ <pre>
908+ p { width: 10em; border: solid aqua; }
909+ span { float: left; width: 5em; height: 5em; border: solid blue; }
910+
911+ ...
912+
913+ <p>
914+ <span> </span>
915+ Supercalifragilisticexpialidocious
916+ </p>
917+ </pre>
918+ <p>This fragment might look like this:</p>
919+ <div class="figure"><p>
920+ <img style="display:block" src="supercal.png"
921+ alt="Image illustrating the effect of an unbreakable piece of content
922+ being reflowed to just after a float which left insufficient room next to it
923+ for the content to fit." >
924+ </p>
925+ </div>
926+ </div>
927+
900928<p>Several floats may be adjacent, and this model also applies to
901929adjacent floats in the same line.
902930</p>
@@ -1444,7 +1472,7 @@ text of <em>outer</em> and the body text would have overlapped.
14441472<p>Now consider the effect of <a href="#floats">floating</a> the
14451473<em>inner</em> element's text to the right by means of the following
14461474rules:
1447-
1475+ </p>
14481476<pre class="example">
14491477#outer { color: red }
14501478#inner { float: right; width: 130px; color: blue }
@@ -1464,7 +1492,7 @@ document's remaining text flows into them.</p>
14641492<p>To show the effect of the <span
14651493class="propinst-clear">'clear'</span> property, we add a <em>sibling</em>
14661494element to the example:
1467-
1495+ </p>
14681496<pre class="html-example">
14691497<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
14701498<HTML>
@@ -1484,7 +1512,7 @@ element to the example:
14841512</pre>
14851513
14861514<p>The following rules:
1487-
1515+ </p>
14881516<pre class="example">
14891517#inner { float: right; width: 130px; color: blue }
14901518#sibling { color: red }
@@ -1505,7 +1533,7 @@ property on the <em>sibling</em> element is set to 'right' (i.e., the
15051533generated <em>sibling</em> box will not accept a position next to
15061534floating boxes to its right), the <em>sibling</em> content begins to
15071535flow below the float:
1508-
1536+ </p>
15091537<pre class="example">
15101538#inner { float: right; width: 130px; color: blue }
15111539#sibling { clear: right; color: red }
@@ -1557,7 +1585,7 @@ split across several lines, the first inline box's top and left edges
15571585(depicted by thick dashed lines in the illustration below)
15581586serve as references for <span class="propinst-top">'top'</span> and
15591587<span class="propinst-left">'left'</span> offsets.
1560-
1588+ </p>
15611589<pre class="example">
15621590#outer {
15631591 position: relative;
@@ -1605,7 +1633,7 @@ box would end up in this case.</p>
16051633<div class="html-example"><p>
16061634Relative and absolute positioning may be used to implement change
16071635bars, as shown in the following example. The following fragment:
1608-
1636+ </p>
16091637<pre>
16101638<P style="position: relative; margin-right: 10px; left: 10px;">
16111639I used two red hyphens to serve as a change bar. They
@@ -1641,25 +1669,25 @@ class="propinst-z-index">'z-index'</span> property</h3>
16411669
16421670<p>For a positioned box, the <span
16431671class="propinst-z-index">'z-index'</span> property specifies:
1644-
1672+ </p>
16451673<ol>
1646- <li>The stack level of the box in the current stacking context.
1647- <li>Whether the box establishes a local stacking context.
1674+ <li>The stack level of the box in the current stacking context.</li>
1675+ <li>Whether the box establishes a local stacking context.</li>
16481676</ol>
16491677
16501678<p>Values have the following meanings:</p>
16511679
16521680<dl>
16531681<dt><span class="index-inst" title="<integer>"><span
1654- class="value-inst-integer"><strong><integer></strong></span></span>
1682+ class="value-inst-integer"><strong><integer></strong></span></span></dt>
16551683<dd>This integer is the stack level of the generated box
16561684in the current stacking context. The box
16571685also establishes a local stacking context in which its stack
1658- level is '0'.
1659- <dt><strong>auto</strong>
1686+ level is '0'.</dd>
1687+ <dt><strong>auto</strong></dt>
16601688<dd>The stack level of the generated box in the current stacking
16611689context is the same as its parent's box. The
1662- box does not establish a new local stacking context.
1690+ box does not establish a new local stacking context.</dd>
16631691</dl>
16641692
16651693<p><em>In this section, the expression "in front of"
@@ -1670,7 +1698,7 @@ to their horizontal and vertical positions, boxes lie along a "z-axis"
16701698and are formatted one on top of the other. Z-axis positions are
16711699particularly relevant when boxes overlap visually. This section
16721700discusses how boxes may be positioned along the z-axis.
1673-
1701+ </p>
16741702
16751703<p>Each box belongs to one <span class="index-def" title="stacking
16761704context"><dfn>stacking context</dfn></span>. Each box in a given
@@ -1681,6 +1709,7 @@ stacking context. Boxes with greater stack levels are always formatted
16811709in front of boxes with lower stack levels. Boxes may have negative
16821710stack levels. Boxes with the same stack level in a stacking context
16831711are stacked bottom-to-top according to document tree order.
1712+ </p>
16841713
16851714<!-- Say depth-first traversal? -IJ -->
16861715
@@ -1691,25 +1720,28 @@ class="index-def" title="local stacking context"><dfn>local stacking
16911720contexts</dfn></span>. Stacking contexts are inherited. A local
16921721stacking context is atomic; boxes in other stacking contexts may not
16931722come between any of its boxes.
1723+ </p>
16941724
16951725<p>An element that establishes a local stacking context generates a
16961726box that has two stack levels: one for the stacking context it creates
16971727(always '0') and one for the stacking context to which it belongs
16981728(given by the <span class="propinst-z-index">'z-index'</span>
16991729property).
1730+ </p>
17001731
17011732<p>An element's box has the same stack level as its parent's box
17021733unless given a different stack level with the <span
17031734class="propinst-z-index">'z-index'</span> property.
1735+ </p>
17041736
1705- <div class="html-example"><p>
1737+ <div class="html-example">
17061738<p>In the following example, the stack levels of
17071739the boxes (named with their "id" attributes) are:
17081740"text2"=0, "image"=1, "text3"=2, and "text1"=3. The
17091741"text2" stack level is inherited from the root box. The
17101742others are specified with the <span
17111743class="propinst-z-index">'z-index'</span> property.
1712-
1744+ </p>
17131745<pre>
17141746<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
17151747<HTML>
@@ -1757,6 +1789,7 @@ the example, each box transparently overlays the boxes below it. This
17571789behavior can be overridden by using one of the existing
17581790<a href="colors.html#background-properties">
17591791background properties</a>.
1792+ </p>
17601793
17611794<h2><a name="direction">Text direction:</a>
17621795the <span class="propinst-direction">'direction'</span>
@@ -1777,7 +1810,7 @@ single (visually displayed) block may appear with mixed
17771810directionality. This phenomenon is called <span class="index-def"
17781811title="bidirectionality (bidi)"><dfn>bidirectionality</dfn></span>, or
17791812"bidi" for short.
1780-
1813+ </p>
17811814<p>The Unicode standard ([[UNICODE]], section 3.11) defines a complex
17821815algorithm for determining the proper directionality of text. The
17831816algorithm consists of an implicit part based on character properties,
@@ -1787,7 +1820,7 @@ class="propinst-direction">'direction'</span> and <span
17871820class="propinst-unicode-bidi">'unicode-bidi'</span> properties allow
17881821authors to specify how the elements and attributes of a document
17891822language map to this algorithm.
1790-
1823+ </p>
17911824<p>
17921825If a document contains right-to-left characters, and if the user
17931826agent displays these characters in right-to-left order, the user
@@ -1801,21 +1834,21 @@ that, although not every Hebrew or Arabic document contains
18011834mixed-directionality text, such documents are much more likely to
18021835contain left-to-right text (e.g., numbers, text from other languages)
18031836than are documents written in left-to-right languages.
1804-
1837+ </p>
18051838<p>Because the directionality of a text depends on the structure and
18061839semantics of the document language, these properties should in most
18071840cases be used only by designers of document type descriptions (DTDs),
18081841or authors of special documents. If a default style sheet specifies
18091842these properties, authors and users should not specify rules to
18101843override them.
1811-
1844+ </p>
18121845<p>The HTML 4.0 specification ([HTML40], section 8.2) defines
18131846bidirectionality behavior for HTML elements. The style sheet
18141847rules that would achieve the bidi behavior specified in [[HTML40]] are
18151848given in <a href="sample.html#bidi">the sample style sheet</a>. The
18161849HTML 4.0 specification also contains more information on
18171850bidirectionality issues.
1818-
1851+ </p>
18191852
18201853<!-- #include src=properties/direction.srb -->
18211854
@@ -1827,42 +1860,42 @@ href="tables.html">table</a> column layout, the direction of
18271860horizontal <a href="visufx.html#overflow">overflow</a>, and the
18281861position of an incomplete last line in a block in case of 'text-align:
18291862justify'.
1863+ </p>
18301864
18311865<p>Values for this property have the following meanings:</p>
18321866
18331867<dl>
1834- <dt><strong>ltr</strong>
1835- <dd>Left-to-right direction.
1836- <dt><strong>rtl</strong>
1837- <dd> Right-to-left direction.
1868+ <dt><strong>ltr</strong></dt>
1869+ <dd>Left-to-right direction.</dd>
1870+ <dt><strong>rtl</strong></dt>
1871+ <dd> Right-to-left direction.</dd>
18381872</dl>
18391873
18401874<p>For the <span class="propinst-direction">'direction'</span>
18411875property to have any effect on inline-level elements, the <span
18421876class="propinst-unicode-bidi">'unicode-bidi'</span> property's value
18431877must be 'embed' or 'override'.
1844-
1878+ </p>
18451879<div class="note"><p>
18461880<em><strong>Note.</strong>
18471881The <span class="propinst-direction">'direction'</span> property, when
18481882specified for table column elements, is not inherited by cells in the
18491883column since columns are not the ancestors of the cells in the document tree.
18501884Thus, CSS cannot easily capture the "dir" attribute inheritance rules described
18511885in [[HTML40]], section 11.3.2.1.
1852- </em>
1853- </div>
1886+ </em></p></div>
18541887
18551888<!-- #include src=properties/unicode-bidi.srb -->
18561889
18571890<p>Values for this property have the following meanings:</p>
18581891
18591892<dl>
1860- <dt><strong>normal</strong>
1893+ <dt><strong>normal</strong></dt>
18611894<dd>The element does not open an additional level of embedding with
18621895respect to the bidirectional algorithm. For inline-level elements,
18631896implicit reordering works across element boundaries.
1864-
1865- <dt><strong>embed</strong>
1897+ </dd>
1898+ <dt><strong>embed</strong></dt>
18661899
18671900<dd>If the element is inline-level, this value
18681901opens an additional level of embedding with respect to the
@@ -1872,8 +1905,8 @@ property. Inside the element, reordering is done implicitly. This
18721905corresponds to adding a LRE (U+202A; for 'direction: ltr') or RLE
18731906(U+202B; for 'direction: rtl') at the start of the element and a PDF
18741907(U+202C) at the end of the element.
1875-
1876- <dt><strong>bidi-override</strong>
1908+ </dd>
1909+ <dt><strong>bidi-override</strong></dt>
18771910
18781911<dd>If the element is inline-level or a block-level element that
18791912contains only inline-level elements, this creates an override. This
@@ -1883,7 +1916,7 @@ property; the implicit part of the bidirectional algorithm is
18831916ignored. This corresponds to adding a LRO (U+202D; for 'direction:
18841917ltr') or RLO (U+202E; for 'direction: rtl') at the start of the
18851918element and a PDF (U+202C) at the end of the element.
1886-
1919+ </dd>
18871920</dl>
18881921
18891922<p>The final order of characters in each block-level element is the
@@ -1897,13 +1930,13 @@ class="propinst-unicode-bidi">'unicode-bidi'</span> property has a
18971930value other than 'normal', in which case they are treated as strong
18981931characters in the <span class="propinst-direction">'direction'</span>
18991932specified for the element.
1900-
1933+ </p>
19011934<p>Please note that in order to be able to flow inline boxes in a
19021935uniform direction (either entirely left-to-right or entirely
19031936right-to-left), more inline boxes (including anonymous inline boxes)
19041937may have to be created, and some inline boxes may have to be split up
19051938and reordered before flowing.
1906-
1939+ </p>
19071940<p>Because the Unicode algorithm has a limit of
19081941<em title="According to unicode 3.0, chapter 3, section 12, definition BD2.
19091942Specifically, page 58 here: http://www.unicode.org/unicode/uni2book/ch03.pdf"
@@ -1915,7 +1948,7 @@ should be used with extreme caution. However, for elements that are,
19151948in general, intended to be displayed as blocks, a setting of
19161949'unicode-bidi: embed' is preferred to keep the element together in
19171950case display is changed to inline (see example below).
1918-
1951+ </p>
19191952<p>The following example shows an XML document with bidirectional
19201953text. It illustrates an important design principle: <span
19211954class="index-inst" title="DTD">DTD</span> designers should take bidi
@@ -1924,12 +1957,12 @@ in any accompanying style sheets. The style sheets should be designed
19241957so that bidi rules are separate from other style rules. The bidi rules
19251958should not be overridden by other style sheets so that the document
19261959language's or DTD's bidi behavior is preserved.
1927-
1960+ </p>
19281961<div class="example"><p>
19291962In this example,
19301963lowercase letters stand for inherently left-to-right characters and
19311964uppercase letters represent inherently right-to-left characters:
1932-
1965+ </p>
19331966<pre class="xml-example">
19341967<HEBREW>
19351968 <PAR>HEBREW1 HEBREW2 english3 HEBREW4 HEBREW5</PAR>
@@ -1963,15 +1996,15 @@ right, the final three are read starting at the top left. Please note
19631996that HEBREW and ENGLISH are chosen as element names for explicitness
19641997only; in general, element names should convey structure without
19651998reference to language.
1966-
1999+ </p>
19672000<p>The EMPH element is inline-level, and since its value for <span
19682001class="propinst-unicode-bidi">'unicode-bidi'</span> is 'normal' (the
19692002initial value), it has no effect on the ordering of the text. The
19702003HE-QUO element, on the other hand, creates an embedding.
1971-
2004+ </p>
19722005<p>The formatting of this text might look like this if the line length
19732006is long:
1974-
2007+ </p>
19752008<pre class="ascii-art">
19762009 5WERBEH 4WERBEH english3 2WERBEH 1WERBEH
19772010
@@ -1986,9 +2019,9 @@ english17 20WERBEH english19 18WERBEH
19862019
19872020<p>Note that the HE-QUO embedding causes HEBREW18 to be to the right
19882021of english19.
1989-
2022+ </p>
19902023<p>If lines have to be broken, it might be more like this:
1991-
2024+ </p>
19922025<pre class="ascii-art">
19932026 2WERBEH 1WERBEH
19942027 -EH 4WERBEH english3
@@ -2015,6 +2048,7 @@ from english19 might have fit on the previous line, but hyphenation of
20152048left-to-right words in a right-to-left context, and vice versa, is
20162049usually suppressed to avoid having to display a hyphen in the middle
20172050of a line.
2051+ </p>
20182052</div><!-- example -->
20192053
20202054</body>
0 commit comments