| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef LayerRect_h | 31 #ifndef LayerRect_h |
| 32 #define LayerRect_h | 32 #define LayerRect_h |
| 33 | 33 |
| 34 #include "core/dom/ClientRect.h" | |
| 35 #include "core/dom/Node.h" | 34 #include "core/dom/Node.h" |
| 35 #include "core/geometry/DOMRect.h" |
| 36 #include "platform/bindings/ScriptWrappable.h" | 36 #include "platform/bindings/ScriptWrappable.h" |
| 37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 38 #include "platform/wtf/text/WTFString.h" | 38 #include "platform/wtf/text/WTFString.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class LayerRect final : public GarbageCollectedFinalized<LayerRect>, | 42 class LayerRect final : public GarbageCollectedFinalized<LayerRect>, |
| 43 public ScriptWrappable { | 43 public ScriptWrappable { |
| 44 DEFINE_WRAPPERTYPEINFO(); | 44 DEFINE_WRAPPERTYPEINFO(); |
| 45 | 45 |
| 46 public: | 46 public: |
| 47 static LayerRect* Create(Node* node, | 47 static LayerRect* Create(Node* node, |
| 48 const String& layer_type, | 48 const String& layer_type, |
| 49 int node_offset_x, | 49 int node_offset_x, |
| 50 int node_offset_y, | 50 int node_offset_y, |
| 51 ClientRect* rect) { | 51 DOMRect* rect) { |
| 52 return new LayerRect(node, layer_type, node_offset_x, node_offset_y, rect); | 52 return new LayerRect(node, layer_type, node_offset_x, node_offset_y, rect); |
| 53 } | 53 } |
| 54 | 54 |
| 55 Node* layerAssociatedNode() const { return layer_associated_node_.Get(); } | 55 Node* layerAssociatedNode() const { return layer_associated_node_.Get(); } |
| 56 String layerType() const { return layer_type_; } | 56 String layerType() const { return layer_type_; } |
| 57 int associatedNodeOffsetX() const { return associated_node_offset_x_; } | 57 int associatedNodeOffsetX() const { return associated_node_offset_x_; } |
| 58 int associatedNodeOffsetY() const { return associated_node_offset_y_; } | 58 int associatedNodeOffsetY() const { return associated_node_offset_y_; } |
| 59 ClientRect* layerRelativeRect() const { return rect_.Get(); } | 59 DOMRect* layerRelativeRect() const { return rect_.Get(); } |
| 60 | 60 |
| 61 DEFINE_INLINE_TRACE() { | 61 DEFINE_INLINE_TRACE() { |
| 62 visitor->Trace(layer_associated_node_); | 62 visitor->Trace(layer_associated_node_); |
| 63 visitor->Trace(rect_); | 63 visitor->Trace(rect_); |
| 64 } | 64 } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 LayerRect(Node* node, | 67 LayerRect(Node* node, |
| 68 const String& layer_name, | 68 const String& layer_name, |
| 69 int node_offset_x, | 69 int node_offset_x, |
| 70 int node_offset_y, | 70 int node_offset_y, |
| 71 ClientRect* rect) | 71 DOMRect* rect) |
| 72 : layer_associated_node_(node), | 72 : layer_associated_node_(node), |
| 73 layer_type_(layer_name), | 73 layer_type_(layer_name), |
| 74 associated_node_offset_x_(node_offset_x), | 74 associated_node_offset_x_(node_offset_x), |
| 75 associated_node_offset_y_(node_offset_y), | 75 associated_node_offset_y_(node_offset_y), |
| 76 rect_(rect) {} | 76 rect_(rect) {} |
| 77 | 77 |
| 78 Member<Node> layer_associated_node_; | 78 Member<Node> layer_associated_node_; |
| 79 String layer_type_; | 79 String layer_type_; |
| 80 int associated_node_offset_x_; | 80 int associated_node_offset_x_; |
| 81 int associated_node_offset_y_; | 81 int associated_node_offset_y_; |
| 82 Member<ClientRect> rect_; | 82 Member<DOMRect> rect_; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace blink | 85 } // namespace blink |
| 86 | 86 |
| 87 #endif // LayerRect_h | 87 #endif // LayerRect_h |
| OLD | NEW |