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 IntersectionObserverEntry_h | 5 #ifndef IntersectionObserverEntry_h |
6 #define IntersectionObserverEntry_h | 6 #define IntersectionObserverEntry_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/ClientRect.h" | 9 #include "core/dom/ClientRect.h" |
10 #include "core/dom/DOMHighResTimeStamp.h" | 10 #include "core/dom/DOMHighResTimeStamp.h" |
11 #include "platform/geometry/IntRect.h" | 11 #include "platform/geometry/IntRect.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class Element; | 16 class Element; |
17 | 17 |
18 class IntersectionObserverEntry final : public GarbageCollectedFinalized<Interse
ctionObserverEntry>, public ScriptWrappable { | 18 class IntersectionObserverEntry final : public GarbageCollected<IntersectionObse
rverEntry>, public ScriptWrappable { |
19 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
20 public: | 20 public: |
21 IntersectionObserverEntry(DOMHighResTimeStamp timestamp, double intersection
Ratio, const IntRect& boundingClientRect, const IntRect* rootBounds, const IntRe
ct& intersectionRect, Element*); | 21 IntersectionObserverEntry(DOMHighResTimeStamp timestamp, double intersection
Ratio, const IntRect& boundingClientRect, const IntRect* rootBounds, const IntRe
ct& intersectionRect, Element*); |
22 ~IntersectionObserverEntry(); | |
23 | 22 |
24 double time() const { return m_time; } | 23 double time() const { return m_time; } |
25 double intersectionRatio() const { return m_intersectionRatio; } | 24 double intersectionRatio() const { return m_intersectionRatio; } |
26 ClientRect* boundingClientRect() const { return m_boundingClientRect; } | 25 ClientRect* boundingClientRect() const { return m_boundingClientRect; } |
27 ClientRect* rootBounds() const { return m_rootBounds; } | 26 ClientRect* rootBounds() const { return m_rootBounds; } |
28 ClientRect* intersectionRect() const { return m_intersectionRect; } | 27 ClientRect* intersectionRect() const { return m_intersectionRect; } |
29 Element* target() const { return m_target.get(); } | 28 Element* target() const { return m_target.get(); } |
30 | 29 |
31 DECLARE_VIRTUAL_TRACE(); | 30 DECLARE_VIRTUAL_TRACE(); |
32 | 31 |
33 private: | 32 private: |
34 DOMHighResTimeStamp m_time; | 33 DOMHighResTimeStamp m_time; |
35 double m_intersectionRatio; | 34 double m_intersectionRatio; |
36 Member<ClientRect> m_boundingClientRect; | 35 Member<ClientRect> m_boundingClientRect; |
37 Member<ClientRect> m_rootBounds; | 36 Member<ClientRect> m_rootBounds; |
38 Member<ClientRect> m_intersectionRect; | 37 Member<ClientRect> m_intersectionRect; |
39 Member<Element> m_target; | 38 Member<Element> m_target; |
40 }; | 39 }; |
41 | 40 |
42 } // namespace blink | 41 } // namespace blink |
43 | 42 |
44 #endif // IntersectionObserverEntry_h | 43 #endif // IntersectionObserverEntry_h |
OLD | NEW |