| 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/ExceptionStatePlaceholder.h" | 8 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "core/dom/IntersectionObservation.h" | 10 #include "core/dom/IntersectionObservation.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public: | 29 public: |
| 30 using EventCallback = Function<void(const HeapVector<Member<IntersectionObse
rverEntry>>&), WTF::SameThreadAffinity>; | 30 using EventCallback = Function<void(const HeapVector<Member<IntersectionObse
rverEntry>>&), WTF::SameThreadAffinity>; |
| 31 | 31 |
| 32 static IntersectionObserver* create(const IntersectionObserverInit&, Interse
ctionObserverCallback&, ExceptionState&); | 32 static IntersectionObserver* create(const IntersectionObserverInit&, Interse
ctionObserverCallback&, ExceptionState&); |
| 33 static IntersectionObserver* create(const Vector<Length>& rootMargin, const
Vector<float>& thresholds, Document*, std::unique_ptr<EventCallback>); | 33 static IntersectionObserver* create(const Vector<Length>& rootMargin, const
Vector<float>& thresholds, Document*, std::unique_ptr<EventCallback>); |
| 34 static void resumeSuspendedObservers(); | 34 static void resumeSuspendedObservers(); |
| 35 | 35 |
| 36 // API methods. | 36 // API methods. |
| 37 void observe(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); | 37 void observe(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); |
| 38 void unobserve(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); | 38 void unobserve(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); |
| 39 void disconnect(ExceptionState&); | 39 void disconnect(ExceptionState& = ASSERT_NO_EXCEPTION); |
| 40 HeapVector<Member<IntersectionObserverEntry>> takeRecords(ExceptionState&); | 40 HeapVector<Member<IntersectionObserverEntry>> takeRecords(ExceptionState&); |
| 41 | 41 |
| 42 // API attributes. | 42 // API attributes. |
| 43 Element* root() const; | 43 Element* root() const; |
| 44 String rootMargin() const; | 44 String rootMargin() const; |
| 45 const Vector<float>& thresholds() const { return m_thresholds; } | 45 const Vector<float>& thresholds() const { return m_thresholds; } |
| 46 | 46 |
| 47 Node* rootNode() const { return m_root.get(); } | 47 Node* rootNode() const { return m_root.get(); } |
| 48 LayoutObject* rootLayoutObject() const; | 48 LayoutObject* rootLayoutObject() const; |
| 49 const Length& topMargin() const { return m_topMargin; } | 49 const Length& topMargin() const { return m_topMargin; } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 Vector<float> m_thresholds; | 72 Vector<float> m_thresholds; |
| 73 Length m_topMargin; | 73 Length m_topMargin; |
| 74 Length m_rightMargin; | 74 Length m_rightMargin; |
| 75 Length m_bottomMargin; | 75 Length m_bottomMargin; |
| 76 Length m_leftMargin; | 76 Length m_leftMargin; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace blink | 79 } // namespace blink |
| 80 | 80 |
| 81 #endif // IntersectionObserver_h | 81 #endif // IntersectionObserver_h |
| OLD | NEW |