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

Unified Diff: Source/core/css/CSSContentDistributionValue.cpp

Issue 636993002: [CSS Grid Layout] Upgrade justify-content parsing to CSS3 Box Alignment spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaseline some tests expectations. Created 6 years, 2 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/CSSContentDistributionValue.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
+
+}
« no previous file with comments | « Source/core/css/CSSContentDistributionValue.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698