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

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: Rebase & removed dependent patchsets 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
« no previous file with comments | « Source/core/css/CSSCounterValue.h ('k') | Source/core/css/CSSPrimitiveValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6a1f0698768175dd1086da613b091acc7504ae67
--- /dev/null
+++ b/Source/core/css/CSSCounterValue.cpp
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// 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);
+}
+
+}
« no previous file with comments | « Source/core/css/CSSCounterValue.h ('k') | Source/core/css/CSSPrimitiveValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698