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