Index: Source/core/css/CSSCounterValue.cpp |
diff --git a/Source/core/css/CSSCounterValue.cpp b/Source/core/css/CSSCounterValue.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cf5ca26f0aeba403f0ef938a731960101916c187 |
--- /dev/null |
+++ b/Source/core/css/CSSCounterValue.cpp |
@@ -0,0 +1,44 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
Timothy Loh
2015/08/21 07:33:12
2015?
sashab
2015/08/24 01:36:11
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/css/CSSCounterValue.h" |
+ |
+#include "core/css/CSSMarkup.h" |
+#include "wtf/text/StringBuilder.h" |
+ |
+namespace blink { |
+ |
+String CSSCounterValue::customCSSText() const |
+{ |
+ StringBuilder result; |
+ if (separator().isEmpty()) |
+ result.appendLiteral("counter("); |
+ else |
+ result.appendLiteral("counters("); |
+ |
+ result.append(identifier()); |
+ if (!separator().isEmpty()) { |
+ result.appendLiteral(", "); |
+ result.append(serializeString(separator())); |
+ } |
+ bool isDefaultListStyle = listStyleIdent() == CSSValueDecimal; |
+ if (!listStyle().isEmpty() && !isDefaultListStyle) { |
+ result.appendLiteral(", "); |
+ result.append(listStyle()); |
+ } |
+ result.append(')'); |
+ |
+ return result.toString(); |
+} |
+ |
+DEFINE_TRACE_AFTER_DISPATCH(CSSCounterValue) |
+{ |
+ visitor->trace(m_identifier); |
+ visitor->trace(m_listStyle); |
+ visitor->trace(m_separator); |
+ CSSValue::traceAfterDispatch(visitor); |
+} |
+ |
+} |