Skip to content

Commit 22bd903

Browse files
committed
[css-align] 1/3-baked baseline section revision
1 parent 4e1fd13 commit 22bd903

2 files changed

Lines changed: 85 additions & 34 deletions

File tree

css-align/Overview.bs

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Previous Version: http://www.w3.org/TR/2013/WD-css3-align-20130514/
1313
Previous Version: http://www.w3.org/TR/2012/WD-css3-align-20120612/
1414
Abstract: This module contains the features of <a href="http://www.w3.org/TR/CSS/">CSS</a> relating to the alignment of boxes within their containers in the various CSS box layout models: block layout, table layout, flex layout, and grid layout. (The alignment of text and inline-level content is defined in [[CSS3TEXT]] and [[CSS3LINE]].)
1515
!Issue Tracking: <a href="http://www.w3.org/Style/CSS/Tracker/products/39">http://www.w3.org/Style/CSS/Tracker/products/39</a>
16-
Link Defaults: selectors-3 (dfn) first formatted line/first formatted lines, css-flexbox-1 (dfn) flex line/flex lines, css-multicol-1 (dfn) multi-column element
16+
Link Defaults: selectors-3 (dfn) first formatted line/first formatted lines, css-flexbox-1 (dfn) flex line/flex lines, css-multicol-1 (dfn) multi-column element, css-fonts-3 (dfn) first available font
1717
Ignored Terms: orthogonal, block container, table cell
1818
At Risk: ''last-baseline''
1919
</pre>
@@ -896,14 +896,21 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
896896
Determining the Baseline of a Box</h2>
897897

898898
The <dfn>first baseline</dfn> (and <dfn>last baseline</dfn>) of a box
899-
are determined differently based on the layout model, as follows:
899+
for a given axis
900+
is a set of baselines (alphabetic, central, etc.) belonging to a line box within the box.
901+
The <a>alignment baseline</a> is one of these,
902+
usually the dominant baseline of the <a>alignment container</a>.
903+
(Note, however, that boxes might not have a baseline in a particular axis.)
904+
905+
The first and last baselines of a box are determined differently based on the layout model, as follows:
900906

901907
<dl>
902908
<dt>''block''
903909
<dt>''list-item''
904910
<dd>
905-
The inline-axis baseline of a block is the baseline of the first (last) in-flow line box in the block,
906-
or the first (last) in-flow block-level child in the block that has a baseline,
911+
The first (last) inline-axis baseline of a block
912+
is generated from the dominant baseline of the first (last) in-flow line box in the block,
913+
or is taken from the first (last) in-flow block-level child in the block that has a baseline,
907914
whichever comes first (last).
908915
If there is no such line box or child,
909916
then the block has no baseline.
@@ -915,23 +922,23 @@ Determining the Baseline of a Box</h2>
915922

916923
<dt>''table''
917924
<dd>
918-
The inline-axis baseline of a table box is the baseline of its first (last) row.
919-
However, when calculating the baseline of an inline-block,
925+
The first (last) inline-axis baseline of a table box is the baseline of its first (last) row.
926+
However, when finding the baseline of an inline-block,
920927
table boxes must be skipped.
921928

922-
The block-axis baseline of a table is undefined.
929+
The block-axis baseline of a table box is the baseline of its first (last) column.
923930

924931
<p class='issue'>
925-
Or does it have no baseline?
926-
Or is it based on its first column?
932+
Or should it have no baseline?
927933

928934
<dt>''table-row''
929935
<dd>
930-
If any cells in the row participate in ''baseline'' (''last-baselin'') alignment,
931-
the inline-axis first (last) baseline of the row is their baseline,
936+
If any cells in the row participate in ''baseline'' (''last-baseline'') alignment,
937+
the first (last) inline-axis baseline of the row is
938+
generated from their shared <a>alignment baseline</a> and the row's <a>first available font</a>,
932939
after alignment has been performed.
933-
Otherwise, the inline-axis first (last) baseline of the row
934-
is the bottom content edge of the lowest cell in the row.
940+
Otherwise, the first (last) inline-axis baseline of the row
941+
is synthesized from the lowest and highest content edges of the cells in the row.
935942
[[!CSS21]]
936943

937944
A table row has no block-axis baseline.
@@ -953,10 +960,25 @@ Determining the Baseline of a Box</h2>
953960
See <a href="http://www.w3.org/TR/css3-grid-layout/#grid-baselines">Grid Baselines</a> in [[!CSS3-GRID-LAYOUT]].
954961
</dl>
955962

