Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f13cf97dc5768aba702ade6543d9a617348dc13d
      
https://github.com/WebKit/WebKit/commit/f13cf97dc5768aba702ade6543d9a617348dc13d
  Author: David Choi <[email protected]>
  Date:   2024-08-16 (Fri, 16 Aug 2024)

  Changed paths:
    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] Refactor style & layout interleaving for anchor 
positioning
https://bugs.webkit.org/show_bug.cgi?id=278218
rdar://134015009

Reviewed by Antti Koivisto.

The current `AnchorPositionedState` uses booleans to represent stages of
the anchor-positioned element resolution process. This uses more space
than necessary while introducing the potential for bugs via inconsistent
combinations of boolean states. This is fixed by introducing an enum
class that represents each stage of the resolution process.

Style::TreeResolver also houses static functions and class methods related
to anchor positioning that really should belong in AnchorPositionEvaluator.
(Hence, this patch moves those methods to AnchorPositionEvaluator.)

A notable functional change introduced by this patch is an explicit
check to make sure that anchor elements have up-to-date RenderTree
information before using them as valid anchor targets.

* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::resolveAnchorValue):
(WebCore::Style::elementIsInContainingBlockChain):
(WebCore::Style::isAcceptableAnchorElement):
(WebCore::Style::findLastAcceptableAnchorWithName):
(WebCore::Style::AnchorPositionEvaluator::findAnchorsForAnchorPositionedElement):
* Source/WebCore/style/AnchorPositionEvaluator.h:
(): Deleted.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolve):
(WebCore::Style::TreeResolver::updateAnchorPositioningState):
(WebCore::Style::TreeResolver::findAnchorsForAnchorPositionedElement): Deleted.
(WebCore::Style::elementIsInContainingBlockChain): Deleted.
(WebCore::Style::TreeResolver::findLastAcceptableAnchorWithName): Deleted.
* Source/WebCore/style/StyleTreeResolver.h:

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