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.
6 #include "core/css/CSSContentDistributionValue.h"
8 #include "core/css/CSSValueList.h"
9 #include "wtf/text/StringBuilder.h"
13 CSSContentDistributionValue::CSSContentDistributionValue(CSSValueID distribution
, CSSValueID position
, CSSValueID overflow
)
14 : CSSValue(CSSContentDistributionClass
)
15 , m_distribution(distribution
)
16 , m_position(position
)
17 , m_overflow(overflow
)
21 CSSContentDistributionValue::~CSSContentDistributionValue()
25 String
CSSContentDistributionValue::customCSSText() const
27 RefPtrWillBeRawPtr
<CSSValueList
> list
= CSSValueList::createSpaceSeparated();
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());
36 return list
.release()->customCSSText();
39 bool CSSContentDistributionValue::equals(const CSSContentDistributionValue
& other
) const
41 return m_distribution
== other
.m_distribution
&& m_position
== other
.m_position
&& m_overflow
== other
.m_overflow
;