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

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

Issue 2245613002: Revert "Simplify ElementVisibilityObserver implementation." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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?
34 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>);
35 static void resumeSuspendedObservers(); 34 static void resumeSuspendedObservers();
36 35
37 // API methods. 36 // API methods.
38 void observe(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); 37 void observe(Element*, ExceptionState& = ASSERT_NO_EXCEPTION);
39 void unobserve(Element*, ExceptionState& = ASSERT_NO_EXCEPTION); 38 void unobserve(Element*, ExceptionState& = ASSERT_NO_EXCEPTION);
40 void disconnect(ExceptionState& = ASSERT_NO_EXCEPTION); 39 void disconnect(ExceptionState& = ASSERT_NO_EXCEPTION);
41 HeapVector<Member<IntersectionObserverEntry>> takeRecords(ExceptionState&); 40 HeapVector<Member<IntersectionObserverEntry>> takeRecords(ExceptionState&);
42 41
43 // API attributes. 42 // API attributes.
(...skipping 29 matching lines...) Expand all
73 Vector<float> m_thresholds; 72 Vector<float> m_thresholds;
74 Length m_topMargin; 73 Length m_topMargin;
75 Length m_rightMargin; 74 Length m_rightMargin;
76 Length m_bottomMargin; 75 Length m_bottomMargin;
77 Length m_leftMargin; 76 Length m_leftMargin;
78 }; 77 };
79 78
80 } // namespace blink 79 } // namespace blink
81 80
82 #endif // IntersectionObserver_h 81 #endif // IntersectionObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698