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

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

Issue 16736004: Stylesheet rule.cssText of content property should be quoted when the value is string. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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/CSSValueList.cpp
diff --git a/Source/core/css/CSSValueList.cpp b/Source/core/css/CSSValueList.cpp
index 1a6adf92aae4518e15ad96533f07ed4bc96b9ab2..4bfa82bb78477b4c61c17c7b960848380cbc70cc 100644
--- a/Source/core/css/CSSValueList.cpp
+++ b/Source/core/css/CSSValueList.cpp
@@ -97,7 +97,7 @@ PassRefPtr<CSSValueList> CSSValueList::copy()
return newList.release();
}
-String CSSValueList::customCssText() const
+String CSSValueList::customCssText(bool forceQuoteString) const
{
StringBuilder result;
String separator;
@@ -119,7 +119,10 @@ String CSSValueList::customCssText() const
for (unsigned i = 0; i < size; i++) {
if (!result.isEmpty())
result.append(separator);
- result.append(m_values[i]->cssText());
+ if (forceQuoteString && m_values[i]->isPrimitiveValue())
+ result.append(toCSSPrimitiveValue(m_values[i].get())->customCssText(true));
+ else
+ result.append(m_values[i]->cssText());
}
return result.toString();

Powered by Google App Engine
This is Rietveld 408576698