Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f205117295d5ce8eabd95aec9981b3fb1e439334
      
https://github.com/WebKit/WebKit/commit/f205117295d5ce8eabd95aec9981b3fb1e439334
  Author: Kiet Ho <[email protected]>
  Date:   2025-05-27 (Tue, 27 May 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-in-shadow-002-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-in-shadow-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-transition-002-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-transition-003-expected.txt
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/style/AnchorPositionEvaluator.cpp
    M Source/WebCore/style/AnchorPositionEvaluator.h
    A Source/WebCore/style/ResolvedScopedName.cpp
    A Source/WebCore/style/ResolvedScopedName.h
    M Source/WebCore/style/StyleScope.cpp
    M Source/WebCore/style/StyleScope.h
    A Source/WebCore/style/StyleScopeIdentifier.h

  Log Message:
  -----------
  [css-anchor-position-1] Make anchors shadow-DOM-scoped
rdar://151797497
https://bugs.webkit.org/show_bug.cgi?id=293382

Reviewed by Antti Koivisto.

Right now, anchors are uniquely identified by their string identifier,
which is not enough since anchors are scoped to their shadow DOM tree.
This patch introduces ResolvedScopedName, which contains the same info
as a ScopedName, except the scope ordinal has been resolved to the
concrete Style::Scope object. ResolvedScopedName are then used
as unique identifier for anchor names. Code that uses AtomString
to identify anchors now uses ResolvedScopedName instead.

Combined changes:
* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-in-shadow-002-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-in-shadow-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-transition-002-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-transition-003-expected.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::findAnchorForAnchorFunctionAndAttemptResolution):
(WebCore::Style::findLastAcceptableAnchorWithName):
(WebCore::Style::collectAnchorsForAnchorName):
(WebCore::Style::AnchorPositionEvaluator::findAnchorsForAnchorPositionedElement):
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositionedStateForLayoutTimePositioned):
* Source/WebCore/style/AnchorPositionEvaluator.h:
* Source/WebCore/style/ResolvedScopedName.cpp: Added.
(WebCore::Style::ResolvedScopedName::ResolvedScopedName):
(WebCore::Style::ResolvedScopedName::createFromScopedName):
* Source/WebCore/style/ResolvedScopedName.h: Added.
(WebCore::Style::ResolvedScopedName::name const):
(WebCore::Style::ResolvedScopedName::scopeIdentifier const):
(WebCore::Style::add):
(WTF::DefaultHash<WebCore::Style::ResolvedScopedName>::hash):
(WTF::DefaultHash<WebCore::Style::ResolvedScopedName>::equal):
(WTF::HashTraits<WebCore::Style::ResolvedScopedName>::emptyValue):
(WTF::HashTraits<WebCore::Style::ResolvedScopedName>::constructDeletedValue):
(WTF::HashTraits<WebCore::Style::ResolvedScopedName>::isDeletedValue):
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::forOrdinal):
* Source/WebCore/style/StyleScope.h:
* Source/WebCore/style/StyleScopeIdentifier.h: Added.

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