OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ElementIntersectionObserverData_h | |
6 #define ElementIntersectionObserverData_h | |
7 | |
8 #include "platform/heap/Handle.h" | |
9 | |
10 namespace blink { | |
11 | |
12 class Element; | |
13 class IntersectionObservation; | |
14 class IntersectionObserver; | |
15 | |
16 class ElementIntersectionObserverData : public GarbageCollectedFinalized<Element IntersectionObserverData> { | |
17 public: | |
18 DECLARE_TRACE(); | |
19 ElementIntersectionObserverData(); | |
20 ~ElementIntersectionObserverData(); | |
21 | |
22 bool hasIntersectionObserver() const; | |
23 bool hasIntersectionObservation() const; | |
24 bool hasObservationFor(IntersectionObserver&) const; | |
25 void addObservation(IntersectionObservation&); | |
26 void removeObservation(IntersectionObserver&); | |
27 void activateValidIntersectionObservers(Element&); | |
28 void deactivateAllIntersectionObservers(Element&); | |
29 | |
30 #if !ENABLE(OILPAN) | |
31 void dispose(); | |
32 #endif | |
33 | |
34 WeakPtr<Element> createWeakPtr(Element*); | |
35 | |
36 private: | |
37 // IntersectionObservers for which the Element owning this data is root. | |
haraken
2015/12/22 01:13:29
Help me understand: Is it possible that a non-Docu
esprehn
2015/12/22 07:50:32
root can be any element that's an ancestor.
szager1
2015/12/22 07:53:41
The root can be any container element; see the spe
| |
38 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; | |
39 // IntersectionObservations for which the Element owning this data is target . | |
40 HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m _intersectionObservations; | |
haraken
2015/12/22 01:13:29
I don't fully understand why we need this mapping.
szager1
2015/12/22 07:53:41
Please take a look at the design doc linked in CL
| |
41 | |
42 #if !ENABLE(OILPAN) | |
43 OwnPtrWillBeMember<WeakPtrFactory<Element>> m_weakPointerFactory; | |
haraken
2015/12/22 01:13:30
This can simply be:
WeakPtrFactory<Element>
Ow
szager1
2015/12/22 07:53:41
WeakPtrFactory must be constructed with a pointer
| |
44 #endif | |
45 }; | |
46 | |
47 } // namespace blink { | |
48 | |
49 #endif // ElementIntersectionObserverData_h | |
OLD | NEW |