Skip to content

Commit cde0311

Browse files
committed
[css3-page] 6.3.2: switch to css3-sizing terminology, lots of fixes.
--HG-- extra : rebase_source : 6d79e7adb1e9d5693708cc9f7319bceca2d9b43c
1 parent 074866a commit cde0311

2 files changed

Lines changed: 182 additions & 205 deletions

File tree

css3-page/Overview.html

Lines changed: 105 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
rel=dcterms.rights>
1010
<meta content=" CSS Paged Media Module Level 3" name=dcterms.title>
1111
<meta content=text name=dcterms.type>
12-
<meta content=2012-11-04 name=dcterms.issued>
12+
<meta content=2012-11-05 name=dcterms.issued>
1313
<meta content="Melinda Grant" name=dcterms.creator>
1414
<meta content="Håkon Wium Lie" name=dcterms.creator>
1515
<meta content="Elika J. Etemad" name=dcterms.creator>
1616
<meta content=W3C name=dcterms.publisher>
17-
<meta content="http://www.w3.org/TR/2012/ED-css3-page-20121104/"
17+
<meta content="http://www.w3.org/TR/2012/ED-css3-page-20121105/"
1818
name=dcterms.identifier>
1919
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
2020
<link href="../default.css" rel=stylesheet type="text/css">
@@ -99,14 +99,14 @@
9999

100100
<h1>CSS Paged Media Module Level 3</h1>
101101

102-
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft 4 November 2012</h2>
102+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft 5 November 2012</h2>
103103

104104
<dl>
105105
<dt>This version:
106106

107107
<dd><a
108108
href="http://dev.w3.org/csswg/css3-page/">http://dev.w3.org/csswg/css3-page/</a></dd>
109-
<!-- <dd><a href="http://www.w3.org/TR/2012/ED-css3-page-20121104/">http://www.w3.org/TR/2012/WD-css3-page-20121104</a></dd> -->
109+
<!-- <dd><a href="http://www.w3.org/TR/2012/ED-css3-page-20121105/">http://www.w3.org/TR/2012/WD-css3-page-20121105</a></dd> -->
110110

111111
<dt>Latest version:
112112

@@ -191,7 +191,7 @@ <h2 class="no-num no-toc" id=status>Status of this Document</h2>
191191
<p>This document contains the <abbr
192192
title="Cascading Style Sheets">CSS3</abbr> Paged Media Module W3C Last
193193
Call <a href="/2005/10/Process-20051014/tr.html#RecsWD">Working Draft</a>
194-
of 4 November 2012. The Last Call period ends on <span
194+
of 5 November 2012. The Last Call period ends on <span
195195
class=fudge>TBD</span>.
196196

197197
<p>Relative to the previous Last Call Working Draft, this version has
@@ -1378,49 +1378,49 @@ <h4 id=max-margin-dimension><span class=secno>6.3.1. </span>Margin Box
13781378
defined for use in the subsequent margin box calculations:
13791379

13801380
<dl>
1381-
<dt id=MaxBoxWidth>max box width
1381+
<dt id=MaxBoxWidth><dfn id=max-box-width>max box width</dfn>
13821382

1383-
<dd>the sum of the page's left border width, left padding, <a
1383+
<dd>the sum of the pages left border width, left padding, <a
13841384
href="#page-box">page area</a> width, right padding, and right border
13851385
width. In other words, it is the distance between the <a
1386-
href="#page-box">page box</a><code class=css>s left border edge and
1387-
right border edge. This quantity is used when calculating dimensions of
1388-
the top and bottom margin boxes.</code>
1386+
href="#page-box">page box</a>s left border edge and right border
1387+
edge. This quantity is used when calculating dimensions of the top and
1388+
bottom margin boxes.
13891389

1390-
<dt id=MaxBoxHeight>max box height
1390+
<dt id=MaxBoxHeight><dfn id=max-box-height>max box height</dfn>
13911391

