chromium/third_party/blink/renderer/core/intersection_observer/intersection_observer.cc

// Copyright 2016 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/intersection_observer/intersection_observer.h"

#include <algorithm>
#include <limits>

#include "base/numerics/clamped_math.h"
#include "base/time/time.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_callback.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_init.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_document_element.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_double_doublesequence.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_token_range.h"
#include "third_party/blink/renderer/core/css/parser/css_tokenizer.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_delegate.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_entry.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/timing/dom_window_performance.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/timer.h"

namespace blink {

namespace {

// Internal implementation of IntersectionObserverDelegate when using
// IntersectionObserver with an EventCallback.
class IntersectionObserverDelegateImpl final
    : public IntersectionObserverDelegate {};

void ParseMargin(const String& margin_parameter,
                 Vector<Length>& margin,
                 ExceptionState& exception_state,
                 const String& marginName) {}

void ParseThresholds(
    const V8UnionDoubleOrDoubleSequence* threshold_parameter,
    Vector<float>& thresholds,
    ExceptionState& exception_state) {}

// Returns a Vector of 4 margins (top, right, bottom, left) following
// https://drafts.csswg.org/css-box-4/#margin-shorthand
Vector<Length> NormalizeMargins(const Vector<Length>& margins) {}

Vector<Length> NormalizeScrollMargins(const Vector<Length>& margins) {}

String StringifyMargin(const Vector<Length>& margin) {}

}  // anonymous namespace

static bool throttle_delay_enabled =;

void IntersectionObserver::SetThrottleDelayEnabledForTesting(bool enabled) {}

IntersectionObserver* IntersectionObserver::Create(
    const IntersectionObserverInit* observer_init,
    IntersectionObserverDelegate& delegate,
    std::optional<LocalFrameUkmAggregator::MetricId> ukm_metric_id,
    ExceptionState& exception_state) {}

IntersectionObserver* IntersectionObserver::Create(
    ScriptState* script_state,
    V8IntersectionObserverCallback* callback,
    const IntersectionObserverInit* observer_init,
    ExceptionState& exception_state) {}

IntersectionObserver* IntersectionObserver::Create(
    const Document& document,
    EventCallback callback,
    std::optional<LocalFrameUkmAggregator::MetricId> ukm_metric_id,
    Params&& params) {}

IntersectionObserver::IntersectionObserver(
    IntersectionObserverDelegate& delegate,
    std::optional<LocalFrameUkmAggregator::MetricId> ukm_metric_id,
    Params&& params)
    :{}

void IntersectionObserver::ProcessCustomWeakness(const LivenessBroker& info) {}

bool IntersectionObserver::RootIsValid() const {}

void IntersectionObserver::InvalidateCachedRects() {}

void IntersectionObserver::observe(Element* target,
                                   ExceptionState& exception_state) {}

void IntersectionObserver::unobserve(Element* target,
                                     ExceptionState& exception_state) {}

void IntersectionObserver::disconnect(ExceptionState& exception_state) {}

HeapVector<Member<IntersectionObserverEntry>> IntersectionObserver::takeRecords(
    ExceptionState& exception_state) {}

String IntersectionObserver::rootMargin() const {}

String IntersectionObserver::scrollMargin() const {}

base::TimeDelta IntersectionObserver::GetEffectiveDelay() const {}

int64_t IntersectionObserver::ComputeIntersections(
    unsigned flags,
    ComputeIntersectionsContext& context) {}

bool IntersectionObserver::IsInternal() const {}

void IntersectionObserver::ReportUpdates(IntersectionObservation& observation) {}

IntersectionObserver::DeliveryBehavior
IntersectionObserver::GetDeliveryBehavior() const {}

void IntersectionObserver::Deliver() {}

bool IntersectionObserver::HasPendingActivity() const {}

void IntersectionObserver::Trace(Visitor* visitor) const {}

}  // namespace blink