| 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 "core/dom/ClientRect.h" | |
| 9 #include "core/dom/DOMHighResTimeStamp.h" | 8 #include "core/dom/DOMHighResTimeStamp.h" |
| 9 #include "core/geometry/DOMRect.h" |
| 10 #include "platform/bindings/ScriptWrappable.h" | 10 #include "platform/bindings/ScriptWrappable.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 intersection_ratio, | 25 double intersection_ratio, |
| 26 const IntRect& bounding_client_rect, | 26 const IntRect& bounding_client_rect, |
| 27 const IntRect* root_bounds, | 27 const IntRect* root_bounds, |
| 28 const IntRect& intersection_rect, | 28 const IntRect& intersection_rect, |
| 29 bool is_intersecting, | 29 bool is_intersecting, |
| 30 Element*); | 30 Element*); |
| 31 | 31 |
| 32 double time() const { return time_; } | 32 double time() const { return time_; } |
| 33 double intersectionRatio() const { return intersection_ratio_; } | 33 double intersectionRatio() const { return intersection_ratio_; } |
| 34 ClientRect* boundingClientRect() const { return bounding_client_rect_; } | 34 DOMRect* boundingClientRect() const { return bounding_client_rect_; } |
| 35 ClientRect* rootBounds() const { return root_bounds_; } | 35 DOMRect* rootBounds() const { return root_bounds_; } |
| 36 ClientRect* intersectionRect() const { return intersection_rect_; } | 36 DOMRect* intersectionRect() const { return intersection_rect_; } |
| 37 bool isIntersecting() const { return is_intersecting_; } | 37 bool isIntersecting() const { return is_intersecting_; } |
| 38 Element* target() const { return target_.Get(); } | 38 Element* target() const { return target_.Get(); } |
| 39 | 39 |
| 40 DECLARE_VIRTUAL_TRACE(); | 40 DECLARE_VIRTUAL_TRACE(); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 DOMHighResTimeStamp time_; | 43 DOMHighResTimeStamp time_; |
| 44 double intersection_ratio_; | 44 double intersection_ratio_; |
| 45 Member<ClientRect> bounding_client_rect_; | 45 Member<DOMRect> bounding_client_rect_; |
| 46 Member<ClientRect> root_bounds_; | 46 Member<DOMRect> root_bounds_; |
| 47 Member<ClientRect> intersection_rect_; | 47 Member<DOMRect> intersection_rect_; |
| 48 Member<Element> target_; | 48 Member<Element> target_; |
| 49 bool is_intersecting_; | 49 bool is_intersecting_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace blink | 52 } // namespace blink |
| 53 | 53 |
| 54 #endif // IntersectionObserverEntry_h | 54 #endif // IntersectionObserverEntry_h |
| OLD | NEW |