13921392
<dd>the sum of the page’s top border width, top padding, <a
13931393
href="#page-box">page area</a> height, bottom padding, and bottom border
13941394
width. In other words, it is the distance between the <a
1395-
href="#page-box">page box</a><code class=css>s top border edge and
1396-
bottom border edge. This quantity is used when calculating dimensions of
1397-
the left and right margin boxes.</code>
1395+
href="#page-box">page box</a>s top border edge and bottom border
1396+
edge. This quantity is used when calculating dimensions of the left and
1397+
right margin boxes.
13981398

1399-
<dt>outer width
1399+
<dt><dfn id=outer-width>outer width</dfn>
14001400

1401-
<dd>the sum of a margin boxs left and right margins, left and right
1401+
<dd>the sum of a margin box's left and right margins, left and right
14021402
border widths, left and right padding, and content-box width.
14031403

1404-
<dt>outer height
1404+
<dt><dfn id=outer-height>outer height</dfn>
14051405

14061406
<dd>the sum of a margin box's top and bottom margins, top and bottom
14071407
border widths, top and bottom padding, and content-box height.
14081408
</dl>
14091409

14101410
<dl>
1411-
<dt>preferred outer width
1411+
<dt><dfn id=outer-min-content>outer min-content</dfn> width
14121412

1413-
<dd>the sum of a margin box's left and right margins, left and right
1414-
border widths, left and right padding, and <a
1415-
href="http://www.w3.org/TR/CSS21/visudet.html#float-width">preferred
1416-
width</a>.
1413+
<dd>Like the <a href="#outer-width"><i>outer width</i></a>, except that
1414+
<a href="http://www.w3.org/TR/css3-sizing/#min-content"><code
1415+
class=css>min-content</code></a> is used when ‘<code
1416+
class=property>width</code>’ is ‘<code class=css>auto</code>.
14171417

1418-
<dt>preferred minimum outer width
1418+
<dt><dfn id=outer-max-content>outer max-content</dfn> width
14191419

1420-
<dd>the sum of a margin box's left and right margins, left and right
1421-
border widths, left and right padding, and <a
1422-
href="http://www.w3.org/TR/CSS21/visudet.html#float-width">preferred
1423-
minimum width</a>.
1420+
<dd>Like the <a href="#outer-width"><i>outer width</i></a>, except that
1421+
<a href="http://www.w3.org/TR/css3-sizing/#max-content"><code
1422+
class=css>max-content</code></a> is used when ‘<code
1423+
class=property>width</code>’ is ‘<code class=css>auto</code>.
14241424
</dl>
14251425

14261426
<p>The <dfn id=containing-block>containing block</dfn> for a corner margin
@@ -1466,132 +1466,133 @@ <h4 id=margin-dimension><span class=secno>6.3.2. </span>Margin Box
14661466
are replaced by empty boxes with all properties set to their initial
14671467
values. In particular, margins, border widths and padding are all zero.
14681468

1469-
<p class=note> Note: The high-level goals are, in order of priority, to
1469+
<p class=note> Note: The high-level goals are (in order of priority) to
14701470
center the middle box (B) if it is generated, to minimize overflow and
14711471
overlap, and to distribute space proportionally to the amount of content.
14721472

14731473
<ul>
14741474
<li>If B is not <a href="#generated"><em>generated</em></a>:
14751475
<ul>
14761476
<li>If both A’s and C’s widths are ‘<code
1477-
class=property>auto</code>
1477+
class=css>auto</code>
14781478
<ul>
1479-
<li>If the sum of their preferred outer widths is less than or equal
1480-
to the width of the containing block, their used width are their
1481-
respective preferred widths.
1479+
<li>If the sum of their <a href="#outer-max-content"><em>outer
1480+
max-content</em></a> is less than or equal to <a
1481+
href="#max-box-width"><var>max box width</var></a>, the used width
1482+
for A and C is the respective ‘<code
1483+
class=css>max-content</code>’.
14821484

