@@ -227,15 +227,15 @@ Layout Within Line Boxes</h3>
227
227
Issue(5178): Handle negative half-leading?
228
228
</ul>
229
229
230
- 2. The [=inline-level boxes=] with [=baseline alignment values=]
230
+ 2. The [=inline-level boxes=]
231
231
are aligned in the [=block axis=]
232
232
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.
233
235
234
236
3. The [=line box=] ’s [=logical height=] is calculated
235
237
to exactly include the aligned [=layout bounds=]
236
238
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.
239
239
240
240
4. The [=root inline box=] ’s [=aligned subtree=]
241
241
and boxes with line-box–relative 'vertical-align' values
@@ -662,6 +662,15 @@ Transverse Box Alignment: the 'vertical-align' property</h3>
662
662
unless specifically needing to cascade its longhands independently
663
663
or (on SVG elements) to support legacy SVG implementations.
664
664
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
+
665
674
<h4 id="baseline-source">
666
675
Alignment Baseline Source: the 'baseline-source' longhand</h4>
667
676
@@ -715,11 +724,7 @@ Alignment Baseline Type: the 'alignment-baseline' longhand</h4>
715
724
prior to applying its [=post-alignment shift=]
716
725
(if applicable).
717
726
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:
723
728
724
729
<dl dfn-for=alignment-baseline dfn-type=value>
725
730
<dt> <dfn>baseline</dfn>
@@ -772,43 +777,6 @@ Baseline Alignment Values</h5>
772
777
these values instead specify the [=baseline=] that is aligned
773
778
to the SVG <a>current text position</a> .
774
779
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
-
812
780
<h5 class="no-toc" id="alignment-baseline-svg-legacy">
813
781
Legacy Values for SVG</h5>
814
782
@@ -825,18 +793,22 @@ Post-Alignment Shift: the 'baseline-shift' longhand</h4>
825
793
826
794
<pre class="propdef">
827
795
Name : baseline-shift
828
- Value : <<length-percentage>> | sub | super
796
+ Value : <<length-percentage>> | sub | super | top | center | bottom
829
797
Initial : 0
830
798
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... -->
832
799
Inherited : no
833
800
Percentages : refer to the used value of 'line-height'
834
801
Computed value : the specified keyword and/or a computed <<length-percentage>> value
835
802
</pre>
836
803
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=] .
840
812
841
813
<p class="advisement">
842
814
Authors should use the 'vertical-align' shorthand,
@@ -861,11 +833,38 @@ Post-Alignment Shift: the 'baseline-shift' longhand</h4>
861
833
<dt> <dfn>super</dfn>
862
834
<dd> Raise by the offset appropriate for superscripts of the parent’s box.
863
835
(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=] .
864
851
</dl>
865
852
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''
868
866
if is necessary for them to support legacy SVG content.
867
+ This value is not allowed in the 'vertical-align' shorthand.
869
868
870
869
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.
871
870
0 commit comments