| 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 #ifndef CSSContentDistributionValue_h | 5 #ifndef CSSContentDistributionValue_h |
| 6 #define CSSContentDistributionValue_h | 6 #define CSSContentDistributionValue_h |
| 7 | 7 |
| 8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSIdentifierValue.h" |
| 9 #include "core/css/CSSValue.h" | 9 #include "core/css/CSSValue.h" |
| 10 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class CSSContentDistributionValue : public CSSValue { | 14 class CSSContentDistributionValue : public CSSValue { |
| 15 public: | 15 public: |
| 16 static CSSContentDistributionValue* create(CSSValueID distribution, | 16 static CSSContentDistributionValue* create(CSSValueID distribution, |
| 17 CSSValueID position, | 17 CSSValueID position, |
| 18 CSSValueID overflow) { | 18 CSSValueID overflow) { |
| 19 return new CSSContentDistributionValue(distribution, position, overflow); | 19 return new CSSContentDistributionValue(distribution, position, overflow); |
| 20 } | 20 } |
| 21 ~CSSContentDistributionValue(); | 21 ~CSSContentDistributionValue(); |
| 22 | 22 |
| 23 CSSPrimitiveValue* distribution() const { | 23 // TODO(sashab): Make these return CSSValueIDs instead of CSSValues. |
| 24 return CSSPrimitiveValue::createIdentifier(m_distribution); | 24 CSSIdentifierValue* distribution() const { |
| 25 return CSSIdentifierValue::create(m_distribution); |
| 25 } | 26 } |
| 26 | 27 |
| 27 CSSPrimitiveValue* position() const { | 28 CSSIdentifierValue* position() const { |
| 28 return CSSPrimitiveValue::createIdentifier(m_position); | 29 return CSSIdentifierValue::create(m_position); |
| 29 } | 30 } |
| 30 | 31 |
| 31 CSSPrimitiveValue* overflow() const { | 32 CSSIdentifierValue* overflow() const { |
| 32 return CSSPrimitiveValue::createIdentifier(m_overflow); | 33 return CSSIdentifierValue::create(m_overflow); |
| 33 } | 34 } |
| 34 | 35 |
| 35 String customCSSText() const; | 36 String customCSSText() const; |
| 36 | 37 |
| 37 bool equals(const CSSContentDistributionValue&) const; | 38 bool equals(const CSSContentDistributionValue&) const; |
| 38 | 39 |
| 39 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { | 40 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { |
| 40 CSSValue::traceAfterDispatch(visitor); | 41 CSSValue::traceAfterDispatch(visitor); |
| 41 } | 42 } |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 CSSContentDistributionValue(CSSValueID distribution, | 45 CSSContentDistributionValue(CSSValueID distribution, |
| 45 CSSValueID position, | 46 CSSValueID position, |
| 46 CSSValueID overflow); | 47 CSSValueID overflow); |
| 47 | 48 |
| 48 CSSValueID m_distribution; | 49 CSSValueID m_distribution; |
| 49 CSSValueID m_position; | 50 CSSValueID m_position; |
| 50 CSSValueID m_overflow; | 51 CSSValueID m_overflow; |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 DEFINE_CSS_VALUE_TYPE_CASTS(CSSContentDistributionValue, | 54 DEFINE_CSS_VALUE_TYPE_CASTS(CSSContentDistributionValue, |
| 54 isContentDistributionValue()); | 55 isContentDistributionValue()); |
| 55 | 56 |
| 56 } // namespace blink | 57 } // namespace blink |
| 57 | 58 |
| 58 #endif // CSSContentDistributionValue_h | 59 #endif // CSSContentDistributionValue_h |
| OLD | NEW |