Skip to content

Commit a7b0a94

Browse files
committed
[css-inline-3] Shift linebox-relative alignment values to baseline-shift per #5180
1 parent 3974fd8 commit a7b0a94

File tree

1 file changed

+51
-52
lines changed

1 file changed

+51
-52
lines changed

css-inline-3/Overview.bs

+51-52
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ Layout Within Line Boxes</h3>
227227
Issue(5178): Handle negative half-leading?
228228
</ul>
229229

230-
2. The [=inline-level boxes=] with [=baseline alignment values=]
230+
2. The [=inline-level boxes=]
231231
are aligned in the [=block axis=]
232232
according to 'dominant-baseline' and 'vertical-align'.
233+
Those with [=line-relative values=] for 'baseline-shift'
234+
are assumed to be aligned so as to minimize the line box height.
233235

234236
3. The [=line box=]’s [=logical height=] is calculated
235237
to exactly include the aligned [=layout bounds=]
236238
of all its [=inline-level boxes=].
237-
Those with [=line-relative alignment values=]
238-
are assumed to be aligned so as to minimize the line box height.
239239

240240
4. The [=root inline box=]’s [=aligned subtree=]
241241
and boxes with line-box&ndash;relative 'vertical-align' values
@@ -662,6 +662,15 @@ Transverse Box Alignment: the 'vertical-align' property</h3>
662662
unless specifically needing to cascade its longhands independently
663663
or (on SVG elements) to support legacy SVG implementations.
664664

