Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.h

Issue 2173353002: Simplify ElementVisibilityObserver implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust visibility Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698