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

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-area-pseudo-element-implicit-anchor-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-area-pseudo-element-implicit-anchor.html
    M Source/WebCore/rendering/PositionedLayoutConstraints.cpp
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderElement.h
    M Source/WebCore/style/AnchorPositionEvaluator.cpp
    M Source/WebCore/style/AnchorPositionEvaluator.h
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  [css-anchor-position-1] Support implicit anchor element for pseudo-elements 
with position-area
https://bugs.webkit.org/show_bug.cgi?id=294112
rdar://problem/152707685

Reviewed by Alan Baradlay.

Support ::before/::after with implicit anchor and layout time positioning 
(position-area/anchor-center).

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-area-pseudo-element-implicit-anchor-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-area-pseudo-element-implicit-anchor.html:
 Added.
* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::PositionedLayoutConstraints):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::defaultAnchor const): Deleted.
(WebCore::RenderElement::defaultAnchorRenderer const): Deleted.

Move default anchor finding code to AnchorPositionEvaluator.

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

Save the resolved anchor names to anchorPositionedToAnchorMap along with the 
anchor box so we can find the implicit anchor easily.

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

Implicit layout-time positioned don't specify position-anchor, so test for 
positioning properties also.

(WebCore::Style::AnchorPositionEvaluator::updateSnapshottedScrollOffsets):
(WebCore::Style::AnchorPositionEvaluator::makeAnchorPositionedForAnchorMap):
(WebCore::Style::AnchorPositionEvaluator::isDefaultAnchorInvisibleOrClippedByInterveningBoxes):
(WebCore::Style::AnchorPositionEvaluator::defaultAnchorName):

Helper to get the name of the default anchor.

(WebCore::Style::AnchorPositionEvaluator::defaultAnchorForBox):

Move the code from RenderElement::defaultAnchor and test the names saved in the 
anchorPositionedToAnchorMap.

* Source/WebCore/style/AnchorPositionEvaluator.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::updateAnchorPositioningState):

Also upadate the state for pseudo elements.

Canonical link: https://commits.webkit.org/295913@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