| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/CSSCounterValue.h" | 5 #include "core/css/CSSCounterValue.h" |
| 6 | 6 |
| 7 #include "core/css/CSSMarkup.h" | 7 #include "core/css/CSSMarkup.h" |
| 8 #include "wtf/text/StringBuilder.h" | 8 #include "wtf/text/StringBuilder.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 namespace cssvalue { |
| 13 |
| 12 String CSSCounterValue::customCSSText() const { | 14 String CSSCounterValue::customCSSText() const { |
| 13 StringBuilder result; | 15 StringBuilder result; |
| 14 if (separator().isEmpty()) | 16 if (separator().isEmpty()) |
| 15 result.append("counter("); | 17 result.append("counter("); |
| 16 else | 18 else |
| 17 result.append("counters("); | 19 result.append("counters("); |
| 18 | 20 |
| 19 result.append(identifier()); | 21 result.append(identifier()); |
| 20 if (!separator().isEmpty()) { | 22 if (!separator().isEmpty()) { |
| 21 result.append(", "); | 23 result.append(", "); |
| 22 result.append(m_separator->cssText()); | 24 result.append(m_separator->cssText()); |
| 23 } | 25 } |
| 24 bool isDefaultListStyle = listStyle() == CSSValueDecimal; | 26 bool isDefaultListStyle = listStyle() == CSSValueDecimal; |
| 25 if (!isDefaultListStyle) { | 27 if (!isDefaultListStyle) { |
| 26 result.append(", "); | 28 result.append(", "); |
| 27 result.append(m_listStyle->cssText()); | 29 result.append(m_listStyle->cssText()); |
| 28 } | 30 } |
| 29 result.append(')'); | 31 result.append(')'); |
| 30 | 32 |
| 31 return result.toString(); | 33 return result.toString(); |
| 32 } | 34 } |
| 33 | 35 |
| 34 DEFINE_TRACE_AFTER_DISPATCH(CSSCounterValue) { | 36 DEFINE_TRACE_AFTER_DISPATCH(CSSCounterValue) { |
| 35 visitor->trace(m_identifier); | 37 visitor->trace(m_identifier); |
| 36 visitor->trace(m_listStyle); | 38 visitor->trace(m_listStyle); |
| 37 visitor->trace(m_separator); | 39 visitor->trace(m_separator); |
| 38 CSSValue::traceAfterDispatch(visitor); | 40 CSSValue::traceAfterDispatch(visitor); |
| 39 } | 41 } |
| 40 | 42 |
| 43 } // namespace cssvalue |
| 44 |
| 41 } // namespace blink | 45 } // namespace blink |
| OLD | NEW |