665+
Note: 'vertical-align' can also affect the alignment of table cells
666+
when 'align-content' is ''align-content/normal''.
667+
Specifically, ''vertical-align/top'' (''baseline-shift: top'') maps it to ''align-content/start'',
668+
''vertical-align/bottom'' (''baseline-shift: bottom'') to ''align-content/end'',
669+
and ''vertical-align/center'' (''alignment-baseline: middle'') to ''align-content/center''.
670+
See [[css-align-3#distribution-block]].
671+
672+
ISSUE(https://github.com/w3c/csswg-drafts/issues/5234): Define mapping of ''alignment-baseline: middle; baseline-shift: top''.
673+
665674
<h4 id="baseline-source">
666675
Alignment Baseline Source: the 'baseline-source' longhand</h4>
667676

@@ -715,11 +724,7 @@ Alignment Baseline Type: the 'alignment-baseline' longhand</h4>
715724
prior to applying its [=post-alignment shift=]
716725
(if applicable).
717726

718-
<h5 class="no-toc" id="alignment-baseline-baselines">
719-
Baseline Alignment Values</h5>
720-
721-
The <dfn>baseline alignment values</dfn>
722-
are defined as follows:
727+
Values are defined as follows:
723728

724729
<dl dfn-for=alignment-baseline dfn-type=value>
725730
<dt><dfn>baseline</dfn>
@@ -772,43 +777,6 @@ Baseline Alignment Values</h5>
772777
these values instead specify the [=baseline=] that is aligned
773778
to the SVG <a>current text position</a>.
774779

775-
<h5 class="no-toc" id="alignment-baseline-linebox">
776-
Line-Relative Alignment Values</h5>
777-
778-
The <dfn>line-relative alignment values</dfn>,
779-
which reference the [=line-over=] and [=line-under=] edges
780-
of the box’s [=aligned subtree=]
781-
and align with respect to the corresponding edges of the [=line box=] itself,
782-
are defined below:
783-
784-
<dl dfn-for=alignment-baseline dfn-type=value>
785-
<dt><dfn>top</dfn>
786-
<dd>
787-
Align the [=line-over=] edge of the [=aligned subtree=]
788-
with the [=line-over=] edge of the [=line box=].
789-
790-
<dt><dfn>center</dfn>
791-
<dd>
792-
Align the center of the [=aligned subtree=]
793-
with the center of the [=line box=].
794-
795-
<dt><dfn>bottom</dfn>
796-
<dd>
797-
Align the [=line-under=] edge of the [=aligned subtree=]
798-
with the [=line-under=] edge of the [=line box=].
799-
</dl>
800-
801-
Since the block-axis bounds of an [=inline box=]
802-
do not as a rule encompass their contents,
803-
these values use the bounds of the [=aligned subtree=].
804-
The <dfn>aligned subtree</dfn> of an [=inline box=] contains that box
805-
and the [=aligned subtrees=] of all children [=inline boxes=]
806-
whose computed 'alignment-baseline' value
807-
is not itself a [=line-relative alignment value=].
808-
The [=line-over=] edge of the [=aligned subtree=]
809-
is the highest [=over=] edge of the boxes in the subtree,
810-
and the [=line-under=] edge is analogously the lowest.
811-
812780
<h5 class="no-toc" id="alignment-baseline-svg-legacy">
813781
Legacy Values for SVG</h5>
814782

@@ -825,18 +793,22 @@ Post-Alignment Shift: the 'baseline-shift' longhand</h4>
825793

826794
<pre class="propdef">
827795
Name: baseline-shift
828-
Value: <<length-percentage>> | sub | super
796+
Value: <<length-percentage>> | sub | super | top | center | bottom
829797
Initial: 0
830798
Applies to: inline-level boxes and SVG <a>text content elements</a>
831-
<!-- table cells left out b/c CSS2.1 vertical-align values must have no effect... -->
832799
Inherited: no
833800
Percentages: refer to the used value of 'line-height'
834801
Computed value: the specified keyword and/or a computed <<length-percentage>> value
835802
</pre>
836803

837-
This property specifies the box’s <dfn>post-alignment shift</dfn>:
838-
by how much the box is shifted up from its aligned position.
839-
It does not apply when 'alignment-baseline' is ''alignment-baseline/top'' or ''alignment-baseline/bottom''.
804+
This property specifies the box’s <dfn>post-alignment shift</dfn>.
805+
The <dfn>baseline-relative values</dfn>
806+
<<length-percentage>>, ''baseline-shift/sub'', ''baseline-shift/super''
807+
shift the box relative to its baseline-aligned position,
808+
whereas the <dfn>line-relative values</dfn>
809+
''baseline-shift/top'', ''baseline-shift/center'', and ''baseline-shift/bottom''
810+
shift the [=inline box=] and its contents
811+
relative to the bounds of its [=line box=].
840812

841813
<p class="advisement">
842814
Authors should use the 'vertical-align' shorthand,
@@ -861,11 +833,38 @@ Post-Alignment Shift: the 'baseline-shift' longhand</h4>
861833
<dt><dfn>super</dfn>
862834
<dd>Raise by the offset appropriate for superscripts of the parent’s box.
863835
(The UA should use the parent’s font data to find this offset whenever possible.)
836+
837+
<dt><dfn>top</dfn>
838+
<dd>
839+
Align the [=line-over=] edge of the [=aligned subtree=]
840+
with the [=line-over=] edge of the [=line box=].
841+
842+
<dt><dfn>center</dfn>
843+
<dd>
844+
Align the center of the [=aligned subtree=]
845+
with the center of the [=line box=].
846+
847+
<dt><dfn>bottom</dfn>
848+
<dd>
849+
Align the [=line-under=] edge of the [=aligned subtree=]
850+
with the [=line-under=] edge of the [=line box=].
864851
</dl>
865852

866-
<p>User agents <em>may</em> additionally support the keyword <dfn value for=baseline-shift>baseline</dfn>
867-
as computing to ''0''
853+
The <dfn>aligned subtree</dfn> of an [=inline box=] contains that box
854+
and the [=aligned subtrees=] of all children [=inline boxes=]
855+
whose computed 'alignment-baseline' value
856+
is not itself a [=line-relative value=].
857+
The [=line-over=] edge of the [=aligned subtree=]
858+
is the highest [=over=] edge of the boxes in the subtree,
859+
and the [=line-under=] edge is analogously the lowest.
860+
861+
<h5 class="no-toc" id="baseline-shift-svg-legacy">
862+
Legacy Values for SVG</h5>
863+
864+
<p>User agents <em>may</em> additionally support
865+
the keyword <dfn value for=baseline-shift>baseline</dfn> as computing to ''0''
868866
if is necessary for them to support legacy SVG content.
867+
This value is not allowed in the 'vertical-align' shorthand.
869868

870869
Issue: We would prefer to remove the ''baseline-shift/baseline'' value, and are looking for feedback from SVG user agents as to whether it's necessary.
871870

0 commit comments

Comments
 (0)