Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5948edcfa511091cc874eac3558f3b047e251254
      
https://github.com/WebKit/WebKit/commit/5948edcfa511091cc874eac3558f3b047e251254
  Author: Antti Koivisto <[email protected]>
  Date:   2025-03-13 (Thu, 13 Mar 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-order-basic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-order-position-area-expected.txt
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/rendering/PositionedLayoutConstraints.cpp
    M Source/WebCore/rendering/PositionedLayoutConstraints.h
    M Source/WebCore/rendering/RenderBox.cpp
    A Source/WebCore/rendering/style/PositionTryOrder.cpp
    A Source/WebCore/rendering/style/PositionTryOrder.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/style/AnchorPositionEvaluator.cpp
    M Source/WebCore/style/AnchorPositionEvaluator.h
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h

  Log Message:
  -----------
  [css-anchor-position-1] Sort position options based on position-try-order
https://bugs.webkit.org/show_bug.cgi?id=289701
rdar://146947787

Reviewed by Alan Baradlay.

"For each entry in the position options list, apply that position option to the 
box, and find
the specified inset-modified containing block size that results from those 
styles. Stably sort
the position options list according to this size, with the largest coming 
first."

https://drafts.csswg.org/css-anchor-position-1/#position-try-order-property

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-order-basic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-order-position-area-expected.txt:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::PositionedLayoutConstraints):

Add a constructor that takes style separely so we can try effects of different 
styles.
Resolve container locally instead of passing it in.
Resolve static positions locally instead of requiring caller to do it.

* Source/WebCore/rendering/PositionedLayoutConstraints.h:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::RenderBox::computePositionedLogicalHeight const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
* Source/WebCore/rendering/style/PositionTryOrder.cpp: Added.
(WebCore::Style::boxAxisForPositionTryOrder):
(WebCore::Style::operator<<):
* Source/WebCore/rendering/style/PositionTryOrder.h: Added.

Move to a file of its own.

* Source/WebCore/rendering/style/RenderStyleInlines.h:
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositioningStatesAfterInterleavedLayout):

Update the global anchor map immediately instead of waiting until the end of 
style resolution.
This way the achor mappings are available during the style resolution already.

(WebCore::Style::operator<<): Deleted.
* Source/WebCore/style/AnchorPositionEvaluator.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolve):
(WebCore::Style::TreeResolver::generatePositionOptionsIfNeeded):
(WebCore::Style::TreeResolver::sortPositionOptionsIfNeeded):

Use PositionedLayoutConstraints to figure out the inset modified containing 
block size for
a given position option style. Sort based on the size on desired axis.

(WebCore::Style::TreeResolver::tryChoosePositionOption):
* Source/WebCore/style/StyleTreeResolver.h:

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