Changeset 129371 in webkit


Ignore:
Timestamp:
Sep 24, 2012 8:38:03 AM (12 years ago)
Author:
Patrick Gansterer
Message:

Remove remaining WTF_DEPRECATED_STRING_OPERATORS from cpp files
https://bugs.webkit.org/show_bug.cgi?id=97412

Reviewed by Adam Barth.

Source/WebCore:

  • css/StylePropertySet.cpp: Removed useless define.

Source/WebKit/chromium:

  • src/WebPageSerializerImpl.cpp:

(WebKit::WebPageSerializerImpl::openTagToString): Replaced operator+= with StringBuilder::append().
(WebKit::WebPageSerializerImpl::endTagToString): Ditto.

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r129370 r129371  
     12012-09-24  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Remove remaining WTF_DEPRECATED_STRING_OPERATORS from cpp files
     4        https://bugs.webkit.org/show_bug.cgi?id=97412
     5
     6        Reviewed by Adam Barth.
     7
     8        * css/StylePropertySet.cpp: Removed useless define.
     9
    1102012-09-20  Emil A Eklund  <eae@chromium.org>
    211
  • trunk/Source/WebCore/css/StylePropertySet.cpp

    r128762 r129371  
    1919 * Boston, MA 02110-1301, USA.
    2020 */
    21 
    22 #define WTF_DEPRECATED_STRING_OPERATORS
    2321
    2422#include "config.h"
  • trunk/Source/WebKit/chromium/ChangeLog

    r129337 r129371  
     12012-09-24  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Remove remaining WTF_DEPRECATED_STRING_OPERATORS from cpp files
     4        https://bugs.webkit.org/show_bug.cgi?id=97412
     5
     6        Reviewed by Adam Barth.
     7
     8        * src/WebPageSerializerImpl.cpp:
     9        (WebKit::WebPageSerializerImpl::openTagToString): Replaced operator+= with StringBuilder::append().
     10        (WebKit::WebPageSerializerImpl::endTagToString): Ditto.
     11
    1122012-09-24  Yury Semikhatsky  <yurys@chromium.org>
    213
  • trunk/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp

    r127540 r129371  
    7676// saved resource files.
    7777
    78 #define WTF_DEPRECATED_STRING_OPERATORS
    79 
    8078#include "config.h"
    8179#include "WebPageSerializerImpl.h"
     
    301299                                            SerializeDomParam* param)
    302300{
    303     // FIXME: use StringBuilder instead of String.
    304301    bool needSkip;
     302    StringBuilder result;
    305303    // Do pre action for open tag.
    306     String result = preActionBeforeSerializeOpenTag(element, param, &needSkip);
     304    result.append(preActionBeforeSerializeOpenTag(element, param, &needSkip));
    307305    if (needSkip)
    308306        return;
    309307    // Add open tag
    310     result += "<" + element->nodeName().lower();
     308    result.append('<');
     309    result.append(element->nodeName().lower());
    311310    // Go through all attributes and serialize them.
    312311    if (element->hasAttributes()) {
    313312        unsigned numAttrs = element->attributeCount();
    314313        for (unsigned i = 0; i < numAttrs; i++) {
    315             result += " ";
     314            result.append(' ');
    316315            // Add attribute pair
    317316            const Attribute *attribute = element->attributeItem(i);
    318             result += attribute->name().toString();
    319             result += "=\"";
     317            result.append(attribute->name().toString());
     318            result.appendLiteral("=\"");
    320319            if (!attribute->value().isEmpty()) {
    321320                const String& attrValue = attribute->value();
     
    327326                    // For links start with "javascript:", we do not change it.
    328327                    if (attrValue.startsWith("javascript:", false))
    329                         result += attrValue;
     328                        result.append(attrValue);
    330329                    else {
    331330                        // Get the absolute link
     
    335334                        // Check whether we have local files for those link.
    336335                        if (m_localLinks.contains(completeURL)) {
    337                             if (!param->directoryName.isEmpty())
    338                                 result += "./" + param->directoryName + "/";
    339                             result += m_localLinks.get(completeURL);
     336                            if (!param->directoryName.isEmpty()) {
     337                                result.appendLiteral("./");
     338                                result.append(param->directoryName);
     339                                result.append('/');
     340                            }
     341                            result.append(m_localLinks.get(completeURL));
    340342                        } else
    341                             result += completeURL;
     343                            result.append(completeURL);
    342344                    }
    343345                } else {
    344346                    if (param->isHTMLDocument)
    345                         result += m_htmlEntities.convertEntitiesInString(attrValue);
     347                        result.append(m_htmlEntities.convertEntitiesInString(attrValue));
    346348                    else
    347                         result += m_xmlEntities.convertEntitiesInString(attrValue);
     349                        result.append(m_xmlEntities.convertEntitiesInString(attrValue));
    348350                }
    349351            }
    350             result += "\"";
     352            result.append('\"');
    351353        }
    352354    }
     
    356358    // Complete the open tag for element when it has child/children.
    357359    if (element->hasChildNodes() || param->haveAddedContentsBeforeEnd)
    358         result += ">";
     360        result.append('>');
    359361    // Append the added contents generate in  post action of open tag.
    360     result += addedContents;
     362    result.append(addedContents);
    361363    // Save the result to data buffer.
    362     saveHTMLContentToBuffer(result, param);
     364    saveHTMLContentToBuffer(result.toString(), param);
    363365}
    364366
     
    368370{
    369371    bool needSkip;
     372    StringBuilder result;
    370373    // Do pre action for end tag.
    371     String result = preActionBeforeSerializeEndTag(element,
    372                                                    param,
    373                                                    &needSkip);
     374    result.append(preActionBeforeSerializeEndTag(element, param, &needSkip));
    374375    if (needSkip)
    375376        return;
    376377    // Write end tag when element has child/children.
    377378    if (element->hasChildNodes() || param->haveAddedContentsBeforeEnd) {
    378         result += "</";
    379         result += element->nodeName().lower();
    380         result += ">";
     379        result.appendLiteral("</");
     380        result.append(element->nodeName().lower());
     381        result.append('>');
    381382    } else {
    382383        // Check whether we have to write end tag for empty element.
    383384        if (param->isHTMLDocument) {
    384             result += ">";
     385            result.append('>');
    385386            // FIXME: This code is horribly wrong.  WebPageSerializerImpl must die.
    386387            if (!static_cast<const HTMLElement*>(element)->ieForbidsInsertHTML()) {
    387388                // We need to write end tag when it is required.
    388                 result += "</";
    389                 result += element->nodeName().lower();
    390                 result += ">";
     389                result.appendLiteral("</");
     390                result.append(element->nodeName().lower());
     391                result.append('>');
    391392            }
    392393        } else {
    393394            // For xml base document.
    394             result += " />";
     395            result.appendLiteral(" />");
    395396        }
    396397    }
    397398    // Do post action for end tag.
    398     result += postActionAfterSerializeEndTag(element, param);
     399    result.append(postActionAfterSerializeEndTag(element, param));
    399400    // Save the result to data buffer.
    400     saveHTMLContentToBuffer(result, param);
     401    saveHTMLContentToBuffer(result.toString(), param);
    401402}
    402403
Note: See TracChangeset for help on using the changeset viewer.