Skip to content

Commit

Permalink
Bug 1925134 [wpt PR 48655] - [text-decoration] Fix crashes for multil…
Browse files Browse the repository at this point in the history
…ine ellipsis with `::first-line`, a=testonly

Automatic update from web-platform-tests
[text-decoration] Fix crashes for multiline ellipsis with `::first-line`

The ellipsis should be styled according to the block[1]. It
was using the first-line style of the block, because it's the
common case, and it's the same style unless `::first-line` is
applied.

This patch changes it to distinguish ellipsis on the first
line from other cases.

Wrong style can cause wrong rendering, but when
`text-decoration` is involved, it can confuse decoration box
calculation and result in crashes. This patch fixes both the
crashes and the correctness.

[1] https://www.w3.org/TR/css-overflow-3/#ellipsing-details

Fixed: 358957652
Change-Id: I26af0ae034876bdc0b0cc114670c52d24e2f36a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5936973
Commit-Queue: Kent Tamura <tkentchromium.org>
Auto-Submit: Koji Ishii <kojiichromium.org>
Reviewed-by: Kent Tamura <tkentchromium.org>
Cr-Commit-Position: refs/heads/main{#1369664}

--

wpt-commits: 1c795222d59595eadcd348faf86334ae6877224c
wpt-pr: 48655

UltraBlame original commit: 0b00916015c0f7f22be9ad761d572057db9b02fc
  • Loading branch information
marco-c committed Oct 22, 2024
1 parent 1a058f5 commit 55597c2
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<
!
DOCTYPE
html
>
<
style
>
div
{
width
:
5ch
;
overflow
:
hidden
;
text
-
overflow
:
ellipsis
;
}
div
:
:
first
-
line
{
text
-
decoration
:
underline
;
}
<
/
style
>
<
div
>
<
br
>
1234567
<
/
div
>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<
!
DOCTYPE
html
>
<
style
>
div
{
width
:
6ch
;
overflow
:
hidden
;
text
-
overflow
:
ellipsis
;
}
div
.
first
-
line
{
color
:
orange
;
}
<
/
style
>
<
div
class
=
"
first
-
line
"
>
1234567
<
/
div
>
<
div
>
1234567
<
/
div
>
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<
!
DOCTYPE
html
>
<
title
>
Test
multiline
ellipsis
with
:
:
first
-
line
<
/
title
>
<
link
rel
=
"
match
"
href
=
"
reference
/
text
-
overflow
-
ellipsis
-
multiline
-
001
-
ref
.
html
"
>
<
link
rel
=
"
help
"
href
=
"
https
:
/
/
drafts
.
csswg
.
org
/
css
-
ui
-
3
/
#
ellipsing
-
details
"
>
<
style
>
div
{
width
:
6ch
;
overflow
:
hidden
;
text
-
overflow
:
ellipsis
;
}
div
:
:
first
-
line
{
color
:
orange
;
}
<
/
style
>
<
div
>
1234567
<
br
>
1234567
<
/
div
>

0 comments on commit 55597c2

Please sign in to comment.