Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ab4c4fa09297fe7235691935319b87e48c6d24e1
      
https://github.com/WebKit/WebKit/commit/ab4c4fa09297fe7235691935319b87e48c6d24e1
  Author: Vitor Roriz <[email protected]>
  Date:   2026-10-13 (Tue, 13 Oct 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-anonymous-block-001-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-anonymous-block-001-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-anonymous-block-001.html
    M Source/WebCore/rendering/MarkedText.cpp
    M Source/WebCore/rendering/StyledMarkedText.cpp

  Log Message:
  -----------
  MarkedText::collectForHighlights: Find ::highlight() style past anonymous 
boxes
https://bugs.webkit.org/show_bug.cgi?id=290307
rdar://148245032

Reviewed by Megan Gardner.

Text that is a sibling of a block-level child sits in an anonymous block.
collectForHighlights and resolveStyleForMarkedText asked that anonymous parent
for the ::highlight() style, which is always null, so nothing was painted.
Therefore ask the RenderText itself. RenderText::lazyPseudoElementStyle climbs
to firstNonAnonymousAncestor(), as ::selection already does since
https://commits.webkit.org/225117@main

This keeps the render tree parent lookup for non-anonymous parents from
https://commits.webkit.org/232915@main and the style caching from
https://commits.webkit.org/319169@main, since the RenderText overload forwards
to the same cached lookup.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-anonymous-block-001-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-anonymous-block-001-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-anonymous-block-001.html:
 Added.
* Source/WebCore/rendering/MarkedText.cpp:
(WebCore::MarkedText::collectForHighlights):
* Source/WebCore/rendering/StyledMarkedText.cpp:
(WebCore::resolveStyleForMarkedText):

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



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

Reply via email to