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 12 matching lines...) Expand all Loading... |
23 class IntersectionObserverCallback; | 23 class IntersectionObserverCallback; |
24 class IntersectionObserverInit; | 24 class IntersectionObserverInit; |
25 | 25 |
26 class CORE_EXPORT IntersectionObserver final : public GarbageCollectedFinalized<
IntersectionObserver>, public ScriptWrappable { | 26 class CORE_EXPORT IntersectionObserver final : public GarbageCollectedFinalized<
IntersectionObserver>, public ScriptWrappable { |
27 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
28 | 28 |
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 // TODO(sof): unused, consider retiring? |
33 static IntersectionObserver* create(const Vector<Length>& rootMargin, const
Vector<float>& thresholds, Document*, std::unique_ptr<EventCallback>); | 34 static IntersectionObserver* create(const Vector<Length>& rootMargin, const
Vector<float>& thresholds, Document*, std::unique_ptr<EventCallback>); |
34 static void resumeSuspendedObservers(); | 35 static void resumeSuspendedObservers(); |
35 | 36 |
36 // API methods. | 37 // API methods. |
37 void observe(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); | 38 void observe(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); |
38 void unobserve(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); | 39 void unobserve(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); |
39 void disconnect(ExceptionState& = ASSERT_NO_EXCEPTION); | 40 void disconnect(ExceptionState& = ASSERT_NO_EXCEPTION); |
40 HeapVector<Member<IntersectionObserverEntry>> takeRecords(ExceptionState&); | 41 HeapVector<Member<IntersectionObserverEntry>> takeRecords(ExceptionState&); |
41 | 42 |
42 // API attributes. | 43 // API attributes. |
(...skipping 29 matching lines...) Expand all Loading... |
72 Vector<float> m_thresholds; | 73 Vector<float> m_thresholds; |
73 Length m_topMargin; | 74 Length m_topMargin; |
74 Length m_rightMargin; | 75 Length m_rightMargin; |
75 Length m_bottomMargin; | 76 Length m_bottomMargin; |
76 Length m_leftMargin; | 77 Length m_leftMargin; |
77 }; | 78 }; |
78 | 79 |
79 } // namespace blink | 80 } // namespace blink |
80 | 81 |
81 #endif // IntersectionObserver_h | 82 #endif // IntersectionObserver_h |
OLD | NEW |