Skip to content

Commit f8f2f3a

Browse files
committed
[css-writing-modes] Define the missing pieces of multi-col elements in orthogonal flows.
1 parent 5f67386 commit f8f2f3a

File tree

2 files changed

+59
-27
lines changed

2 files changed

+59
-27
lines changed

css-writing-modes/Overview.bs

+30-14
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Deadline: 2014-09-20
99
Group: csswg
1010
ED: http://dev.w3.org/csswg/css-writing-modes-3/
1111
TR: http://www.w3.org/TR/css-writing-modes-3/
12-
Previous Version: http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131126/
12+
Previous Version: http://www.w3.org/TR/2014/CR-css-writing-modes-3-20140320/
1313
!Issue Tracking: <a href="http://www.w3.org/Style/CSS/Tracker/products/30">http://www.w3.org/Style/CSS/Tracker/products/30</a>
1414
Editor: fantasai, Invited Expert, http://fantasai.inkedblade.net/contact
1515
Editor: Koji Ishii, Invited Expert, kojiishi@gluesoft.co.jp
@@ -1889,7 +1889,7 @@ Auto-sizing in Orthogonal Flows</h4>
18891889

18901890
<p>It is common in CSS for a containing block to have a definite
18911891
<i>inline-size</i>, but not a definite <i>block-size</i>. This typically happens in
1892-
CSS2.1 when a containing block has an ''auto'' height, for
1892+
CSS2.1 when a containing block has an ''height/auto'' height, for
18931893
example: its width is given by the calculations in
18941894
<a href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth">10.3.3</a>,
18951895
but its <i>block-size</i> depends on its contents. In such cases the
@@ -1914,12 +1914,13 @@ Auto-sizing Block Containers in Orthogonal Flows</h4>
19141914

19151915
<p>
19161916
If a box establishing an <i>orthogonal flow</i> is a block container or multi-column element,
1917-
for the case where the box's <i>inline-size</i> is ''auto'':
1917+
for the case where the box's <i>inline-size</i> is ''width/auto'':
19181918

19191919
<ol>
1920-
<li>
1921-
If 'column-count' and 'column-width' are both ''auto'',
1922-
calculate the used 'column-width' with the shrink-to-fit formula:
1920+
<li><strong>Calculate the used 'column-width':</strong>
1921+
<ul>
1922+
<li>If 'column-count' and 'column-width' are both ''column-width/auto'',
1923+
use the shrink-to-fit formula
19231924
<code>min(<var>max-content</var>, max(<var>min-content</var>, <var>constraint</var>))</code>,
19241925
where:
19251926
<dl>
@@ -1942,18 +1943,31 @@ Auto-sizing Block Containers in Orthogonal Flows</h4>
19421943
<img src="auto-multicol.svg" width=200
19431944
alt="Diagram of automatically triggered multi-column preventing T-shaped documents">
19441945
</div>
1945-
Note that this automatically triggers multi-column flow on all block containers
1946-
so that overflowing content, instead of continuing off the side of the containing block,
1946+
Note that this automatically triggers multi-column flow on all block containers.
1947+
This is so that overflowing content, instead of continuing off the side of the containing block,
19471948
is wrapped into columns in the flow direction of the containing block,
19481949
thus avoiding T-shaped documents.
19491950
Authors can control the measure of these columns by setting 'column-width',
1950-
or disable this behavior by setting 'width' to a non-''auto'' value
1951-
such as ''max-content''.
1951+
or disable this behavior by setting the <i>inline-size</i> property
1952+
to a non-''width/auto'' value such as ''max-content''.
19521953
<br style="clear:both;">
19531954
</div>
19541955