963+
To <dfn>generate baselines</dfn> for a box from a single baseline,
964+
use the baseline table from the font settings and <a>first available font</a> of that box.
965+
966+
To <dfn>synthesize baselines</dfn> from a rectangle (or two parallel lines),
967+
synthesize the alphabetic baseline from the lower line
968+
and the central baseline by averaging the positions of the upper and lower lines.
969+
970+
Note: The forthcoming Inline Layout Module will define synthesis rules for baselines other than alphabetic and central.
971+
956972
<p class='issue'>
957973
Maybe these things are wrong?
958974
CSS 2.1 is really weird about baseline alignment.
959-
This whole section needs to be better defined and reviewed.
975+
976+
<div class="issue">
977+
We're still working on handling multiple baseline types (alphabetc, central, etc.)
978+
and rows with multiple baseline-sharing groups (e.g. contains both first and last-aligned cells, or contains opposing writing modes).
979+
Consider this section to be Under Construction.
980+
<img src="http://dev.w3.org/csswg/construction.gif" style="display: block; margin: 1em auto;">
981+
</div>
960982

961983

962984
<h2 id="changes">

css-align/Overview.html

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -963,14 +963,21 @@ <h2 class="heading settled heading" data-level=7 id=baseline-rules><span class=s
963963
Determining the Baseline of a Box</span><a class=self-link href=#baseline-rules></a></h2>
964964

965965
<p> The <dfn data-dfn-type=dfn data-noexport="" id=first-baseline>first baseline<a class=self-link href=#first-baseline></a></dfn> (and <dfn data-dfn-type=dfn data-noexport="" id=last-baseline>last baseline<a class=self-link href=#last-baseline></a></dfn>) of a box
966-
are determined differently based on the layout model, as follows:
966+
for a given axis
967+
is a set of baselines (alphabetic, central, etc.) belonging to a line box within the box.
968+
The <a data-link-type=dfn href=#alignment-baseline title="alignment baseline">alignment baseline</a> is one of these,
969+
usually the dominant baseline of the <a data-link-type=dfn href=#alignment-container title="alignment container">alignment container</a>.
970+
(Note, however, that boxes might not have a baseline in a particular axis.)
971+
972+
<p> The first and last baselines of a box are determined differently based on the layout model, as follows:
967973

968974
<dl>
969975
<dt><span class=css data-link-type=maybe title=block>block</span>
970976
<dt><span class=css data-link-type=maybe title=list-item>list-item</span>
971977
<dd>
972-
The inline-axis baseline of a block is the baseline of the first (last) in-flow line box in the block,
973-
or the first (last) in-flow block-level child in the block that has a baseline,
978+
The first (last) inline-axis baseline of a block
979+
is generated from the dominant baseline of the first (last) in-flow line box in the block,
980+
or is taken from the first (last) in-flow block-level child in the block that has a baseline,
974981
whichever comes first (last).
975982
If there is no such line box or child,
976983
then the block has no baseline.
@@ -982,23 +989,23 @@ <h2 class="heading settled heading" data-level=7 id=baseline-rules><span class=s
982989

983990
<dt><span class=css data-link-type=maybe title=table>table</span>
984991
<dd>
985-
The inline-axis baseline of a table box is the baseline of its first (last) row.
986-
However, when calculating the baseline of an inline-block,
992+
The first (last) inline-axis baseline of a table box is the baseline of its first (last) row.
993+
However, when finding the baseline of an inline-block,
987994
table boxes must be skipped.
988995

989-
<p> The block-axis baseline of a table is undefined.
996+
<p> The block-axis baseline of a table box is the baseline of its first (last) column.
990997

991-
<p class=issue id=issue-f2630124><a class=self-link href=#issue-f2630124></a>
992-
Or does it have no baseline?
993-
Or is it based on its first column?
998+
<p class=issue id=issue-757da0f8><a class=self-link href=#issue-757da0f8></a>
999+
Or should it have no baseline?
9941000

9951001
<dt><span class=css data-link-type=maybe title=table-row>table-row</span>
9961002
<dd>
997-
If any cells in the row participate in <a class=css data-link-type=maybe href=#valuedef-baseline title=baseline>baseline</a> (<span class=css data-link-type=maybe title=last-baselin>last-baselin</span>) alignment,
998-
the inline-axis first (last) baseline of the row is their baseline,
1003+
If any cells in the row participate in <a class=css data-link-type=maybe href=#valuedef-baseline title=baseline>baseline</a> (<a class=css data-link-type=maybe href=#valuedef-last-baseline title=last-baseline>last-baseline</a>) alignment,
1004+
the first (last) inline-axis baseline of the row is
1005+
generated from their shared <a data-link-type=dfn href=#alignment-baseline title="alignment baseline">alignment baseline</a> and the row’s <a data-link-type=dfn href=http://dev.w3.org/csswg/css-fonts-3/#first-available-font title="first available font">first available font</a>,
9991006
after alignment has been performed.
1000-
Otherwise, the inline-axis first (last) baseline of the row
1001-
is the bottom content edge of the lowest cell in the row.
1007+
Otherwise, the first (last) inline-axis baseline of the row
1008+
is synthesized from the lowest and highest content edges of the cells in the row.
10021009
<a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>
10031010

