chromium/third_party/blink/renderer/core/layout/scroll_anchor.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

}  // anonymous namespace

// With 100 unique strings, a 2^12 slot table has a false positive rate of ~2%.
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) {}

// TODO(skobes): Storing a "corner" doesn't make much sense anymore since we
// adjust only on the block flow axis.  This could probably be refactored to
// simply measure the movement of the block-start edge.
static Corner CornerToAnchor(const ScrollableArea* scroller) {}

static PhysicalOffset CornerPointOfRect(const PhysicalRect& rect,
                                        Corner which_corner) {}

// Bounds of the LayoutObject relative to the scroller's visible content rect.
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) {}

// Calculate a simple selector for |element| that uniquely identifies it among
// its siblings. If present, the element's id will be used; otherwise, less
// specific selectors are preferred to more specific ones. The ordering of
// selector preference is:
// 1. ID
// 2. Tag name
// 3. Class name
// 4. nth-child
static const String UniqueSimpleSelectorAmongSiblings(Element* element) {}

// Computes a selector that uniquely identifies |anchor_node|. This is done
// by computing a selector that uniquely identifies each ancestor among its
// sibling elements, terminating at a definitively unique ancestor. The
// definitively unique ancestor is either the first ancestor with an id or
// the root of the document. The computed selectors are chained together with
// the child combinator(>) to produce a compound selector that is
// effectively a path through the DOM tree to |anchor_node|.
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) {}

}  // namespace blink