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

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

Issue 1306823004: Split out String, URI and CustomIdent from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_attr_values
Patch Set: Fixing tests Created 5 years, 3 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/CSSStringValueBase.cpp
diff --git a/Source/core/css/CSSStringValueBase.cpp b/Source/core/css/CSSStringValueBase.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..473b0b49857f8a807a5859fb18c1aab6db9444b5
--- /dev/null
+++ b/Source/core/css/CSSStringValueBase.cpp
@@ -0,0 +1,28 @@
+// 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/CSSStringValueBase.h"
+
+#include "core/css/CSSMarkup.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+template<> String CSSStringValueBase<CSSValue::StringClass>::customCSSText() const
+{
+ return serializeString(m_string);
+}
+
+template<> String CSSStringValueBase<CSSValue::CustomIdentClass>::customCSSText() const
+{
+ return quoteCSSStringIfNeeded(m_string);
+}
+
+template<> String CSSStringValueBase<CSSValue::URIClass>::customCSSText() const
+{
+ return "url(" + quoteCSSURLIfNeeded(m_string) + ")";
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698