| Index: third_party/WebKit/Source/core/dom/IntersectionObserver.h
|
| diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.h b/third_party/WebKit/Source/core/dom/IntersectionObserver.h
|
| index 3281fcea96352ef256fc00bd74383250e40b02ac..12c3104a091ee02eb8533279485fb10b5d87cb18 100644
|
| --- a/third_party/WebKit/Source/core/dom/IntersectionObserver.h
|
| +++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.h
|
| @@ -23,12 +23,14 @@ class LayoutObject;
|
| class IntersectionObserverCallback;
|
| class IntersectionObserverInit;
|
|
|
| -class CORE_EXPORT IntersectionObserver final
|
| +class CORE_EXPORT IntersectionObserver
|
| : public GarbageCollectedFinalized<IntersectionObserver>,
|
| public ScriptWrappable {
|
| DEFINE_WRAPPERTYPEINFO();
|
|
|
| public:
|
| + virtual ~IntersectionObserver();
|
| +
|
| using EventCallback =
|
| Function<void(const HeapVector<Member<IntersectionObserverEntry>>&),
|
| WTF::SameThreadAffinity>;
|
| @@ -45,6 +47,7 @@ class CORE_EXPORT IntersectionObserver final
|
| static IntersectionObserver* create(const IntersectionObserverInit&,
|
| IntersectionObserverCallback&,
|
| ExceptionState&);
|
| + // Observes any changes on intersection rect when |thresholds| is empty.
|
| static IntersectionObserver* create(const Vector<Length>& rootMargin,
|
| const Vector<float>& thresholds,
|
| Document*,
|
| @@ -89,11 +92,15 @@ class CORE_EXPORT IntersectionObserver final
|
|
|
| DECLARE_TRACE();
|
|
|
| + protected:
|
| + virtual IntersectionObservation* createObservation(Element&, bool);
|
| +
|
| + IntersectionObserver(IntersectionObserverCallback&,
|
| + Node&,
|
| + const Vector<Length>& rootMargin,
|
| + const Vector<float>& thresholds);
|
| +
|
| private:
|
| - explicit IntersectionObserver(IntersectionObserverCallback&,
|
| - Node&,
|
| - const Vector<Length>& rootMargin,
|
| - const Vector<float>& thresholds);
|
| void clearWeakMembers(Visitor*);
|
|
|
| Member<IntersectionObserverCallback> m_callback;
|
| @@ -108,6 +115,19 @@ class CORE_EXPORT IntersectionObserver final
|
| InitialState m_initialState;
|
| };
|
|
|
| +class ViewportIntersectionObserver final : public IntersectionObserver {
|
| + WTF_MAKE_NONCOPYABLE(ViewportIntersectionObserver);
|
| +
|
| + public:
|
| + ViewportIntersectionObserver(IntersectionObserverCallback&,
|
| + Node&,
|
| + const Vector<Length>&);
|
| + ~ViewportIntersectionObserver() final;
|
| +
|
| + protected:
|
| + IntersectionObservation* createObservation(Element&, bool) final;
|
| +};
|
| +
|
| } // namespace blink
|
|
|
| #endif // IntersectionObserver_h
|
|
|