Bug 1830972 [wpt PR 39784] - Fix `NGInlinePaintContext` for pseudo elements in first...
commite15b90ea7a20547128e11d3bb815f196d108727a
authorKoji Ishii <kojii@chromium.org>
Wed, 17 May 2023 13:12:40 +0000 (17 13:12 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sun, 21 May 2023 22:43:45 +0000 (21 22:43 +0000)
tree318832bdc42dce66a0d9bfb8434f65173df14a70
parent28f93c5a6aaf4a69faef04d91f9a6b81998f5c33
Bug 1830972 [wpt PR 39784] - Fix `NGInlinePaintContext` for pseudo elements in first-line, a=testonly

Automatic update from web-platform-tests
Fix `NGInlinePaintContext` for pseudo elements in first-line

`ComputedStyle::AppliedTextDecorations` is usually one of
following behaviors:
a. No change from parent. Inherit the same data.
b. Add a decoration.
c. Stops propagation, resetting the decorations to 0.
d. c+b, meaning resets and add a decoration.

`NGInlinePaintContext` computes decorating boxes from
`ComputedStyle::AppliedTextDecorations` from the assumptions
above.

However, pseudo elements don't have first-line styles, and
that when they appear in the first-line, `NGInlinePaintContext`
fails to compute decorating boxes. This patch fixes it not to
crash in such a situation.

Fixed: 1440213
Change-Id: I9054576bf8db9403d849446f8c48a1f871ea8649
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4493872
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Auto-Submit: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1138023}

--

wpt-commits: 56c92da13df628f1b7f70cd68a8ffc5bc877bebb
wpt-pr: 39784
testing/web-platform/tests/css/css-text-decor/crashtests/text-decoration-on-pseudo-first-line-crash.html [new file with mode: 0644]