Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e7804dbd6d4128ea5a9795bb7e7d4056fa7bd065
      
https://github.com/WebKit/WebKit/commit/e7804dbd6d4128ea5a9795bb7e7d4056fa7bd065
  Author: Antti Koivisto <[email protected]>
  Date:   2025-06-02 (Mon, 02 Jun 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-function-pseudo-element-basic-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-function-pseudo-element-basic.html
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
    M Source/WebCore/style/AnchorPositionEvaluator.cpp
    M Source/WebCore/style/AnchorPositionEvaluator.h
    M Source/WebCore/style/StyleBuilderState.cpp
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h
    M Source/WebCore/style/Styleable.cpp

  Log Message:
  -----------
  [css-anchor-position-1] Support ::before and ::after as anchor-positioned 
elements
https://bugs.webkit.org/show_bug.cgi?id=293625
rdar://152097389

Reviewed by Alan Baradlay.

Basic support for ::before and ::after (but not ::marker).

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-function-pseudo-element-basic-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-function-pseudo-element-basic.html:
 Added.

Add a test. There were none.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::pseudoElementIfExists):
(WebCore::Element::pseudoElementIfExists const):

Add helpers.

* Source/WebCore/dom/Element.h:
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCachedPseudoStyle):
(WebCore::RenderStyle::pseudoElementIdentifier const):

Add a helper to move towards using PseudoElementIdentifier everywhere instead 
of PseudoId.

* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::pseudoStyleCacheIsInvalid):

Use the helper.

* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::findAnchorForAnchorFunctionAndAttemptResolution):

Use host/PseudoElementIdentifier pair as the state map key.

(WebCore::Style::AnchorPositionEvaluator::evaluate):
(WebCore::Style::AnchorPositionEvaluator::evaluateSize):
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositioningStatesAfterInterleavedLayout):
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositionedStateForLayoutTimePositioned):

Adopt host/PseudoElementIdentifier key pair.

(WebCore::Style::AnchorPositionEvaluator::anchorPositionedElementOrPseudoElement):
(WebCore::Style::AnchorPositionEvaluator::keyForElementOrPseudoElement):

Add some helpers.

* Source/WebCore/style/AnchorPositionEvaluator.h:
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::lookupCSSRandomBaseValue const):

Use Style::pseudoElementIdentifier helper.

* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForKeyframe):
(WebCore::Style::Resolver::styleForPseudoElement):

Pass the tree resolution state for pseudo elements too.

* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::resolve):
(WebCore::Style::TreeResolver::updateAnchorPositioningState):
(WebCore::Style::TreeResolver::generatePositionOptionsIfNeeded):

Adopt host/PseudoElementIdentifier key pair.

(WebCore::Style::TreeResolver::tryChoosePositionOption):
(WebCore::Style::TreeResolver::updateForPositionVisibility):
(WebCore::Style::TreeResolver::hasUnresolvedAnchorPosition const):
(WebCore::Style::TreeResolver::hasResolvedAnchorPosition const):

Use Styleable as argument instead of Element.

* Source/WebCore/style/StyleTreeResolver.h:
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::fromRenderer):

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



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

Reply via email to