diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/Rect.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/css/Rect.h')
-rw-r--r-- | Source/WebCore/css/Rect.h | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/Source/WebCore/css/Rect.h b/Source/WebCore/css/Rect.h index ffb20a01e..7f118f6aa 100644 --- a/Source/WebCore/css/Rect.h +++ b/Source/WebCore/css/Rect.h @@ -18,8 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#ifndef Rect_h -#define Rect_h +#pragma once #include "CSSPrimitiveValue.h" #include <wtf/RefPtr.h> @@ -34,10 +33,10 @@ public: CSSPrimitiveValue* bottom() const { return m_bottom.get(); } CSSPrimitiveValue* left() const { return m_left.get(); } - void setTop(PassRefPtr<CSSPrimitiveValue> top) { m_top = top; } - void setRight(PassRefPtr<CSSPrimitiveValue> right) { m_right = right; } - void setBottom(PassRefPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; } - void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; } + void setTop(RefPtr<CSSPrimitiveValue>&& top) { m_top = WTFMove(top); } + void setRight(RefPtr<CSSPrimitiveValue>&& right) { m_right = WTFMove(right); } + void setBottom(RefPtr<CSSPrimitiveValue>&& bottom) { m_bottom = WTFMove(bottom); } + void setLeft(RefPtr<CSSPrimitiveValue>&& left) { m_left = WTFMove(left); } bool equals(const RectBase& other) const { @@ -49,14 +48,6 @@ public: protected: RectBase() { } - RectBase(const RectBase& cloneFrom) - : m_top(cloneFrom.m_top ? cloneFrom.m_top->cloneForCSSOM() : 0) - , m_right(cloneFrom.m_right ? cloneFrom.m_right->cloneForCSSOM() : 0) - , m_bottom(cloneFrom.m_bottom ? cloneFrom.m_bottom->cloneForCSSOM() : 0) - , m_left(cloneFrom.m_left ? cloneFrom.m_left->cloneForCSSOM() : 0) - { - } - ~RectBase() { } private: @@ -66,11 +57,9 @@ private: RefPtr<CSSPrimitiveValue> m_left; }; -class Rect : public RectBase, public RefCounted<Rect> { +class Rect final : public RectBase, public RefCounted<Rect> { public: - static PassRefPtr<Rect> create() { return adoptRef(new Rect); } - - PassRefPtr<Rect> cloneForCSSOM() const { return adoptRef(new Rect(*this)); } + static Ref<Rect> create() { return adoptRef(*new Rect); } String cssText() const { @@ -79,18 +68,15 @@ public: private: Rect() { } - Rect(const Rect& cloneFrom) : RectBase(cloneFrom), RefCounted<Rect>() { } static String generateCSSString(const String& top, const String& right, const String& bottom, const String& left) { - return "rect(" + top + ' ' + right + ' ' + bottom + ' ' + left + ')'; + return "rect(" + top + ", " + right + ", " + bottom + ", " + left + ')'; } }; -class Quad : public RectBase, public RefCounted<Quad> { +class Quad final : public RectBase, public RefCounted<Quad> { public: - static PassRefPtr<Quad> create() { return adoptRef(new Quad); } - - PassRefPtr<Quad> cloneForCSSOM() const { return adoptRef(new Quad(*this)); } + static Ref<Quad> create() { return adoptRef(*new Quad); } String cssText() const { @@ -99,7 +85,6 @@ public: private: Quad() { } - Quad(const Quad& cloneFrom) : RectBase(cloneFrom), RefCounted<Quad>() { } static String generateCSSString(const String& top, const String& right, const String& bottom, const String& left) { StringBuilder result; @@ -123,5 +108,3 @@ private: }; } // namespace WebCore - -#endif // Rect_h |