Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bba5a8d070c5f6d54de3a1143d894a7b8ba8a3a1
      
https://github.com/WebKit/WebKit/commit/bba5a8d070c5f6d54de3a1143d894a7b8ba8a3a1
  Author: Megan Gardner <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/StyledMarkedText.cpp
    M Source/WebCore/rendering/TextBoxPainter.cpp
    M Source/WebCore/rendering/TextDecorationPainter.cpp
    M Source/WebCore/rendering/TextDecorationPainter.h
    M Source/WebCore/style/InlineTextBoxStyle.cpp
    M Source/WebCore/style/InlineTextBoxStyle.h

  Log Message:
  -----------
  [Custom Highlight] ::highlight() and ::target-text ignore 
text-underline-offset.
https://bugs.webkit.org/show_bug.cgi?id=319645
rdar://182466757

Reviewed by Jessica Cheung.

::highlight() and ::target-text overlays dropped text-underline-offset: unlike 
the decoration's color, style, and thickness, the offset was never carried on
TextDecorationPainter::Styles, so at paint time it was read from the 
originating box's style and the pseudo's value was lost. Carry it as an 
optional override on
the decoration styles — set from the pseudo in 
computeStyleForPseudoElementStyle, propagated through the same-range decoration 
coalesce, and threaded into
underlineOffsetForTextBoxPainting, defaulting to the painting box's own value 
so non-highlighted text is unchanged.

imported/w3c/web-platform-tests/css/css-highlight-api/painting/css-highlight-painting-underline-offset-001.html
imported/w3c/web-platform-tests/css/css-highlight-api/painting/css-target-text-decoration-001.html

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/StyledMarkedText.cpp:
(WebCore::computeStyleForPseudoElementStyle):
(WebCore::computeStylesForTextDecorations):
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackgroundDecorations):
* Source/WebCore/rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::Styles::operator== const):
* Source/WebCore/rendering/TextDecorationPainter.h:
* Source/WebCore/style/InlineTextBoxStyle.cpp:
(WebCore::computedUnderlineOffset):
(WebCore::underlineOffsetForTextBoxPainting):
* Source/WebCore/style/InlineTextBoxStyle.h:

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



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

Reply via email to