Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6e9d0ba57bf4b0fa5c839e44e3af3140c6e8b4b6
      
https://github.com/WebKit/WebKit/commit/6e9d0ba57bf4b0fa5c839e44e3af3140c6e8b4b6
  Author: Antti Koivisto <[email protected]>
  Date:   2025-05-23 (Fri, 23 May 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-update-005.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-update-006.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/parsing/position-visibility-computed-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/parsing/position-visibility-computed.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-initial-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-initial-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-initial.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-remove-anchors-visible.html
    M Source/WebCore/rendering/PositionedLayoutConstraints.cpp
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderElement.h
    M Source/WebCore/rendering/RenderLayerScrollableArea.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/rendering/style/RenderStyleSetters.h
    M Source/WebCore/rendering/style/StyleRareInheritedData.cpp
    M Source/WebCore/rendering/style/StyleRareInheritedData.h
    M Source/WebCore/style/AnchorPositionEvaluator.cpp
    M Source/WebCore/style/AnchorPositionEvaluator.h
    M Source/WebCore/style/StyleScope.cpp
    M Source/WebCore/style/StyleScope.h
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h

  Log Message:
  -----------
  [css-anchor-position-1] Implement position-visibility:anchors-visible
https://bugs.webkit.org/show_bug.cgi?id=293421
rdar://151846285

Reviewed by Alan Baradlay.

https://drafts.csswg.org/css-anchor-position-1/#position-visibility

This is the initial value so the expected default behavior.

The implementation is in terms of an internal isForceHidden property rather 
than implementing the newly-specced
`visibility:force-hidden` value.

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-update-005.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-update-006.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/parsing/position-visibility-computed-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/parsing/position-visibility-computed.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-initial-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-initial-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-initial.html:
 Copied from 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-remove-anchors-visible.html.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-remove-anchors-visible.html:

Update the WPTs to match the current spec where `anchors-visible` is the 
initial value.

* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::PositionedLayoutConstraints):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::defaultAnchorRenderer const):
* Source/WebCore/rendering/RenderElement.h:

Call the new AnchorPositionEvaluator::updateAfterOverflowScroll function.

* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::isForceHidden const):
(WebCore::RenderStyle::usedVisibility const):
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::setIsForceHidden):
* Source/WebCore/rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
(WebCore::StyleRareInheritedData::dumpDifferences const):
* Source/WebCore/rendering/style/StyleRareInheritedData.h:
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::updateAfterOverflowScroll):

Take care to invalidate the style for anchored boxes moved due to scrolling so 
we recheck their visibility.

(WebCore::Style::AnchorPositionEvaluator::isDefaultAnchorInvisibleOrClippedByInterveningBoxes):
* Source/WebCore/style/AnchorPositionEvaluator.h:
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::invalidateForAnchorDependencies):

We need to invalidate the style even for layout-time positioned as an anchor 
moving may make
it invisible, affecting style.

* Source/WebCore/style/StyleScope.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::updateForPositionVisibility):

Test if the anchor is invisible and set isForceHidden bit for the anchored 
style if needed.

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

Add a helper.

* Source/WebCore/style/StyleTreeResolver.h:

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