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

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

Issue 2028363002: IntersectionObserver: make order of notifications deterministic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/multiple-targets-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/IntersectionObservation.h" 9 #include "core/dom/IntersectionObservation.h"
10 #include "core/dom/IntersectionObserverEntry.h" 10 #include "core/dom/IntersectionObserverEntry.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const Length& rightMargin() const { return m_rightMargin; } 43 const Length& rightMargin() const { return m_rightMargin; }
44 const Length& bottomMargin() const { return m_bottomMargin; } 44 const Length& bottomMargin() const { return m_bottomMargin; }
45 const Length& leftMargin() const { return m_leftMargin; } 45 const Length& leftMargin() const { return m_leftMargin; }
46 void computeIntersectionObservations(); 46 void computeIntersectionObservations();
47 void enqueueIntersectionObserverEntry(IntersectionObserverEntry&); 47 void enqueueIntersectionObserverEntry(IntersectionObserverEntry&);
48 void applyRootMargin(LayoutRect&) const; 48 void applyRootMargin(LayoutRect&) const;
49 unsigned firstThresholdGreaterThan(float ratio) const; 49 unsigned firstThresholdGreaterThan(float ratio) const;
50 void deliver(); 50 void deliver();
51 void removeObservation(IntersectionObservation&); 51 void removeObservation(IntersectionObservation&);
52 bool hasEntries() const { return m_entries.size(); } 52 bool hasEntries() const { return m_entries.size(); }
53 const HeapHashSet<WeakMember<IntersectionObservation>>& observations() const { return m_observations; } 53 const HeapLinkedHashSet<WeakMember<IntersectionObservation>>& observations() const { return m_observations; }
54 54
55 DECLARE_TRACE(); 55 DECLARE_TRACE();
56 56
57 private: 57 private:
58 explicit IntersectionObserver(IntersectionObserverCallback&, Node&, const Ve ctor<Length>& rootMargin, const Vector<float>& thresholds); 58 explicit IntersectionObserver(IntersectionObserverCallback&, Node&, const Ve ctor<Length>& rootMargin, const Vector<float>& thresholds);
59 void clearWeakMembers(Visitor*); 59 void clearWeakMembers(Visitor*);
60 60
61 Member<IntersectionObserverCallback> m_callback; 61 Member<IntersectionObserverCallback> m_callback;
62 WeakMember<Node> m_root; 62 WeakMember<Node> m_root;
63 HeapHashSet<WeakMember<IntersectionObservation>> m_observations; 63 HeapLinkedHashSet<WeakMember<IntersectionObservation>> m_observations;
64 HeapVector<Member<IntersectionObserverEntry>> m_entries; 64 HeapVector<Member<IntersectionObserverEntry>> m_entries;
65 Vector<float> m_thresholds; 65 Vector<float> m_thresholds;
66 Length m_topMargin; 66 Length m_topMargin;
67 Length m_rightMargin; 67 Length m_rightMargin;
68 Length m_bottomMargin; 68 Length m_bottomMargin;
69 Length m_leftMargin; 69 Length m_leftMargin;
70 }; 70 };
71 71
72 } // namespace blink 72 } // namespace blink
73 73
74 #endif // IntersectionObserver_h 74 #endif // IntersectionObserver_h
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/multiple-targets-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698