Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6bea8210e2b59ee2e34de9cc7d860677cb6086ee
      
https://github.com/WebKit/WebKit/commit/6bea8210e2b59ee2e34de9cc7d860677cb6086ee
  Author: Antti Koivisto <[email protected]>
  Date:   2025-06-09 (Mon, 09 Jun 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/popover-implicit-anchor-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/popover-implicit-anchor.html
    M Source/WebCore/dom/Element.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/StyleAdjuster.cpp

  Log Message:
  -----------
  [popover] Integrate with anchor positioning
https://bugs.webkit.org/show_bug.cgi?id=284226
rdar://141094328

Reviewed by Alan Baradlay and Tim Nguyen.

See https://github.com/whatwg/html/pull/10728.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/popover-implicit-anchor-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/popover-implicit-anchor.html:

Test against the actual button position so button margins from appearance don't 
affect the results.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setInvokedPopover):

Invalidate the element style so the we update the isPopoverInvoker style bit.

* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::isPopoverInvoker const):
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::setIsPopoverInvoker):

Add a bit. We use it to determine of a box is an implicit anchor.
Making this a style bit allows anchor registration and updates work correctly
without any new mechanisms.

* 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::findImplicitAnchor):

The implicit anchor for a popover is its invoker.
Factor into a function.

(WebCore::Style::findLastAcceptableAnchorWithName):
(WebCore::Style::AnchorPositionEvaluator::findAnchorsForAnchorPositionedElement):
(WebCore::Style::AnchorPositionEvaluator::isAnchor):
(WebCore::Style::AnchorPositionEvaluator::isImplicitAnchor):

A popover invoker is an implicit anchor.
Factor into a function.

* Source/WebCore/style/AnchorPositionEvaluator.h:
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):

Set isPopoverInvoker bit for invokers.

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