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

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

Issue 2662993002: [IntersectionObserver] Add isIntersecting field. (Closed)
Patch Set: webexposed Created 3 years, 10 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
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 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 18 class IntersectionObserverEntry final
19 : public GarbageCollected<IntersectionObserverEntry>, 19 : public GarbageCollected<IntersectionObserverEntry>,
20 public ScriptWrappable { 20 public ScriptWrappable {
21 DEFINE_WRAPPERTYPEINFO(); 21 DEFINE_WRAPPERTYPEINFO();
22 22
23 public: 23 public:
24 IntersectionObserverEntry(DOMHighResTimeStamp timestamp, 24 IntersectionObserverEntry(DOMHighResTimeStamp timestamp,
25 double intersectionRatio, 25 double intersectionRatio,
26 const IntRect& boundingClientRect, 26 const IntRect& boundingClientRect,
27 const IntRect* rootBounds, 27 const IntRect* rootBounds,
28 const IntRect& intersectionRect, 28 const IntRect& intersectionRect,
29 bool isIntersecting,
29 Element*); 30 Element*);
30 31
31 double time() const { return m_time; } 32 double time() const { return m_time; }
32 double intersectionRatio() const { return m_intersectionRatio; } 33 double intersectionRatio() const { return m_intersectionRatio; }
33 ClientRect* boundingClientRect() const { return m_boundingClientRect; } 34 ClientRect* boundingClientRect() const { return m_boundingClientRect; }
34 ClientRect* rootBounds() const { return m_rootBounds; } 35 ClientRect* rootBounds() const { return m_rootBounds; }
35 ClientRect* intersectionRect() const { return m_intersectionRect; } 36 ClientRect* intersectionRect() const { return m_intersectionRect; }
37 bool isIntersecting() const { return m_isIntersecting; }
36 Element* target() const { return m_target.get(); } 38 Element* target() const { return m_target.get(); }
37 39
38 DECLARE_VIRTUAL_TRACE(); 40 DECLARE_VIRTUAL_TRACE();
39 41
40 private: 42 private:
41 DOMHighResTimeStamp m_time; 43 DOMHighResTimeStamp m_time;
42 double m_intersectionRatio; 44 double m_intersectionRatio;
43 Member<ClientRect> m_boundingClientRect; 45 Member<ClientRect> m_boundingClientRect;
44 Member<ClientRect> m_rootBounds; 46 Member<ClientRect> m_rootBounds;
45 Member<ClientRect> m_intersectionRect; 47 Member<ClientRect> m_intersectionRect;
46 Member<Element> m_target; 48 Member<Element> m_target;
49 bool m_isIntersecting;
47 }; 50 };
48 51
49 } // namespace blink 52 } // namespace blink
50 53
51 #endif // IntersectionObserverEntry_h 54 #endif // IntersectionObserverEntry_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698