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

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

Issue 140883003: stringBuilder in CSSFilterValue::customCSSText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSFilterValue.cpp
diff --git a/Source/core/css/CSSFilterValue.cpp b/Source/core/css/CSSFilterValue.cpp
index 0bde847c406e39246bdf7fceeec4a6dcd44d254c..2ef89c255b7d7dbc58130c3b553fcd4956853178 100644
--- a/Source/core/css/CSSFilterValue.cpp
+++ b/Source/core/css/CSSFilterValue.cpp
@@ -26,7 +26,7 @@
#include "config.h"
#include "core/css/CSSFilterValue.h"
-#include "wtf/text/WTFString.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -38,46 +38,48 @@ CSSFilterValue::CSSFilterValue(FilterOperationType operationType)
String CSSFilterValue::customCSSText() const
{
- String result;
+ StringBuilder result;
switch (m_type) {
case ReferenceFilterOperation:
- result = "url(";
+ result.append("url(");
break;
case GrayscaleFilterOperation:
- result = "grayscale(";
+ result.append("grayscale(");
break;
case SepiaFilterOperation:
- result = "sepia(";
+ result.append("sepia(");
break;
case SaturateFilterOperation:
- result = "saturate(";
+ result.append("saturate(");
break;
case HueRotateFilterOperation:
- result = "hue-rotate(";
+ result.append("hue-rotate(");
break;
case InvertFilterOperation:
- result = "invert(";
+ result.append("invert(");
break;
case OpacityFilterOperation:
- result = "opacity(";
+ result.append("opacity(");
break;
case BrightnessFilterOperation:
- result = "brightness(";
+ result.append("brightness(");
break;
case ContrastFilterOperation:
- result = "contrast(";
+ result.append("contrast(");
break;
case BlurFilterOperation:
- result = "blur(";
+ result.append("blur(");
break;
case DropShadowFilterOperation:
- result = "drop-shadow(";
+ result.append("drop-shadow(");
break;
default:
break;
}
- return result + CSSValueList::customCSSText() + ")";
+ result.append(CSSValueList::customCSSText());
+ result.append(')');
+ return result.toString();
}
CSSFilterValue::CSSFilterValue(const CSSFilterValue& cloneFrom)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698