Index: Source/core/css/CSSContentDistributionValue.cpp |
diff --git a/Source/core/css/CSSContentDistributionValue.cpp b/Source/core/css/CSSContentDistributionValue.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d45b997689ca7a297f464ea3e5c0d2ccf69d34ce |
--- /dev/null |
+++ b/Source/core/css/CSSContentDistributionValue.cpp |
@@ -0,0 +1,44 @@ |
+// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/css/CSSContentDistributionValue.h" |
+ |
+#include "core/css/CSSValueList.h" |
+#include "wtf/text/StringBuilder.h" |
+ |
+namespace blink { |
+ |
+CSSContentDistributionValue::CSSContentDistributionValue(CSSValueID distribution, CSSValueID position, CSSValueID overflow) |
+ : CSSValue(CSSContentDistributionClass) |
+ , m_distribution(distribution) |
+ , m_position(position) |
+ , m_overflow(overflow) |
+{ |
+} |
+ |
+CSSContentDistributionValue::~CSSContentDistributionValue() |
+{ |
+} |
+ |
+String CSSContentDistributionValue::customCSSText() const |
+{ |
+ RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
+ |
+ if (m_distribution != CSSValueInvalid) |
+ list->append(distribution()); |
+ if (m_position != CSSValueInvalid) |
+ list->append(position()); |
+ if (m_overflow != CSSValueInvalid) |
+ list->append(overflow()); |
+ |
+ return list.release()->customCSSText(); |
+} |
+ |
+bool CSSContentDistributionValue::equals(const CSSContentDistributionValue& other) const |
+{ |
+ return m_distribution == other.m_distribution && m_position == other.m_position && m_overflow == other.m_overflow; |
+} |
+ |
+} |