10041011
<p> A table row has no block-axis baseline.
@@ -1020,10 +1027,25 @@ <h2 class="heading settled heading" data-level=7 id=baseline-rules><span class=s
10201027
See <a href=http://www.w3.org/TR/css3-grid-layout/#grid-baselines>Grid Baselines</a> in <a data-biblio-type=normative data-link-type=biblio href=#css3-grid-layout title=css3-grid-layout>[CSS3-GRID-LAYOUT]</a>.
10211028
</dl>
10221029

1023-
<p class=issue id=issue-c300815d><a class=self-link href=#issue-c300815d></a>
1030+
<p> To <dfn data-dfn-type=dfn data-noexport="" id=generate-baselines>generate baselines<a class=self-link href=#generate-baselines></a></dfn> for a box from a single baseline,
1031+
use the baseline table from the font settings and <a data-link-type=dfn href=http://dev.w3.org/csswg/css-fonts-3/#first-available-font title="first available font">first available font</a> of that box.
1032+
1033+
<p> To <dfn data-dfn-type=dfn data-noexport="" id=synthesize-baselines>synthesize baselines<a class=self-link href=#synthesize-baselines></a></dfn> from a rectangle (or two parallel lines),
1034+
synthesize the alphabetic baseline from the lower line
1035+
and the central baseline by averaging the positions of the upper and lower lines.
1036+
1037+
<p class=note> Note: The forthcoming Inline Layout Module will define synthesis rules for baselines other than alphabetic and central.
1038+
1039+
<p class=issue id=issue-cfbec8b9><a class=self-link href=#issue-cfbec8b9></a>
10241040
Maybe these things are wrong?
10251041
CSS 2.1 is really weird about baseline alignment.
1026-
This whole section needs to be better defined and reviewed.
1042+
1043+
<div class=issue id=issue-4ad4e48a><a class=self-link href=#issue-4ad4e48a></a>
1044+
We’re still working on handling multiple baseline types (alphabetc, central, etc.)
1045+
and rows with multiple baseline-sharing groups (e.g. contains both first and last-aligned cells, or contains opposing writing modes).
1046+
Consider this section to be Under Construction.
1047+
<img src=http://dev.w3.org/csswg/construction.gif style="display: block; margin: 1em auto;">
1048+
</div>
10271049

10281050

10291051
<h2 class="heading settled heading" data-level=8 id=changes><span class=secno>8 </span><span class=content>
@@ -1207,6 +1229,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
12071229
<li>first-baseline self-alignment, <a href=#baseline-self-alignment title="section 5.3">5.3</a>
12081230
<li>flex-end, <a href=#valuedef-flex-end title="section 3.1">3.1</a>
12091231
<li>flex-start, <a href=#valuedef-flex-start title="section 3.1">3.1</a>
1232+
<li>generate baselines, <a href=#generate-baselines title="section 7">7</a>
12101233
<li>&lt;item-position&gt;, <a href=#typedef-item-position title="section 3.1">3.1</a>
12111234
<li>justify-content, <a href=#propdef-justify-content title="section 4">4</a>
12121235
<li>justify-items, <a href=#propdef-justify-items title="section 6.1">6.1</a>
@@ -1230,6 +1253,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
12301253
<li>space-evenly, <a href=#valuedef-space-evenly title="section 3.3">3.3</a>
12311254
<li>start, <a href=#valuedef-start title="section 3.1">3.1</a>
12321255
<li>stretch, <a href=#valuedef-stretch title="section 3.3">3.3</a>
1256+
<li>synthesize baselines, <a href=#synthesize-baselines title="section 7">7</a>
12331257
<li>true, <a href=#valuedef-true title="section 3.4">3.4</a>
12341258
</ul></div>
12351259

@@ -1270,13 +1294,18 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In
12701294
which has the current behavior of stretching non-replaced boxes and start-aligning replaced ones.
12711295

12721296
<a href=#issue-225803b9></a></div><div class=issue>
1273-
Or does it have no baseline?
1274-
Or is it based on its first column?
1297+
Or should it have no baseline?
12751298

1276-
<a href=#issue-f2630124></a></div><div class=issue>
1299+
<a href=#issue-757da0f8></a></div><div class=issue>
12771300
Maybe these things are wrong?
12781301
CSS 2.1 is really weird about baseline alignment.
1279-
This whole section needs to be better defined and reviewed.
1302+
1303+
<a href=#issue-cfbec8b9></a></div><div class=issue>
1304+
We’re still working on handling multiple baseline types (alphabetc, central, etc.)
1305+
and rows with multiple baseline-sharing groups (e.g. contains both first and last-aligned cells, or contains opposing writing modes).
1306+
Consider this section to be Under Construction.
1307+
<img src=http://dev.w3.org/csswg/construction.gif style="display: block; margin: 1em auto;">
1308+
<a href=#issue-4ad4e48a></a></div>
12801309

12811310

1282-
<a href=#issue-c300815d></a></div></div>
1311+
</div>

0 commit comments

Comments
 (0)