Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 77c0588b85e96d2ca07d6e385d6d28f64ac74dd1
      
https://github.com/WebKit/WebKit/commit/77c0588b85e96d2ca07d6e385d6d28f64ac74dd1
  Author: Antti Koivisto <[email protected]>
  Date:   2025-03-10 (Mon, 10 Mar 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-transition-eval-expected.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/rendering/RenderElement.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/StyleRareNonInheritedData.cpp
    M Source/WebCore/rendering/style/StyleRareNonInheritedData.h
    M Source/WebCore/style/AnchorPositionEvaluator.cpp
    M Source/WebCore/style/AnchorPositionEvaluator.h
    M Source/WebCore/style/MatchedDeclarationsCache.cpp
    M Source/WebCore/style/StyleBuilderState.h
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleResolver.h
    M Source/WebCore/style/StyleScope.cpp
    M Source/WebCore/style/StyleScope.h
    M Source/WebCore/style/StyleSharingResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h
    A Source/WebCore/style/TreeResolutionState.h

  Log Message:
  -----------
  [css-anchor-position-1] Move transient anchor positioned state to 
Style::TreeResolver
https://bugs.webkit.org/show_bug.cgi?id=289457
rdar://146646630

Reviewed by Alan Baradlay.

Transient state is only needed during a single style resolution/interleaving 
round.
It shouldn't' be kept around otherwise.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-transition-eval-expected.txt:

The PASSes here were spurious, transitions are not working yet.

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::defaultAnchor const):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::usesAnchorFunctions const):
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::setUsesAnchorFunctions):

Add a style bit for tracking if the style uses anchor functions. These disallow 
caching.

* Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
(WebCore::StyleRareNonInheritedData::dumpDifferences const):
* Source/WebCore/rendering/style/StyleRareNonInheritedData.h:
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::findAnchorForAnchorFunctionAndAttemptResolution):

Access tree resolution scoped state via BuilderState.
Set the anchor function style bit.

(WebCore::Style::AnchorPositionEvaluator::evaluate):
(WebCore::Style::AnchorPositionEvaluator::evaluateSize):
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositioningStatesAfterInterleavedLayout):
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositionedStateForLayoutTimePositioned):
(WebCore::Style::AnchorPositionEvaluator::updateSnapshottedScrollOffsets):
(WebCore::Style::AnchorPositionEvaluator::makeAnchorPositionedForAnchorMap):
(WebCore::Style::AnchorPositionEvaluator::cleanupAnchorPositionedState): 
Deleted.

Nothing to clean up anymore.

* Source/WebCore/style/AnchorPositionEvaluator.h:

The stage is no longer optional<> since the states only exist during style 
resolution.
hasAnchorFunctions bit is replaced by RenderStyle::usesAnchorFunctions.

(): Deleted.
* Source/WebCore/style/MatchedDeclarationsCache.cpp:
(WebCore::Style::MatchedDeclarationsCache::isCacheable):
* Source/WebCore/style/StyleBuilderState.h:
(WebCore::Style::BuilderState::anchorPositionedStates):
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::State::State):
(WebCore::Style::Resolver::State::treeResolutionState):
(WebCore::Style::Resolver::initializeStateAndStyle):
(WebCore::Style::Resolver::builderContext):

Pass the TreeResolutionState via context.

(WebCore::Style::Resolver::styleForKeyframe):
(WebCore::Style::Resolver::styleForPseudoElement):
(WebCore::Style::Resolver::styleForPage):
(WebCore::Style::Resolver::pseudoStyleRulesForElement):
* Source/WebCore/style/StyleResolver.h:
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::invalidateForAnchorDependencies):
(WebCore::Style::Scope::updateAnchorPositioningStateAfterStyleResolution):
(WebCore::Style::Scope::resetAnchorPositioningStateBeforeStyleResolution): 
Deleted.
* Source/WebCore/style/StyleScope.h:

The only persistent state is now the anchored->anchor map.

* Source/WebCore/style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement const):
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::TreeResolver):
(WebCore::Style::TreeResolver::makeResolutionContext):

Pass the TreeResolutionState via context.

(WebCore::Style::TreeResolver::makeResolutionContextForPseudoElement):
(WebCore::Style::TreeResolver::makeResolutionContextForInheritedFirstLine):
(WebCore::Style::TreeResolver::resolveStartingStyle):
(WebCore::Style::TreeResolver::resolveAfterChangeStyleForNonAnimated):
(WebCore::Style::TreeResolver::resolveAgainInDifferentContext):
(WebCore::Style::TreeResolver::applyCascadeAfterAnimation):
(WebCore::Style::TreeResolver::resolve):
(WebCore::Style::TreeResolver::updateAnchorPositioningState):
(WebCore::Style::TreeResolver::generatePositionOptionsIfNeeded):
(WebCore::Style::TreeResolver::tryChoosePositionOption):
(WebCore::Style::TreeResolver::resolveStartingStyle const): Deleted.
(WebCore::Style::TreeResolver::resolveAfterChangeStyleForNonAnimated const): 
Deleted.
(WebCore::Style::TreeResolver::resolveAgainInDifferentContext const): Deleted.
* Source/WebCore/style/StyleTreeResolver.h:
* Source/WebCore/style/TreeResolutionState.h: Added.

Add a struct to hold state that stays current thought a single style resolution 
cycle, including interleaving,
and is passed to the style builder.

For now it only contains the anchor positioned state.

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