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..0feea22b2d2d83ee7a0264b0bfcf36b5a997a84f |
--- /dev/null |
+++ b/Source/core/css/CSSContentDistributionValue.cpp |
@@ -0,0 +1,47 @@ |
+// 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 fil |
Julien - ping for review
2014/10/28 17:23:05
LICENSE fil again
jfernandez
2014/10/29 11:03:04
Done.
|
+ |
+#include "config.h" |
+#include "core/css/CSSContentDistributionValue.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 |
+{ |
+ StringBuilder result; |
+ if (m_distribution != CSSValueInvalid) |
+ result.append(distribution()->customCSSText()); |
+ if (m_position != CSSValueInvalid) { |
+ if (m_distribution != CSSValueInvalid) |
+ result.appendLiteral(" "); |
Julien - ping for review
2014/10/28 17:23:05
We could simplify this if you just used a space-se
jfernandez
2014/10/29 11:03:04
Acknowledged.
|
+ result.append(position()->customCSSText()); |
Julien - ping for review
2014/10/28 17:23:05
This creates a temporary object but valueName is s
jfernandez
2014/10/29 11:03:04
Done.
|
+ } |
+ if (m_overflow != CSSValueInvalid) { |
+ if (m_distribution != CSSValueInvalid || m_position != CSSValueInvalid) |
+ result.appendLiteral(" "); |
+ result.append(overflow()->customCSSText()); |
+ } |
+ return result.toString(); |
+} |
+ |
+bool CSSContentDistributionValue::equals(const CSSContentDistributionValue& other) const |
+{ |
+ return m_distribution == other.m_distribution && m_position == other.m_position && m_overflow == other.m_overflow; |
+} |
+ |
+} |