1955-
<li>
1956-
The used column <i>block-size</i> is:
1956+
<li>If 'column-count' is not ''column-count/auto'' and 'column-width' is ''column-count/auto'',
1957+
calculate the used 'column-width' with the same formula,
1958+
except replace <var>constraint</var> with
1959+
<var>constraint</var> &minus; ('column-count' &minus; 1) &times; 'column-gap'.
1960+
1961+
<li>If 'column-count' and 'column-width' are both non-''column-count/auto'',
1962+
the used 'column-width' is the computed 'column-width'.
1963+
(This is not recommended as it can cause overflow;
1964+
instead it is better to set the 'column-width' and a max-block-size.)
1965+
</ul>
1966+
1967+
<li><strong>Calculate the used column <i>block-size</i>:</strong>
1968+
If both 'column-count' and 'column-width' are non-''column-count/auto'',
1969+
then the used column <i>block-size</i> is the multi-column element’s <i>max-content size</i>.
1970+
Otherwise, use
19571971
the box’s <i>block-size</i> (if that is <i>definite</i>),
19581972
else the <i>fill-available block-size</i> of the box (if that is <i>definite</i>),
19591973
else the box’s <i>max-content block-size</i>.
@@ -1962,8 +1976,10 @@ Auto-sizing Block Containers in Orthogonal Flows</h4>
19621976
so that e.g. a large image will not overflow the box,
19631977
but cause the box to overflow the containing block?
19641978

1965-
<li>
1966-
The used 'column-count' then follows from filling the resulting columns with the box's content.
1979+
<li><strong>Calculate the used 'column-count':</strong>
1980+
If the computed 'column-count' is ''column-count/auto'', then
1981+
the used 'column-count' follows from filling the resulting multi-column layout
1982+
with the box's content.
19671983
</ol>
19681984

19691985
<p>

css-writing-modes/Overview.html

+29-13
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,7 @@ <h4 class="heading settled heading" data-level=7.3.1 id=orthogonal-auto><span cl
19571957

19581958
<p>It is common in CSS for a containing block to have a definite
19591959
<a data-link-type=dfn href=#inline-size title=inline-size>inline-size</a>, but not a definite <a data-link-type=dfn href=#block-size title=block-size>block-size</a>. This typically happens in
1960-
CSS2.1 when a containing block has an <span class=css data-link-type=maybe title=auto>auto</span> height, for
1960+
CSS2.1 when a containing block has an <span class=css data-link-for=height data-link-type=maybe title=auto>auto</span> height, for
19611961
example: its width is given by the calculations in
19621962
<a href=http://www.w3.org/TR/CSS21/visudet.html#blockwidth>10.3.3</a>,
19631963
but its <a data-link-type=dfn href=#block-size title=block-size>block-size</a> depends on its contents. In such cases the
@@ -1982,12 +1982,13 @@ <h4 class="heading settled heading" data-level=7.3.2 id=auto-multicol><span clas
19821982

19831983
<p>
19841984
If a box establishing an <a data-link-type=dfn href=#establish-an-orthogonal-flow title="orthogonal flow">orthogonal flow</a> is a block container or multi-column element,
1985-
for the case where the box’s <a data-link-type=dfn href=#inline-size title=inline-size>inline-size</a> is <span class=css data-link-type=maybe title=auto>auto</span>:
1985+
for the case where the box’s <a data-link-type=dfn href=#inline-size title=inline-size>inline-size</a> is <span class=css data-link-for=width data-link-type=maybe title=auto>auto</span>:
19861986