14831485
<li>Otherwise,
14841486
<ul>
1485-
<li>The remaining width is the containing block’s with minus
1486-
A’s and C’s outer preferred minimum widths.
1487-
1488-
<li>If the remaining width is negative or zero, the used widths for
1489-
A and C are their respective preferred minimum widths.
1490-
1491-
<li>Otherwise,
1492-
<ul>
1493-
<li>The respective weights for A and C are the preferred width
1494-
minus the preferred minimum width
1495-
1496-
<li>The respective used widths for A and C are: <em>preferred
1497-
minimum width + (remaining width × weight ÷ sum of both
1498-
weights)</em>
1499-
</ul>
1500-
(In other words, the preferred minimum widths are increased by
1501-
distributing the remaining width proportionally to the weights.)
1502-
Note: weights by definition can not be negative, and this rule
1503-
only applies when at least one of them is greater than zero: this
1504-
rule never needs to divide by zero.
1487+
<li>Let <var>remaining width</var> be <a
1488+
href="#max-box-width"><var>max box width</var></a> minus A’s and
1489+
C’s <a href="#outer-min-content"><var>outer
1490+
min-content</var></a>
1491+
1492+
<li>If <var>remaining width</var> is negative or zero, the used
1493+
widths for A and C are the respective ‘<code
1494+
class=css>min-content</code>’.
1495+
1496+
<li>Otherwise, the respective used widths for A and C are:
1497+
<code>min-content + (<var>remaining width</var> × weight ÷ sum
1498+
of both weights)</code>, where the respective weights are ‘<code
1499+
class=css>max-content</code>’ minus ‘<code
1500+
class=css>min-content</code>’.
15051501
</ul>
1502+
1503+
<p class=note>Note: Each box gets at least ‘<code
1504+
class=css>min-content</code>’. The remaining space, if any, is
1505+
distributed proportionally to ‘<code
1506+
class=css>max-content</code>’ minus ‘<code
1507+
class=css>min-content</code>’. The rules are construted to never
1508+
divide by zero.
15061509
</ul>
1507-
</ul>
15081510

1509-
<ul>
1510-
<li>Otherwise, if A’s width is ‘<code
1511-
class=property>auto</code>’, its used width is the "shrink-to-fit"
1512-
width with the available width set to:
1511+
<li>Otherwise, if A’s width is ‘<code class=css>auto</code>’, the
1512+
used width is <code>min(max-content, max(min-content,
1513+
available))</code> where <var>available</var> is:
15131514
<ul>
1514-
<li>the containing block’s width
1515+
<li><a href="#max-box-width"><var>max box width</var></a>
15151516

1516-
<li>minus the C’s outer width
1517+
<li>minus C’s <a href="#outer-width"><i>outer width</i></a>
15171518

1518-
<li>minus the A’s own margins, borders and padding
1519+
<li>minus A’s own margins, borders and padding
15191520
</ul>
15201521

1521-
<li>Otherwise, if C’s width is ‘<code
1522-
class=property>auto</code>’, its used width is the "shrink-to-fit"
1523-
width with the available width set to:
1522+
<li>Otherwise, if C’s width is ‘<code class=css>auto</code>’, the
1523+
used width is <code>min(max-content, max(min-content,
1524+
available))</code> where <var>available</var> is:
15241525
<ul>
1525-
<li>the containing block’s width
1526+
<li><a href="#max-box-width"><var>max box width</var></a>
15261527

1527-
<li>minus the A’s outer width
1528+
<li>minus A’s <a href="#outer-width"><i>outer width</i></a>
15281529

1529-
<li>minus the C’s own margins, borders and padding
1530+
<li>minus C’s own margins, borders and padding
15301531
</ul>
15311532
</ul>
15321533

15331534
<li>Otherwise (if B is generated)
15341535
<ul>
1535-
<li>If B’s width is ‘<code class=property>auto</code>
1536+
<li>If B’s width is ‘<code class=css>auto</code>
15361537
<ul>
1537-
<li>Define AC-minimum as twice the greater of A’s and C’s
1538-
preferred minimum outer width, and AC-preferred as twice the greater
1539-
of their preferred outer width.
1538+
<li>Let <var>AC-min</var> be <code>2 × max(A’s outer min-content,
1539+
C’s outer min-content)</code>.
1540+
1541+
<li>Let <var>AC-max</var> be <code>2 × max(A’s outer max-content,
1542+
C’s outer max-content)</code>.
15401543

