OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/CSSContentDistributionValue.h" | 5 #include "core/css/CSSContentDistributionValue.h" |
6 | 6 |
7 #include "core/css/CSSValueList.h" | 7 #include "core/css/CSSValueList.h" |
8 #include "wtf/text/StringBuilder.h" | 8 #include "wtf/text/StringBuilder.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 CSSContentDistributionValue::CSSContentDistributionValue(CSSValueID distribution
, CSSValueID position, CSSValueID overflow) | 12 CSSContentDistributionValue::CSSContentDistributionValue(CSSValueID distribution
, CSSValueID position, CSSValueID overflow) |
13 : CSSValue(CSSContentDistributionClass) | 13 : CSSValue(CSSContentDistributionClass) |
14 , m_distribution(distribution) | 14 , m_distribution(distribution) |
15 , m_position(position) | 15 , m_position(position) |
16 , m_overflow(overflow) | 16 , m_overflow(overflow) |
17 { | 17 { |
18 } | 18 } |
19 | 19 |
20 CSSContentDistributionValue::~CSSContentDistributionValue() | 20 CSSContentDistributionValue::~CSSContentDistributionValue() |
21 { | 21 { |
22 } | 22 } |
23 | 23 |
24 String CSSContentDistributionValue::customCSSText() const | 24 String CSSContentDistributionValue::customCSSText() const |
25 { | 25 { |
26 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 26 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
27 | 27 |
28 if (m_distribution != CSSValueInvalid) | 28 if (m_distribution != CSSValueInvalid) |
29 list->append(distribution()); | 29 list->append(distribution()); |
30 if (m_position != CSSValueInvalid) | 30 if (m_position != CSSValueInvalid) |
31 list->append(position()); | 31 list->append(position()); |
32 if (m_overflow != CSSValueInvalid) | 32 if (m_overflow != CSSValueInvalid) |
33 list->append(overflow()); | 33 list->append(overflow()); |
34 | 34 |
35 return list.release()->customCSSText(); | 35 return list->customCSSText(); |
36 } | 36 } |
37 | 37 |
38 bool CSSContentDistributionValue::equals(const CSSContentDistributionValue& othe
r) const | 38 bool CSSContentDistributionValue::equals(const CSSContentDistributionValue& othe
r) const |
39 { | 39 { |
40 return m_distribution == other.m_distribution && m_position == other.m_posit
ion && m_overflow == other.m_overflow; | 40 return m_distribution == other.m_distribution && m_position == other.m_posit
ion && m_overflow == other.m_overflow; |
41 } | 41 } |
42 | 42 |
43 } // namespace blink | 43 } // namespace blink |
OLD | NEW |