Changeset 127555 in webkit
- Timestamp:
- Sep 4, 2012 10:33:59 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r127553 r127555 1 2012-09-04 Adam Barth <abarth@chromium.org> 2 3 Remove WTF_DEPRECATED_STRING_OPERATORS from StylePropertySet.cpp 4 https://bugs.webkit.org/show_bug.cgi?id=95800 5 6 Reviewed by Benjamin Poulain. 7 8 This patch is a re-spin of part of the patch from 9 https://bugs.webkit.org/show_bug.cgi?id=95502, but with the tests 10 fixed. :) 11 12 * css/StylePropertySet.cpp: 13 (WebCore::StylePropertySet::get4Values): 14 (WebCore::StylePropertySet::getLayeredShorthandValue): 15 1 16 2012-09-04 Keishi Hattori <keishi@webkit.org> 2 17 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r127540 r127555 301 301 bool showRight = (top->value()->cssText() != right->value()->cssText()) || showBottom; 302 302 303 String res = top->value()->cssText(); 304 if (showRight) 305 res += " " + right->value()->cssText(); 306 if (showBottom) 307 res += " " + bottom->value()->cssText(); 308 if (showLeft) 309 res += " " + left->value()->cssText(); 310 311 return res; 303 StringBuilder result; 304 result.append(top->value()->cssText()); 305 if (showRight) { 306 result.append(' '); 307 result.append(right->value()->cssText()); 308 } 309 if (showBottom) { 310 result.append(' '); 311 result.append(bottom->value()->cssText()); 312 } 313 if (showLeft) { 314 result.append(' '); 315 result.append(left->value()->cssText()); 316 } 317 return result.toString(); 312 318 } 313 319 314 320 String StylePropertySet::getLayeredShorthandValue(const StylePropertyShorthand& shorthand) const 315 321 { 316 String res;322 StringBuilder result; 317 323 318 324 const unsigned size = shorthand.length(); … … 335 341 // can safely be omitted. 336 342 for (size_t i = 0; i < numLayers; i++) { 337 String layerRes;343 StringBuilder layerResult; 338 344 bool useRepeatXShorthand = false; 339 345 bool useRepeatYShorthand = false; … … 389 395 390 396 if (value && !value->isImplicitInitialValue()) { 391 if (!layerRes .isNull())392 layerRes += " ";397 if (!layerResult.isEmpty()) 398 layerResult.append(' '); 393 399 if (foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize) 394 layerRes += "/ ";400 layerResult.appendLiteral("/ "); 395 401 if (!foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize) 396 402 continue; … … 398 404 if (useRepeatXShorthand) { 399 405 useRepeatXShorthand = false; 400 layerRes += getValueName(CSSValueRepeatX);406 layerResult.append(getValueName(CSSValueRepeatX)); 401 407 } else if (useRepeatYShorthand) { 402 408 useRepeatYShorthand = false; 403 layerRes += getValueName(CSSValueRepeatY);409 layerResult.append(getValueName(CSSValueRepeatY)); 404 410 } else if (useSingleWordShorthand) { 405 411 useSingleWordShorthand = false; 406 layerRes += value->cssText();412 layerResult.append(value->cssText()); 407 413 } else 408 layerRes += value->cssText();414 layerResult.append(value->cssText()); 409 415 410 416 if (shorthand.properties()[j] == CSSPropertyBackgroundPositionY) … … 413 419 } 414 420 415 if (!layerRes.isNull()) { 416 if (!res.isNull()) 417 res += ", "; 418 res += layerRes; 419 } 420 } 421 return res; 421 if (!layerResult.isEmpty()) { 422 if (!result.isEmpty()) 423 result.appendLiteral(", "); 424 result.append(layerResult); 425 } 426 } 427 if (result.isEmpty()) 428 return String(); 429 return result.toString(); 422 430 } 423 431
Note: See TracChangeset
for help on using the changeset viewer.