1541-
<li>If B’s preferred minimum outer width plus AC-minimum is greater
1542-
than the width of the containing block, the used width for B is its
1543-
preferred minimum width.
1544+
<li>If B’s <a href="#outer-max-content"><i>outer
1545+
max-content</i></a> is less than or equal to <a
1546+
href="#max-box-width"><i>max box width</i></a> minus
1547+
<var>AC-max</var>, the used width for B is ‘<code
1548+
class=css>max-content</code>’.
1549+
1550+
<li>Otherwise, if B’s <a href="#outer-min-content"><i>outer
1551+
min-content</i></a> is greater than <a href="#max-box-width"><i>max
1552+
box width</i></a> minus <var>AC-min</var>, the used width for B is
1553+
<code class=css>min-content</code>’.
15441554

15451555
<li>Otherwise,
15461556
<ul>
1547-
<li>The remaining width is the containing block’s with minus
1548-
AC-minimum minus B’s outer preferred minimum width.
1549-
1550-
<li>If the remaining width is negative or zero, the used widths for
1551-
B is the preferred minimum width.
1552-
1553-
<li>Otherwise,
1554-
<ul>
1555-
<li>The weight for B is its preferred width minus its preferred
1556-
minimum width. The weight for AC is AC-preferred minus
1557-
AC-minimum.
1558-
1559-
<li>The used width for B is: <em>preferred minimum width +
1560-
(remaining width × weight ÷ sum of both weights)</em>
1561-
</ul>
1562-
(In other words, the preferred minimum width is increased by a
1563-
portion of the remaining width proportional to the relative
1564-
weight.) Note: weights by definition can not be negative, and this
1565-
rule only applies when at least one of them is greater than zero:
1566-
this rule never needs to divide by zero.
1557+
<li>Let the weight for B be ‘<code
1558+
class=css>max-content</code>’ minus ‘<code
1559+
class=css>min-content</code>’.
1560+
1561+
<li>Let the weight for AC be <var>AC-max</var> minus
1562+
<var>AC-min</var>
1563+
1564+
<li>The used width for B is: <code>min-content + (remaining ×
1565+
weight ÷ sum of both weights)</code>, where <var>remaining</var>
1566+
is <a href="#max-box-width"><i>max box width</i></a> minus
1567+
<var>AC-min</var> minus B’s <a
1568+
href="#outer-min-content"><i>outer min-content</i></a>.
15671569
</ul>
15681570
</ul>
15691571

1570-
<li>If A’s width is ‘<code class=property>auto</code>’, the used
1571-
width is the "shrink-to-fit" width with the available width set to:
1572+
<li>Then, if A’s width is ‘<code class=css>auto</code>’, the used
1573+
width is <code>min(max-content, max(min-content, available))</code>
1574+
where <var>available</var> is:
15721575
<ul>
1573-
<li>half of the containing block’s width
1576+
<li>half of <a href="#max-box-width"><var>max box width</var></a>
15741577

1575-
<li>minus half of the outer width of B.
1578+
<li>minus half of B’s <a href="#outer-width"><i>outer width</i></a>
15761579

15771580
<li>minus the A’s own margins, borders and padding
15781581
</ul>
15791582

1580-
<li>If C’s width is ‘<code class=property>auto</code>’, the used
1581-
width is the "shrink-to-fit" width with the available width set to:
1583+
<li>Then, if C’s width is ‘<code class=css>auto</code>’, the used
1584+
width is <code>min(max-content, max(min-content, available))</code>
1585+
where <var>available</var> is:
15821586
<ul>
1583-
<li>half of the containing block’s width
1587+
<li>half of <a href="#max-box-width"><var>max box width</var></a>
15841588

1585-
<li>minus half of the outer width of B.
1589+
<li>minus half of B’s <a href="#outer-width"><i>outer width</i></a>
15861590

15871591
<li>minus the C’s own margins, borders and padding
15881592
</ul>
15891593
</ul>
15901594
</ul>
15911595

1592-
<p class=note> Note: By their definitions, margins can be negative, but
1593-
widths cannot.
1594-
15951596
<p>The used values for ‘<code class=property>bottom-left</code>’,
15961597
<code class=property>bottom-center</code>’ and ‘<code
15971598
class=property>bottom-right</code>’ margin boxes are established by the

0 commit comments

Comments
 (0)