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