OLD | NEW |
---|---|
(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 } | |
OLD | NEW |