| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IntersectionObserver_h | 5 #ifndef IntersectionObserver_h |
| 6 #define IntersectionObserver_h | 6 #define IntersectionObserver_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/IntersectionObservation.h" | 10 #include "core/dom/IntersectionObservation.h" |
| 11 #include "core/dom/IntersectionObserverEntry.h" | 11 #include "core/dom/IntersectionObserverEntry.h" |
| 12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 13 #include "wtf/HashSet.h" | 13 #include "wtf/HashSet.h" |
| 14 #include "wtf/RefCounted.h" | 14 #include "wtf/RefCounted.h" |
| 15 #include "wtf/Vector.h" | 15 #include "wtf/Vector.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class ExceptionState; | 19 class ExceptionState; |
| 20 class IntersectionObserverCallback; | 20 class IntersectionObserverCallback; |
| 21 class IntersectionObserverInit; | 21 class IntersectionObserverInit; |
| 22 | 22 |
| 23 class IntersectionObserver final : public GarbageCollectedFinalized<Intersection
Observer>, public ScriptWrappable { | 23 class IntersectionObserver final : public GarbageCollectedFinalized<Intersection
Observer>, public ScriptWrappable { |
| 24 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
| 25 | 25 |
| 26 public: | 26 public: |
| 27 static IntersectionObserver* create(const IntersectionObserverInit&, Interse
ctionObserverCallback&, ExceptionState&); | 27 static IntersectionObserver* create(const IntersectionObserverInit&, Interse
ctionObserverCallback&, ExceptionState&); |
| 28 static void resumeSuspendedObservers(); | 28 static void resumeSuspendedObservers(); |
| 29 | 29 |
| 30 virtual ~IntersectionObserver(); |
| 31 |
| 30 // API methods | 32 // API methods |
| 31 void observe(Element*, ExceptionState&); | 33 void observe(Element*, ExceptionState&); |
| 32 void unobserve(Element*, ExceptionState&); | 34 void unobserve(Element*, ExceptionState&); |
| 33 HeapVector<Member<IntersectionObserverEntry>> takeRecords(); | 35 HeapVector<Member<IntersectionObserverEntry>> takeRecords(); |
| 34 | 36 |
| 35 Node* root() const { return m_root.get(); } | 37 Node* root() const { return m_root.get(); } |
| 36 LayoutObject* rootLayoutObject() const; | 38 LayoutObject* rootLayoutObject() const; |
| 37 bool hasPercentMargin() const; | 39 bool hasPercentMargin() const; |
| 38 const Length& topMargin() const { return m_topMargin; } | 40 const Length& topMargin() const { return m_topMargin; } |
| 39 const Length& rightMargin() const { return m_rightMargin; } | 41 const Length& rightMargin() const { return m_rightMargin; } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 64 Vector<float> m_thresholds; | 66 Vector<float> m_thresholds; |
| 65 Length m_topMargin; | 67 Length m_topMargin; |
| 66 Length m_rightMargin; | 68 Length m_rightMargin; |
| 67 Length m_bottomMargin; | 69 Length m_bottomMargin; |
| 68 Length m_leftMargin; | 70 Length m_leftMargin; |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace blink | 73 } // namespace blink |
| 72 | 74 |
| 73 #endif // IntersectionObserver_h | 75 #endif // IntersectionObserver_h |
| OLD | NEW |