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 file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "core/css/CSSContentDistributionValue.h" |
| 7 |
| 8 #include "core/css/CSSValueList.h" |
| 9 #include "wtf/text/StringBuilder.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 CSSContentDistributionValue::CSSContentDistributionValue(CSSValueID distribution
, CSSValueID position, CSSValueID overflow) |
| 14 : CSSValue(CSSContentDistributionClass) |
| 15 , m_distribution(distribution) |
| 16 , m_position(position) |
| 17 , m_overflow(overflow) |
| 18 { |
| 19 } |
| 20 |
| 21 CSSContentDistributionValue::~CSSContentDistributionValue() |
| 22 { |
| 23 } |
| 24 |
| 25 String CSSContentDistributionValue::customCSSText() const |
| 26 { |
| 27 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 28 |
| 29 if (m_distribution != CSSValueInvalid) |
| 30 list->append(distribution()); |
| 31 if (m_position != CSSValueInvalid) |
| 32 list->append(position()); |
| 33 if (m_overflow != CSSValueInvalid) |
| 34 list->append(overflow()); |
| 35 |
| 36 return list.release()->customCSSText(); |
| 37 } |
| 38 |
| 39 bool CSSContentDistributionValue::equals(const CSSContentDistributionValue& othe
r) const |
| 40 { |
| 41 return m_distribution == other.m_distribution && m_position == other.m_posit
ion && m_overflow == other.m_overflow; |
| 42 } |
| 43 |
| 44 } |
OLD | NEW |