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

Unified Diff: Source/core/css/CSSCounterValue.cpp

Issue 1303153003: Change Counter to be a CSSValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oilpan fix Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
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);
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698