19871987
<ol>
1988-
<li>
1989-
If <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> are both <span class=css data-link-type=maybe title=auto>auto</span>,
1990-
calculate the used <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> with the shrink-to-fit formula:
1988+
<li><strong>Calculate the used <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a>:</strong>
1989+
<ul>
1990+
<li>If <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> are both <span class=css data-link-for=column-width data-link-type=maybe title=auto>auto</span>,
1991+
use the shrink-to-fit formula
19911992
<code>min(<var>max-content</var>, max(<var>min-content</var>, <var>constraint</var>))</code>,
19921993
where:
19931994
<dl>
@@ -2009,18 +2010,31 @@ <h4 class="heading settled heading" data-level=7.3.2 id=auto-multicol><span clas
20092010
<div class=sidefigure>
20102011
<img alt="Diagram of automatically triggered multi-column preventing T-shaped documents" src=auto-multicol.svg width=200>
20112012
</div>
2012-
Note that this automatically triggers multi-column flow on all block containers
2013-
so that overflowing content, instead of continuing off the side of the containing block,
2013+
Note that this automatically triggers multi-column flow on all block containers.
2014+
This is so that overflowing content, instead of continuing off the side of the containing block,
20142015
is wrapped into columns in the flow direction of the containing block,
20152016
thus avoiding T-shaped documents.
20162017
Authors can control the measure of these columns by setting <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a>,
2017-
or disable this behavior by setting <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visudet.html#propdef-width title=width>width</a> to a non-<span class=css data-link-type=maybe title=auto>auto</span> value
2018-
such as <span class=css data-link-type=maybe title=max-content>max-content</span>.
2018+
or disable this behavior by setting the <a data-link-type=dfn href=#inline-size title=inline-size>inline-size</a> property
2019+
to a non-<span class=css data-link-for=width data-link-type=maybe title=auto>auto</span> value such as <span class=css data-link-type=maybe title=max-content>max-content</span>.
20192020
<br style=clear:both;>
20202021
</div>
20212022

2022-
<li>
2023-
The used column <a data-link-type=dfn href=#block-size title=block-size>block-size</a> is:
2023+
<li>If <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> is not <span class=css data-link-for=column-count data-link-type=maybe title=auto>auto</span> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> is <span class=css data-link-for=column-count data-link-type=maybe title=auto>auto</span>,
2024+
calculate the used <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> with the same formula,
2025+
except replace <var>constraint</var> with
2026+
<var>constraint</var> − (<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> − 1) × <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-gap title=column-gap>column-gap</a>.
2027+
2028+
<li>If <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> are both non-<span class=css data-link-for=column-count data-link-type=maybe title=auto>auto</span>,
2029+
the used <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> is the computed <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a>.
2030+
(This is not recommended as it can cause overflow;
2031+
instead it is better to set the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> and a max-block-size.)
2032+
</ul>
2033+
2034+
<li><strong>Calculate the used column <a data-link-type=dfn href=#block-size title=block-size>block-size</a>:</strong>
2035+
If both <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-width title=column-width>column-width</a> are non-<span class=css data-link-for=column-count data-link-type=maybe title=auto>auto</span>,
2036+
then the used column <a data-link-type=dfn href=#block-size title=block-size>block-size</a> is the multi-column element’s <a data-link-type=dfn href=http://dev.w3.org/csswg/css-sizing-3/#max-content-inline-size title="max-content size">max-content size</a>.
2037+
Otherwise, use
20242038
the box’s <a data-link-type=dfn href=#block-size title=block-size>block-size</a> (if that is <a data-link-type=dfn href=http://dev.w3.org/csswg/css-sizing-3/#definite title=definite>definite</a>),
20252039
else the <a data-link-type=dfn href=http://dev.w3.org/csswg/css-sizing-3/#fill-available-block-size title="fill-available block-size">fill-available block-size</a> of the box (if that is <a data-link-type=dfn href=http://dev.w3.org/csswg/css-sizing-3/#definite title=definite>definite</a>),
20262040
else the box’s <a data-link-type=dfn href=http://dev.w3.org/csswg/css-sizing-3/#max-content-block-size title="max-content block-size">max-content block-size</a>.
@@ -2029,8 +2043,10 @@ <h4 class="heading settled heading" data-level=7.3.2 id=auto-multicol><span clas
20292043
so that e.g. a large image will not overflow the box,
20302044
but cause the box to overflow the containing block?
20312045

2032-
<li>
2033-
The used <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> then follows from filling the resulting columns with the box’s content.
2046+
<li><strong>Calculate the used <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a>:</strong>
2047+
If the computed <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> is <span class=css data-link-for=column-count data-link-type=maybe title=auto>auto</span>, then
2048+
the used <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-multicol-1/#propdef-column-count title=column-count>column-count</a> follows from filling the resulting multi-column layout
2049+
with the box’s content.
20342050
</ol>
20352051

20362052
<p>

0 commit comments

Comments
 (0)