#include "third_party/blink/renderer/core/layout/scroll_anchor.h"
#include <algorithm>
#include <memory>
#include "base/trace_event/typed_macros.h"
#include "third_party/blink/renderer/core/css/css_markup.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/nth_index_cache.h"
#include "third_party/blink/renderer/core/dom/static_node_list.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/root_frame_viewport.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/bloom_filter.h"
namespace blink {
namespace {
bool IsNGBlockFragmentationRoot(const LayoutBlockFlow* block_flow) { … }
}
ClassnameFilter;
Corner;
ScrollAnchor::ScrollAnchor()
: … { … }
ScrollAnchor::ScrollAnchor(ScrollableArea* scroller) : … { … }
ScrollAnchor::~ScrollAnchor() = default;
void ScrollAnchor::Trace(Visitor* visitor) const { … }
void ScrollAnchor::SetScroller(ScrollableArea* scroller) { … }
static LayoutBox* ScrollerLayoutBox(const ScrollableArea* scroller) { … }
static Corner CornerToAnchor(const ScrollableArea* scroller) { … }
static PhysicalOffset CornerPointOfRect(const PhysicalRect& rect,
Corner which_corner) { … }
static PhysicalRect RelativeBounds(const LayoutObject* layout_object,
const ScrollableArea* scroller) { … }
static LayoutPoint ComputeRelativeOffset(const LayoutObject* layout_object,
const ScrollableArea* scroller,
Corner corner) { … }
static bool CandidateMayMoveWithScroller(const LayoutObject* candidate,
const ScrollableArea* scroller) { … }
static bool IsOnlySiblingWithTagName(Element* element) { … }
static const AtomicString UniqueClassnameAmongSiblings(Element* element) { … }
static const String UniqueSimpleSelectorAmongSiblings(Element* element) { … }
static const String ComputeUniqueSelector(Node* anchor_node) { … }
static PhysicalRect GetVisibleRect(ScrollableArea* scroller) { … }
ScrollAnchor::ExamineResult ScrollAnchor::Examine(
const LayoutObject* candidate) const { … }
void ScrollAnchor::FindAnchor() { … }
bool ScrollAnchor::FindAnchorInPriorityCandidates() { … }
LayoutObject* ScrollAnchor::PriorityCandidateFromNode(const Node* node) const { … }
ScrollAnchor::ExamineResult ScrollAnchor::ExaminePriorityCandidate(
const LayoutObject* candidate) const { … }
ScrollAnchor::WalkStatus ScrollAnchor::FindAnchorRecursive(
LayoutObject* candidate) { … }
ScrollAnchor::WalkStatus ScrollAnchor::FindAnchorInOOFs(
LayoutObject* candidate) { … }
bool ScrollAnchor::ComputeScrollAnchorDisablingStyleChanged() { … }
void ScrollAnchor::NotifyBeforeLayout() { … }
gfx::Vector2d ScrollAnchor::ComputeAdjustment() const { … }
void ScrollAnchor::Adjust() { … }
bool ScrollAnchor::RestoreAnchor(const SerializedAnchor& serialized_anchor) { … }
const SerializedAnchor ScrollAnchor::GetSerializedAnchor() { … }
void ScrollAnchor::ClearSelf() { … }
void ScrollAnchor::Dispose() { … }
void ScrollAnchor::Clear() { … }
bool ScrollAnchor::RefersTo(const LayoutObject* layout_object) const { … }
void ScrollAnchor::NotifyRemoved(LayoutObject* layout_object) { … }
}