Skip to content

Commit 7e0ee1a

Browse files
[css-overflow-4] Refactor the text about block-ellipsis insertion (w3c#12872)
The text had accreted various rules and constraints, but no longer had clear structure. This reorganizes the whole thing in a more understandable manner. No new behavior is introduced by this text, though some previously implicit consequences are made explicit, for clarity. Co-authored-by: Andreu Botella <andreu@andreubotella.com>
1 parent a9d14dd commit 7e0ee1a

File tree

1 file changed

+80
-42
lines changed

1 file changed

+80
-42
lines changed

css-overflow-4/Overview.bs

Lines changed: 80 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -801,55 +801,93 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property</h3>
801801
</dl>
802802

803803
When 'block-ellipsis' is neither ''no-ellipsis'' nor the empty string,
804-
the <a>block overflow ellipsis</a> string
805-
is wrapped in an anonymous inline
806-
and placed at the end of the line box
807-
as a direct child of the <a>block container</a>’s <a>root inline box</a>,
808-
reducing the space in the line box
804+
the [=block overflow ellipsis=] string
805+
is placed at the end of the line box
806+
reducing the space
809807
available to the other contents of the line.
810-
This inline is assigned ''unicode-bidi: plaintext''
811-
and ''line-height: 0''
812-
and is placed in the line box after the last
813-
<a>soft wrap opportunity</a> (see [[!CSS-TEXT-3]])
814-
that would still allow the entire <a>block overflow ellipsis</a> to fit on the line,
815-
applying [[css-text-4#white-space-rules]] including [[css-text-4#white-space-phase-2]]
816-
before inserting the [=block overflow ellipsis=].
817-
For this purpose, <a>soft wrap opportunities</a> added by 'overflow-wrap' are ignored,
818-
as are those inhibited by ''text-wrap-mode: nowrap''.
819-
If this results in the entire contents of the line box being displaced,
820-
the line box is considered to contain a [=strut=], as defined in [[CSS2/visudet#leading]].
821-
Text <a href="https://www.w3.org/TR/css-text-3/#justification">alignment and justification</a>
822-
occurs after placement,
823-
and measures the inserted <a>block overflow ellipsis</a>
824-
together with the rest of the line’s content.
825808

826809
<wpt>
827-
block-ellipsis-001.html
828-
block-ellipsis-002.html
829-
block-ellipsis-003.html
830-
block-ellipsis-004.html
831-
block-ellipsis-005.html
832-
block-ellipsis-006.html
833-
block-ellipsis-010.html
834-
block-ellipsis-013.html
835-
block-ellipsis-014.html
836-
block-ellipsis-015.tentative.html
837-
block-ellipsis-016.html
838-
block-ellipsis-017.html
839-
block-ellipsis-018.html
840810
block-ellipsis-023.html
841811
block-ellipsis-024.html
842-
block-ellipsis-025.html
843-
block-ellipsis-026.html
844-
block-ellipsis-027.html
845-
block-ellipsis-028.html
812+
block-ellipsis-repaint-001.html
846813
block-ellipsis-repaint-003.html
847814
block-ellipsis-repaint-004.html
848-
block-ellipsis-repaint-001.html
849-
webkit-line-clamp-014.html
850-
webkit-line-clamp-025.html
851-
webkit-line-clamp-032.html
852-
webkit-line-clamp-035.html
815+
</wpt>
816+
817+
More specifically:
818+
* The [=block overflow ellipsis=]
819+
is wrapped in an anonymous inline
820+
whose parent is the [=block container=]’s [=root inline box=].
821+
This inline is assigned ''unicode-bidi: plaintext''
822+
and ''line-height: 0''.
823+
824+
<wpt>
825+
block-ellipsis-002.html
826+
block-ellipsis-003.html
827+
block-ellipsis-004.html
828+
block-ellipsis-005.html
829+
block-ellipsis-006.html
830+
block-ellipsis-010.html
831+
</wpt>
832+
833+
* The user agent makes room as necessary of the [=block overflow ellipsis=]
834+
by displacing content from the end of the line as if wrapping,
835+
until the last <a>soft wrap opportunity</a> (see [[!CSS-TEXT-3]])
836+
that would still allow the entire <a>block overflow ellipsis</a> to fit on the line,
837+
applying [[css-text-4#white-space-rules]] including [[css-text-4#white-space-phase-2]]
838+
before insertion.
839+
840+
<wpt>
841+
block-ellipsis-001.html
842+
block-ellipsis-028.html
843+
webkit-line-clamp-025.html
844+
</wpt>
845+
846+
For this purpose, <a>soft wrap opportunities</a> added by 'overflow-wrap' are ignored,
847+
as are those inhibited by ''text-wrap-mode: nowrap''.
848+
849+
<wpt>
850+
block-ellipsis-013.html
851+
block-ellipsis-014.html
852+
block-ellipsis-015.tentative.html
853+
block-ellipsis-016.html
854+
block-ellipsis-017.html
855+
block-ellipsis-027.html
856+
</wpt>
857+
858+
If this results in the entire contents of the line box being displaced,
859+
the line box is considered to contain a [=strut=], as defined in [[CSS2/visudet#leading]].
860+
861+
<wpt>
862+
block-ellipsis-016.html
863+
block-ellipsis-018.html
864+
block-ellipsis-025.html
865+
</wpt>
866+
867+
* The anonymous inline of [=block overflow ellipsis=] is placed
868+
after any remaining content,
869+
after [[css-text-4#white-space-phase-2]],
870+
as a direct child of the <a>block container</a>’s <a>root inline box</a>,
871+
with the appropriate bidi embedding levels
872+
given its directionality
873+
and that of its parent.
874+
875+
<wpt>
876+
block-ellipsis-004.html
877+
block-ellipsis-005.html
878+
block-ellipsis-006.html
879+
block-ellipsis-026.html
880+
webkit-line-clamp-014.html
881+
webkit-line-clamp-032.html
882+
webkit-line-clamp-035.html
883+
</wpt>
884+
885+
Text <a href="https://www.w3.org/TR/css-text-3/#justification">alignment and justification</a>
886+
occurs after placement,
887+
and measures the inserted <a>block overflow ellipsis</a>
888+
together with the rest of the line’s content.
889+
890+
<wpt>
853891
webkit-line-clamp-051.html
854892
webkit-line-clamp-052.html
855893
webkit-line-clamp-053.html

0 commit comments

Comments
 (0)