Skip to content

Commit 0280641

Browse files
committed
[css-ruby-1] Re-arrange interlinear layout section.
1 parent e7ff8ca commit 0280641

File tree

1 file changed

+56
-39
lines changed

1 file changed

+56
-39
lines changed

css-ruby-1/Overview.bs

+56-39
Original file line numberDiff line numberDiff line change
@@ -712,49 +712,38 @@ White Space Collapsing</h3>
712712
Ruby Layout</h2>
713713

714714
When a ruby structure is laid out,
715-
its [=base level=] is first laid out on the line
715+
its [=base level=] is initially laid out on the line
716716
exactly as if its [=ruby bases=] were a regular sequence of [=inline boxes=]
717717
and the [=ruby container=] a regular [=inline box=] wrapped around it.
718+
718719
If a [=ruby container=] has any [=inter-character annotations=],
719720
they are laid out into the [=base level=] as detailed in [[#inter-character-layout]].
721+
Subsequently,
722+
the [=base container=] is sized and
723+
[=interlinear annotations=] are laid out
724+
as detailed in [[#interlinear-layout]].
720725

721-
Each [=base container=] is then sized and positioned
722-
to contain exactly all of its [=ruby bases=]’ margin boxes--
723-
and all their associated [=inter-character=] [=ruby annotation=] margin boxes, if any--
724-
as well as the [=base containers|base=] and [=annotation containers=]
725-
of any descendant [=ruby containers=]
726-
also participating in this [=inline formatting context=].
727-
(If a [=base container=] has no [=in-flow=] content,
728-
it is sized and positioned
729-
as if it contained a single empty [=ruby base=].)
726+
As in other CSS layout models,
727+
relative positioning, transforms, and other graphical effects
728+
apply after this layout of the boxes.
729+
730+
<h3 id="interlinear-layout">
731+
Interlinear Ruby Layout</h3>
730732

731733
[=Interlinear=] [=ruby annotations=] within a level
732-
are aligned to each other in the block axis
733-
as if they were [=inline boxes=]
734+
are initially laid out as if they were [=inline boxes=]
734735
participating in the same [=inline formatting context=],
735736
effectively establishing a [=line box=]
736737
for that [=level=] of annotation in the [=ruby container=].
737-
In the inline axis, these [=ruby annotations=] are aligned
738-
with respect to their [=ruby base boxes=]
739-
in accordance with their [=annotation container=]’s 'ruby-merge' value.
738+
[=Annotations=] and [=bases=] are aligned to each other
739+
by adjusting their spacing as described below.
740740

741-
Each [=interlinear=] [=annotation container=] is then sized and positioned
742-
to contain exactly all of its [=ruby annotations=]’ margin boxes
743-
as well as the [=base containers|base=] and [=annotation containers=]
744-
of any descendant [=ruby containers=]
745-
also participating in this [=annotation level=]’s [=inline formatting context=].
746-
(If an [=annotation container=] has no [=in-flow=] content,
747-
it is sized and positioned
748-
as if it contained a single empty [=ruby annotation=].)
749-
These [=annotation containers=] are then stacked outward
750-
over or under (depending on 'ruby-position') their corresponding [=base container=],
751-
without any intervening space,
752-
thus determining the block-axis positioning of the [=ruby annotations=]
753-
with respect to their [=ruby bases=].
741+
<h4 id="interlinear-inline">
742+
Inline-axis Interlinear Layout</h4>
754743

755-
Issue: Should block-axis margins collapse?
756-
This makes layout more robust,
757-
but is inconsistent with how inlines behave along the inline-axis.
744+
In the inline axis, [=interlinear=] [=ruby annotations=] are aligned
745+
with respect to their [=ruby base boxes=]
746+
in accordance with their [=annotation container=]’s 'ruby-merge' value.
758747

759748
When 'ruby-merge' is ''ruby-merge/separate'',
760749
each [=ruby column=] is sized
@@ -793,16 +782,44 @@ Ruby Layout</h2>
793782
and are never affected by the sizing or positioning
794783
of [=interlinear annotations=].
795784

796-
A [=ruby container=] measures as wide as the sum of its [=columns=].
797-
798-
Within these boxes,
785+
Within each [=base=] and [=annotation=] box,
799786
how the extra space is distributed
800-
when ruby content is narrower than the measure of its box
801-
is specified by the 'ruby-align' property.
787+
when its content is narrower than the measure of the box
788+
is specified by its 'ruby-align' property.
802789

803-
As in other CSS layout models,
804-
relative positioning, transforms, and other graphical effects
805-
apply after this layout of the boxes.
790+
<h4 id="interlinear-block">
791+
Block-axis Interlinear Layout</h4>
792+
793+
ISSUE: Define the extent to which 'vertical-align' affects these ruby boxes.
794+
See <a href="https://github.com/w3c/csswg-drafts/issues/4987">Issue 4987</a>.
795+
796+
Each [=base container=] is then sized and positioned
797+
to contain exactly all of its [=ruby bases=]’ margin boxes--
798+
and all their associated [=inter-character=] [=ruby annotation=] margin boxes, if any--
799+
as well as the [=base containers|base=] and [=annotation containers=]
800+
of any descendant [=ruby containers=]
801+
also participating in this [=inline formatting context=].
802+
(If a [=base container=] has no [=in-flow=] content,
803+
it is sized and positioned
804+
as if it contained a single empty [=ruby base=].)
805+
806+
Each [=interlinear=] [=annotation container=] is sized and positioned
807+
to contain exactly all of its [=ruby annotations=]’ margin boxes
808+
as well as the [=base containers|base=] and [=annotation containers=]
809+
of any descendant [=ruby containers=]
810+
also participating in this [=annotation level=]’s [=inline formatting context=].
811+
(If an [=annotation container=] has no [=in-flow=] content,
812+
it is sized and positioned
813+
as if it contained a single empty [=ruby annotation=].)
814+
These [=annotation containers=] are then stacked outward
815+
over or under (depending on 'ruby-position') their corresponding [=base container=],
816+
without any intervening space,
817+
thus determining the block-axis positioning of the [=ruby annotations=]
818+
with respect to their [=ruby bases=].
819+
820+
Issue: Should block-axis margins collapse?
821+
This makes layout more robust,
822+
but is inconsistent with how inlines behave along the inline-axis.
806823

807824
<h3 id="inter-character-layout">
808825
Inter-character Ruby Layout</h3>

0 commit comments

Comments
 (0)