Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: third_party/WebKit/Source/core/css/CSSCounterValue.cpp

Issue 1933713002: Store separator info of counters as CSSStringValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 String CSSCounterValue::customCSSText() const 12 String CSSCounterValue::customCSSText() const
13 { 13 {
14 StringBuilder result; 14 StringBuilder result;
15 if (separator().isEmpty()) 15 if (separator().isEmpty())
16 result.appendLiteral("counter("); 16 result.appendLiteral("counter(");
17 else 17 else
18 result.appendLiteral("counters("); 18 result.appendLiteral("counters(");
19 19
20 result.append(identifier()); 20 result.append(identifier());
21 if (!separator().isEmpty()) { 21 if (!separator().isEmpty()) {
22 result.appendLiteral(", "); 22 result.appendLiteral(", ");
23 result.append(serializeString(separator())); 23 result.append(m_separator->cssText());
24 } 24 }
25 bool isDefaultListStyle = listStyle() == CSSValueDecimal; 25 bool isDefaultListStyle = listStyle() == CSSValueDecimal;
26 if (!isDefaultListStyle) { 26 if (!isDefaultListStyle) {
27 result.appendLiteral(", "); 27 result.appendLiteral(", ");
28 result.append(m_listStyle->cssText()); 28 result.append(m_listStyle->cssText());
29 } 29 }
30 result.append(')'); 30 result.append(')');
31 31
32 return result.toString(); 32 return result.toString();
33 } 33 }
34 34
35 DEFINE_TRACE_AFTER_DISPATCH(CSSCounterValue) 35 DEFINE_TRACE_AFTER_DISPATCH(CSSCounterValue)
36 { 36 {
37 visitor->trace(m_identifier); 37 visitor->trace(m_identifier);
38 visitor->trace(m_listStyle); 38 visitor->trace(m_listStyle);
39 visitor->trace(m_separator); 39 visitor->trace(m_separator);
40 CSSValue::traceAfterDispatch(visitor); 40 CSSValue::traceAfterDispatch(visitor);
41 } 41 }
42 42
43 } // namespace blink 43 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698