| Index: third_party/WebKit/Source/core/dom/IntersectionObservation.h
|
| diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.h b/third_party/WebKit/Source/core/dom/IntersectionObservation.h
|
| index cd87187c0a122f10d54e3965ed67354daa40e01e..36177ba112c9a1161dffae01c5b53c065b530ae5 100644
|
| --- a/third_party/WebKit/Source/core/dom/IntersectionObservation.h
|
| +++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.h
|
| @@ -14,12 +14,15 @@ namespace blink {
|
| class Element;
|
| class IntersectionObserver;
|
|
|
| -class IntersectionObservation final
|
| - : public GarbageCollected<IntersectionObservation> {
|
| +class IntersectionObservation
|
| + : public GarbageCollectedFinalized<IntersectionObservation> {
|
| + WTF_MAKE_NONCOPYABLE(IntersectionObservation);
|
| +
|
| public:
|
| IntersectionObservation(IntersectionObserver&,
|
| Element&,
|
| bool shouldReportRootBounds);
|
| + virtual ~IntersectionObservation();
|
|
|
| struct IntersectionGeometry {
|
| LayoutRect targetRect;
|
| @@ -35,12 +38,15 @@ class IntersectionObservation final
|
| unsigned lastThresholdIndex() const { return m_lastThresholdIndex; }
|
| void setLastThresholdIndex(unsigned index) { m_lastThresholdIndex = index; }
|
| bool shouldReportRootBounds() const { return m_shouldReportRootBounds; }
|
| - void computeIntersectionObservations(DOMHighResTimeStamp);
|
| + virtual void computeIntersectionObservations(DOMHighResTimeStamp);
|
| void disconnect();
|
| void clearRootAndRemoveFromTarget();
|
|
|
| DECLARE_TRACE();
|
|
|
| + protected:
|
| + bool computeGeometry(IntersectionGeometry&) const;
|
| +
|
| private:
|
| void applyRootMargin(LayoutRect&) const;
|
| void initializeGeometry(IntersectionGeometry&) const;
|
| @@ -50,7 +56,6 @@ class IntersectionObservation final
|
| void mapTargetRectToTargetFrameCoordinates(LayoutRect&) const;
|
| void mapRootRectToRootFrameCoordinates(LayoutRect&) const;
|
| void mapRootRectToTargetFrameCoordinates(LayoutRect&) const;
|
| - bool computeGeometry(IntersectionGeometry&) const;
|
|
|
| Member<IntersectionObserver> m_observer;
|
|
|
| @@ -60,6 +65,19 @@ class IntersectionObservation final
|
| unsigned m_lastThresholdIndex : 30;
|
| };
|
|
|
| +class ViewportIntersectionObservation final : public IntersectionObservation {
|
| + WTF_MAKE_NONCOPYABLE(ViewportIntersectionObservation);
|
| +
|
| + public:
|
| + ViewportIntersectionObservation(IntersectionObserver&, Element&);
|
| + ~ViewportIntersectionObservation() final;
|
| +
|
| + void computeIntersectionObservations(DOMHighResTimeStamp) final;
|
| +
|
| + private:
|
| + LayoutRect m_lastIntersectRect;
|
| +};
|
| +
|
| } // namespace blink
|
|
|
| #endif // IntersectionObservation_h
|
|
|