Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 40f72ef0f26d5feb9275628b6bb5dd076bf1c13b
      
https://github.com/WebKit/WebKit/commit/40f72ef0f26d5feb9275628b6bb5dd076bf1c13b
  Author: Alan Baradlay <[email protected]>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-linethrough-block-001-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-linethrough-block-001-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-linethrough-block-001.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-overline-block-001-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-overline-block-001-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-overline-block-001.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/text-shadow-sideways-001-expected.html
    M Source/WebCore/rendering/StyledMarkedText.cpp
    M Source/WebCore/rendering/TextBoxPainter.cpp
    M Source/WebCore/rendering/TextDecorationPainter.cpp
    M Source/WebCore/rendering/TextDecorationPainter.h

  Log Message:
  -----------
  Text decoration is too thin over a descendant block
https://bugs.webkit.org/show_bug.cgi?id=257992

Reviewed by Elika Etemad.

  <div style="text-decoration: underline; text-decoration-thickness: 5px; 
text-decoration-color: red">
    before<div>inside</div>after
  </div>

The underline under "inside" should be 5px thick, the same as under "before" and
"after". Instead it was a thin auto line: the nested block painted the underline
with its own text-decoration-thickness rather than the div that set the 
underline.

Line decorations propagate down the render tree, but at paint time the 
thickness was
read from the box the line was drawn over - here the nested block, whose
text-decoration-thickness is auto - not from the box that originated the
decoration. The color was already resolved from the originating box, which is 
why
only the thickness came out wrong.

The thickness is now resolved next to the color in collectStylesForRenderer, 
taken
from the box that originated each decoration, and the painter reads that 
per-line
thickness instead of the decorating box's style. This also corrects overline and
line-through propagated across block boundaries.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-linethrough-block-001-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-linethrough-block-001-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-linethrough-block-001.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-overline-block-001-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-overline-block-001-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-overline-block-001.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/text-shadow-sideways-001-expected.html:
* Source/WebCore/rendering/StyledMarkedText.cpp:
(WebCore::computeStyleForPseudoElementStyle):
(WebCore::computeStylesForTextDecorations):
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::computedAutoTextDecorationThickness):
(WebCore::resolveTextDecorationThicknessForPaintingBox):
(WebCore::TextBoxPainter::paintBackgroundDecorations):
(WebCore::TextBoxPainter::paintForegroundDecorations):
(WebCore::computedTextDecorationThickness): Deleted.
* Source/WebCore/rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::Styles::operator== const):
(WebCore::collectStylesForRenderer):
* Source/WebCore/rendering/TextDecorationPainter.h:

Canonical link: https://commits.webkit.org/314502@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to