Changeset 127555 in webkit


Ignore:
Timestamp:
Sep 4, 2012 10:33:59 PM (12 years ago)
Author:
benjamin@webkit.org
Message:

Remove WTF_DEPRECATED_STRING_OPERATORS from StylePropertySet.cpp
https://bugs.webkit.org/show_bug.cgi?id=95800

Patch by Adam Barth <abarth@chromium.org> on 2012-09-04
Reviewed by Benjamin Poulain.

This patch is a re-spin of part of the patch from
https://bugs.webkit.org/show_bug.cgi?id=95502, but with the tests
fixed. :)

  • css/StylePropertySet.cpp:

(WebCore::StylePropertySet::get4Values):
(WebCore::StylePropertySet::getLayeredShorthandValue):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r127553 r127555  
     12012-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
    1162012-09-04  Keishi Hattori  <keishi@webkit.org>
    217
  • trunk/Source/WebCore/css/StylePropertySet.cpp

    r127540 r127555  
    301301    bool showRight = (top->value()->cssText() != right->value()->cssText()) || showBottom;
    302302
    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();
    312318}
    313319
    314320String StylePropertySet::getLayeredShorthandValue(const StylePropertyShorthand& shorthand) const
    315321{
    316     String res;
     322    StringBuilder result;
    317323
    318324    const unsigned size = shorthand.length();
     
    335341    // can safely be omitted.
    336342    for (size_t i = 0; i < numLayers; i++) {
    337         String layerRes;
     343        StringBuilder layerResult;
    338344        bool useRepeatXShorthand = false;
    339345        bool useRepeatYShorthand = false;
     
    389395
    390396            if (value && !value->isImplicitInitialValue()) {
    391                 if (!layerRes.isNull())
    392                     layerRes += " ";
     397                if (!layerResult.isEmpty())
     398                    layerResult.append(' ');
    393399                if (foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize)
    394                     layerRes += "/ ";
     400                    layerResult.appendLiteral("/ ");
    395401                if (!foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize)
    396402                    continue;
     
    398404                if (useRepeatXShorthand) {
    399405                    useRepeatXShorthand = false;
    400                     layerRes += getValueName(CSSValueRepeatX);
     406                    layerResult.append(getValueName(CSSValueRepeatX));
    401407                } else if (useRepeatYShorthand) {
    402408                    useRepeatYShorthand = false;
    403                     layerRes += getValueName(CSSValueRepeatY);
     409                    layerResult.append(getValueName(CSSValueRepeatY));
    404410                } else if (useSingleWordShorthand) {
    405411                    useSingleWordShorthand = false;
    406                     layerRes += value->cssText();
     412                    layerResult.append(value->cssText());
    407413                } else
    408                     layerRes += value->cssText();
     414                    layerResult.append(value->cssText());
    409415
    410416                if (shorthand.properties()[j] == CSSPropertyBackgroundPositionY)
     
    413419        }
    414420
    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();
    422430}
    423431
Note: See TracChangeset for help on using the changeset viewer.