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

Side by Side 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: Using a custom CSSValue to simplify parsing and style building. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // 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.
4
5 #include "config.h"
6 #include "core/css/CSSContentDistributionValue.h"
7
8 #include "wtf/text/StringBuilder.h"
9
10 namespace blink {
11
12 CSSContentDistributionValue::CSSContentDistributionValue(CSSValueID distribution , CSSValueID position, CSSValueID overflow)
13 : CSSValue(CSSContentDistributionClass)
14 , m_distribution(distribution)
15 , m_position(position)
16 , m_overflow(overflow)
17 {
18 }
19
20 CSSContentDistributionValue::~CSSContentDistributionValue()
21 {
22 }
23
24 String CSSContentDistributionValue::customCSSText() const
25 {
26 StringBuilder result;
27 if (m_distribution != CSSValueInvalid)
28 result.append(distribution()->customCSSText());
29 if (m_position != CSSValueInvalid) {
30 if (m_distribution != CSSValueInvalid)
31 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.
32 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.
33 }
34 if (m_overflow != CSSValueInvalid) {
35 if (m_distribution != CSSValueInvalid || m_position != CSSValueInvalid)
36 result.appendLiteral(" ");
37 result.append(overflow()->customCSSText());
38 }
39 return result.toString();
40 }
41
42 bool CSSContentDistributionValue::equals(const CSSContentDistributionValue& othe r) const
43 {
44 return m_distribution == other.m_distribution && m_position == other.m_posit ion && m_overflow == other.m_overflow;
45 }
46
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698