| 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/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 Document& trackingDocument() const; | 80 Document& trackingDocument() const; |
| 81 | 81 |
| 82 const Length& topMargin() const { return m_topMargin; } | 82 const Length& topMargin() const { return m_topMargin; } |
| 83 const Length& rightMargin() const { return m_rightMargin; } | 83 const Length& rightMargin() const { return m_rightMargin; } |
| 84 const Length& bottomMargin() const { return m_bottomMargin; } | 84 const Length& bottomMargin() const { return m_bottomMargin; } |
| 85 const Length& leftMargin() const { return m_leftMargin; } | 85 const Length& leftMargin() const { return m_leftMargin; } |
| 86 void computeIntersectionObservations(); | 86 void computeIntersectionObservations(); |
| 87 void enqueueIntersectionObserverEntry(IntersectionObserverEntry&); | 87 void enqueueIntersectionObserverEntry(IntersectionObserverEntry&); |
| 88 unsigned firstThresholdGreaterThan(float ratio) const; | 88 unsigned firstThresholdGreaterThan(float ratio) const; |
| 89 void deliver(); | 89 void deliver(); |
| 90 void removeObservation(IntersectionObservation&); | |
| 91 bool hasEntries() const { return m_entries.size(); } | 90 bool hasEntries() const { return m_entries.size(); } |
| 92 const HeapLinkedHashSet<WeakMember<IntersectionObservation>>& observations() | 91 const HeapLinkedHashSet<WeakMember<IntersectionObservation>>& observations() |
| 93 const { | 92 const { |
| 94 return m_observations; | 93 return m_observations; |
| 95 } | 94 } |
| 96 | 95 |
| 97 // Set the assumed initial state of the observed element. Note that this can | 96 // Set the assumed initial state of the observed element. Note that this can |
| 98 // only be set before calling observe(). | 97 // only be set before calling observe(). |
| 99 // TODO(skyostil): Move this setting to IntersectionObserverInit once the API | 98 // TODO(skyostil): Move this setting to IntersectionObserverInit once the API |
| 100 // is finalized. | 99 // is finalized. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 123 Length m_bottomMargin; | 122 Length m_bottomMargin; |
| 124 Length m_leftMargin; | 123 Length m_leftMargin; |
| 125 unsigned m_rootIsImplicit : 1; | 124 unsigned m_rootIsImplicit : 1; |
| 126 // m_initialState contains values from enum InitialState | 125 // m_initialState contains values from enum InitialState |
| 127 unsigned m_initialState : 1; | 126 unsigned m_initialState : 1; |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 } // namespace blink | 129 } // namespace blink |
| 131 | 130 |
| 132 #endif // IntersectionObserver_h | 131 #endif // IntersectionObserver_h |
| OLD | NEW |