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 IntersectionObservation_h | 5 #ifndef IntersectionObservation_h |
6 #define IntersectionObservation_h | 6 #define IntersectionObservation_h |
7 | 7 |
8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class Element; | 13 class Element; |
14 class IntersectionObserver; | 14 class IntersectionObserver; |
15 class Node; | 15 class Node; |
16 | 16 |
17 class IntersectionObservation : public GarbageCollectedFinalized<IntersectionObs ervation> { | 17 class IntersectionObservation : public GarbageCollectedFinalized<IntersectionObs ervation> { |
18 public: | 18 public: |
19 IntersectionObservation(IntersectionObserver&, Element&, bool shouldReportRo otBounds); | 19 IntersectionObservation(IntersectionObserver&, Element&, bool shouldReportRo otBounds); |
20 virtual ~IntersectionObservation(); | |
dcheng
2016/01/14 07:06:09
No virtual needed here and on IntersectionObserver
sof
2016/01/14 07:13:09
Adding a TODO above this class decl, like
TODO(O
haraken
2016/01/14 07:23:44
Yeah, makes sense. We considered to introduce Garb
szager1
2016/01/14 07:24:37
Done.
szager1
2016/01/14 07:24:37
Done.
| |
20 | 21 |
21 struct IntersectionGeometry { | 22 struct IntersectionGeometry { |
22 LayoutRect targetRect; | 23 LayoutRect targetRect; |
23 LayoutRect intersectionRect; | 24 LayoutRect intersectionRect; |
24 LayoutRect rootRect; | 25 LayoutRect rootRect; |
25 }; | 26 }; |
26 | 27 |
27 IntersectionObserver& observer() const { return *m_observer; } | 28 IntersectionObserver& observer() const { return *m_observer; } |
28 Element* target() const; | 29 Element* target() const; |
29 bool isActive() const { return m_active; } | 30 bool isActive() const { return m_active; } |
(...skipping 21 matching lines...) Expand all Loading... | |
51 WeakPtrWillBeWeakMember<Node> m_target; | 52 WeakPtrWillBeWeakMember<Node> m_target; |
52 | 53 |
53 unsigned m_active : 1; | 54 unsigned m_active : 1; |
54 unsigned m_shouldReportRootBounds : 1; | 55 unsigned m_shouldReportRootBounds : 1; |
55 unsigned m_lastThresholdIndex : 30; | 56 unsigned m_lastThresholdIndex : 30; |
56 }; | 57 }; |
57 | 58 |
58 } // namespace blink | 59 } // namespace blink |
59 | 60 |
60 #endif // IntersectionObservation_h | 61 #endif // IntersectionObservation_h |
OLD | NEW |