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

Side by Side Diff: Source/core/css/CSSCalculationValue.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSBasicShapes.cpp ('k') | Source/core/css/CSSComputedStyleDeclaration.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 case CSSPrimitiveValue::CSS_VALUE_ID: 139 case CSSPrimitiveValue::CSS_VALUE_ID:
140 return false; 140 return false;
141 }; 141 };
142 ASSERT_NOT_REACHED(); 142 ASSERT_NOT_REACHED();
143 return false; 143 return false;
144 } 144 }
145 145
146 static String buildCSSText(const String& expression) 146 static String buildCSSText(const String& expression)
147 { 147 {
148 StringBuilder result; 148 StringBuilder result;
149 result.append("calc"); 149 result.appendLiteral("calc");
150 bool expressionHasSingleTerm = expression[0] != '('; 150 bool expressionHasSingleTerm = expression[0] != '(';
151 if (expressionHasSingleTerm) 151 if (expressionHasSingleTerm)
152 result.append('('); 152 result.append('(');
153 result.append(expression); 153 result.append(expression);
154 if (expressionHasSingleTerm) 154 if (expressionHasSingleTerm)
155 result.append(')'); 155 result.append(')');
156 return result.toString(); 156 return result.toString();
157 } 157 }
158 158
159 String CSSCalcValue::customCSSText() const 159 String CSSCalcValue::customCSSText() const
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 return adoptRefWillBeNoop(new CSSCalcValue(expression, range)); 765 return adoptRefWillBeNoop(new CSSCalcValue(expression, range));
766 } 766 }
767 767
768 void CSSCalcValue::traceAfterDispatch(Visitor* visitor) 768 void CSSCalcValue::traceAfterDispatch(Visitor* visitor)
769 { 769 {
770 visitor->trace(m_expression); 770 visitor->trace(m_expression);
771 CSSValue::traceAfterDispatch(visitor); 771 CSSValue::traceAfterDispatch(visitor);
772 } 772 }
773 773
774 } // namespace blink 774 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSBasicShapes.cpp ('k') | Source/core/css/CSSComputedStyleDeclaration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698