Skip to content

Commit 5ac87f0

Browse files
[css-overflow-4] Clarify when block-ellipsis affects a line box (#13525)
As per #12826, this patch clarifies and adds examples for when the `block-ellipsis` property affects a line box. This incorporates an edit suggested by @fantasai in #12825 after that PR had been closed. Co-Authored-By: fantasai <fantasai.bugs@inkedblade.net>
1 parent 0e86827 commit 5ac87f0

File tree

1 file changed

+64
-6
lines changed

1 file changed

+64
-6
lines changed

css-overflow-4/Overview.bs

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -752,12 +752,11 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property</h3>
752752
line-clamp-auto-017.html
753753
</wpt>
754754

755-
Ignoring any intervening [=absolutely positioned=] element
756-
or any element closing boundary,
757-
this property only affects a line box
758-
if it immediately precedes either a [=region break=] or a [=clamp point=],
759-
and the line box is in the same [=independent formatting context=]
760-
as the [=clamp point=] or the [=region break=].
755+
Ignoring any intervening [=absolutely positioned=] elements
756+
or element closing boundaries,
757+
this property affects a line box
758+
that immediately precedes a [=region break=] or a [=clamp point=]
759+
when both participate in the same [=independent formatting context=].
761760

762761
<wpt>
763762
line-clamp-auto-034.html
@@ -768,6 +767,65 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property</h3>
768767

769768
Note: See ''continue: discard'' for a way to generate boxes with such a [=region break=].
770769

770+
<div class=example>
771+
```html
772+
<div style="continue: collapse; block-ellipsis: auto; max-height: 4lh">
773+
<div>
774+
<div>
775+
Line 1 <br>
776+
Line 2 <br>
777+
Line 3 <br>
778+
Line 4
779+
<div class="abspos"></div>
780+
</div>
781+
<div class="abspos"></div>
782+
</div>
783+
<div class="abspos"></div>
784+
<!-- the clamp point is here, not immediately after line 4 -->
785+
Line 5
786+
</div>
787+
```
788+
789+
Here the clamp point is not immediately after a line box,
790+
but the only thing between it and the last line box
791+
are element closing boundaries and abspos,
792+
and both are in the same independent formatting context,
793+
so "Line 4" is ellipsized.
794+
</div>
795+
796+
<div class=example>
797+
Meanwhile, in this example,
798+
there is an in-flow element
799+
between the line box and the clamp point,
800+
so no ellipsis is shown:
801+
802+
```html
803+
<div style="continue: collapse; block-ellipsis: auto; max-lines: 2">
804+
Line 1 <br>
805+
Line 2
806+
<div></div>
807+
<!-- the clamp point is here -->
808+
Line 3
809+
</div>
810+
```
811+
</div>
812+
813+
<div class=example>
814+
In this example,
815+
the last line box is contained
816+
in an [=independent formatting context=],
817+
so no ellipsis will be shown:
818+
819+
```html
820+
<div style="continue: collapse; max-height: 2lh; block-ellipsis: auto">
821+
Line 1
822+
<div style="display: flow-root">Line 2</div>
823+
<!-- the clamp point is here -->
824+
Line 3
825+
</div>
826+
```
827+
</div>
828+
771829
The inserted content is called the <dfn>block overflow ellipsis</dfn>.
772830
Values have the following meanings:
773831

0 commit comments

Comments
 (0)