Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d19f4a9df5a6ce6802a25ae028ef2cc86d673ede
      
https://github.com/WebKit/WebKit/commit/d19f4a9df5a6ce6802a25ae028ef2cc86d673ede
  Author: Alexsander Borges Damaceno <abor...@igalia.com>
  Date:   2025-08-15 (Fri, 15 Aug 2025)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/no-anchor-anchor-center-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/no-anchor-anchor-center-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/no-anchor-anchor-center.html
    M Source/WebCore/rendering/PositionedLayoutConstraints.cpp

  Log Message:
  -----------
  [css-anchor-position-1] Wrong anchor-center behavior when target is absolute 
child of fixed element
https://bugs.webkit.org/show_bug.cgi?id=295504

Reviewed by Alan Baradlay.

When anchor-center is used on an anchored element,
the anchor must be in the same containing block as the anchored element in 
order to center element using anchor center position.
If no anchor exists in the containing block, the behavior should fallback to 
justify: center,
as listed in the specifications.

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

"Both elements are in the same top layer and have the same containing block,
 and are both absolutely positioned,
 and possible anchor is earlier in flat tree order than positioned el."

"Both elements are in the same top layer and have the same containing block,
 but possible anchor isn’t absolutely positioned."

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

"If the box is not absolutely positioned,
 or does not have a default anchor box,
 this value behaves as center and has no additional effect on how inset 
properties resolve."

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/no-anchor-anchor-center-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/no-anchor-anchor-center.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/no-anchor-anchor-center-expected.html:
 Added.
* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::resolvePosition const):

Canonical link: https://commits.webkit.org/298766@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to