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

Unified Diff: Source/core/css/CSSQuadValue.h

Issue 1304993002: Change Rect and Quad to be CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_counter_out_attempt_3
Patch Set: Small change to generated style builder functions Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/css/CSSQuadValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSQuadValue.h
diff --git a/Source/core/css/CSSQuadValue.h b/Source/core/css/CSSQuadValue.h
new file mode 100644
index 0000000000000000000000000000000000000000..32693f1f928808f19f890e1a11498b5b14a433f0
--- /dev/null
+++ b/Source/core/css/CSSQuadValue.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef CSSQuadValue_h
+#define CSSQuadValue_h
+
+#include "core/CoreExport.h"
+#include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSValue.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+
+class CORE_EXPORT CSSQuadValue : public CSSValue {
+public:
+ enum SerializationType {
+ SerializeAsRect,
+ SerializeAsQuad
+ };
+
+ static PassRefPtrWillBeRawPtr<CSSQuadValue> create(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left, SerializationType serializationType)
+ {
+ return adoptRefWillBeNoop(new CSSQuadValue(top, right, bottom, left, serializationType));
+ }
+
+ CSSPrimitiveValue* top() const { return m_top.get(); }
+ CSSPrimitiveValue* right() const { return m_right.get(); }
+ CSSPrimitiveValue* bottom() const { return m_bottom.get(); }
+ CSSPrimitiveValue* left() const { return m_left.get(); }
+
+ SerializationType serializationType() { return m_serializationType; }
+
+ String customCSSText() const;
+
+ bool equals(const CSSQuadValue& other) const
+ {
+ return compareCSSValuePtr(m_top, other.m_top)
+ && compareCSSValuePtr(m_right, other.m_right)
+ && compareCSSValuePtr(m_left, other.m_left)
+ && compareCSSValuePtr(m_bottom, other.m_bottom);
+ }
+
+ DECLARE_TRACE_AFTER_DISPATCH();
+
+protected:
+ CSSQuadValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left, SerializationType serializationType)
+ : CSSValue(QuadClass)
+ , m_serializationType(serializationType)
+ , m_top(top)
+ , m_right(right)
+ , m_bottom(bottom)
+ , m_left(left) { }
+
+private:
+ SerializationType m_serializationType;
+ RefPtrWillBeMember<CSSPrimitiveValue> m_top;
+ RefPtrWillBeMember<CSSPrimitiveValue> m_right;
+ RefPtrWillBeMember<CSSPrimitiveValue> m_bottom;
+ RefPtrWillBeMember<CSSPrimitiveValue> m_left;
+};
+
+DEFINE_CSS_VALUE_TYPE_CASTS(CSSQuadValue, isQuadValue());
+
+} // namespace blink
+
+#endif // CSSQuadValue_h
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/css/CSSQuadValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698