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

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

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Enabled test, fixed bugs Created 4 years, 1 month 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void enqueueIntersectionObserverEntry(IntersectionObserverEntry&); 64 void enqueueIntersectionObserverEntry(IntersectionObserverEntry&);
65 void applyRootMargin(LayoutRect&) const; 65 void applyRootMargin(LayoutRect&) const;
66 unsigned firstThresholdGreaterThan(float ratio) const; 66 unsigned firstThresholdGreaterThan(float ratio) const;
67 void deliver(); 67 void deliver();
68 void removeObservation(IntersectionObservation&); 68 void removeObservation(IntersectionObservation&);
69 bool hasEntries() const { return m_entries.size(); } 69 bool hasEntries() const { return m_entries.size(); }
70 const HeapLinkedHashSet<WeakMember<IntersectionObservation>>& observations() 70 const HeapLinkedHashSet<WeakMember<IntersectionObservation>>& observations()
71 const { 71 const {
72 return m_observations; 72 return m_observations;
73 } 73 }
74 void intersectWithRemoteAncestorsIfNeeded(LayoutRect&);
74 75
75 DECLARE_TRACE(); 76 DECLARE_TRACE();
76 77
77 private: 78 private:
78 explicit IntersectionObserver(IntersectionObserverCallback&, 79 explicit IntersectionObserver(IntersectionObserverCallback&,
79 Node&, 80 Node&,
80 const Vector<Length>& rootMargin, 81 const Vector<Length>& rootMargin,
81 const Vector<float>& thresholds); 82 const Vector<float>& thresholds,
83 bool intersectWithRemoteAncestors);
82 void clearWeakMembers(Visitor*); 84 void clearWeakMembers(Visitor*);
83 85
84 Member<IntersectionObserverCallback> m_callback; 86 Member<IntersectionObserverCallback> m_callback;
85 WeakMember<Node> m_root; 87 WeakMember<Node> m_root;
86 HeapLinkedHashSet<WeakMember<IntersectionObservation>> m_observations; 88 HeapLinkedHashSet<WeakMember<IntersectionObservation>> m_observations;
87 HeapVector<Member<IntersectionObserverEntry>> m_entries; 89 HeapVector<Member<IntersectionObserverEntry>> m_entries;
88 Vector<float> m_thresholds; 90 Vector<float> m_thresholds;
89 Length m_topMargin; 91 Length m_topMargin;
90 Length m_rightMargin; 92 Length m_rightMargin;
91 Length m_bottomMargin; 93 Length m_bottomMargin;
92 Length m_leftMargin; 94 Length m_leftMargin;
95 bool m_intersectWithRemoteAncestors;
93 }; 96 };
94 97
95 } // namespace blink 98 } // namespace blink
96 99
97 #endif // IntersectionObserver_h 100 #endif // IntersectionObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698