Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 77d492d396f8be3fff8542d95bb8af9eea8358a5
      
https://github.com/WebKit/WebKit/commit/77d492d396f8be3fff8542d95bb8af9eea8358a5
  Author: Megan Gardner <[email protected]>
  Date:   2026-08-11 (Tue, 11 Aug 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/StyledMarkedText.cpp
    M Source/WebCore/rendering/TextBoxPainter.cpp

  Log Message:
  -----------
  [Custom Highlight] -webkit-text-stroke should apply to highlighted text.
https://bugs.webkit.org/show_bug.cgi?id=321341
rdar://184375039

Reviewed by Wenson Hsieh and Antti Koivisto.

The originating element's stroke width leaked into highlighted text, and the
highlight's own stroke was never painted.
Three changes fix it:
1) Mark -webkit-text-stroke-width as applying to highlight pseudo-elements so it
resolves to its initial 0px through the highlight cascade instead of inheriting 
the
element's value
2) Carry the pseudo's stroke width into the marked-text paint style in 
StyledMarkedText
(and propagate stroke width/color through coalesceAdjacentWithSameRanges, which 
dropped
them like it once did text-shadow)
3) Clip a stroked, partially-highlighted segment to its forward edge in 
TextBoxPainter
so a non-highlighted glyph's stroke overflow no longer paints over an adjacent 
highlight's
background.

imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-021.html

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/StyledMarkedText.cpp:
(WebCore::computeStyleForPseudoElementStyle):
(WebCore::resolveStyleForMarkedText):
(WebCore::coalesceAdjacentWithSameRanges):
(WebCore::StyledMarkedText::subdivideAndResolve):
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintForeground):

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



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

Reply via email to