Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cd3003ccda41c24e8dafffe9cbbeee04f8556c6b
      
https://github.com/WebKit/WebKit/commit/cd3003ccda41c24e8dafffe9cbbeee04f8556c6b
  Author: Kiet Ho <kiet...@apple.com>
  Date:   2025-08-11 (Mon, 11 Aug 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-backdrop-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-pseudo-element-expected.txt
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h

  Log Message:
  -----------
  [css-anchor-position-1] Implement position-try for pseudo-elements
rdar://156550553
https://bugs.webkit.org/show_bug.cgi?id=296410

Reviewed by Antti Koivisto.

Implement position-try for pseudo elements. This involves changing the
position-try code to use AnchorPositionedKey to uniquely identify the
pseudo-element, and adding code to generate and try position-try options
for pseudo-elements. Currently, only ::before/::after/::backdrops are
supported; they're covered by WPT tests and can be tested.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-backdrop-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-pseudo-element-expected.txt:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
   - Pipe the existing pseudo-element styles to 
TreeResolver::resolvePseudoElement

(WebCore::Style::TreeResolver::resolvePseudoElement):
    - Add a new parameter for the existing style of the pseudo-element.
    - Generate and try position-try options if the pseudo-element is 
::before/::after/::backdrop

(WebCore::Style::TreeResolver::resolve):
    - Change the loop through m_positionOptions to accommodate the new key type.

(WebCore::Style::TreeResolver::generatePositionOptionsIfNeeded):
    - Use AnchorPositionedKey as the key of the the generated position option.

(WebCore::Style::TreeResolver::tryChoosePositionOption):
    - Use AnchorPositionedKey to lookup the generated position option.

* Source/WebCore/style/StyleTreeResolver.h:
    - m_positionOptions is now keyed by AnchorPositionedKey to support
      storing position-try options for pseudo-elements.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to