Changeset 129371 in webkit
- Timestamp:
- Sep 24, 2012 8:38:03 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129370 r129371 1 2012-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 1 10 2012-09-20 Emil A Eklund <eae@chromium.org> 2 11 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r128762 r129371 19 19 * Boston, MA 02110-1301, USA. 20 20 */ 21 22 #define WTF_DEPRECATED_STRING_OPERATORS23 21 24 22 #include "config.h" -
trunk/Source/WebKit/chromium/ChangeLog
r129337 r129371 1 2012-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 1 12 2012-09-24 Yury Semikhatsky <yurys@chromium.org> 2 13 -
trunk/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
r127540 r129371 76 76 // saved resource files. 77 77 78 #define WTF_DEPRECATED_STRING_OPERATORS79 80 78 #include "config.h" 81 79 #include "WebPageSerializerImpl.h" … … 301 299 SerializeDomParam* param) 302 300 { 303 // FIXME: use StringBuilder instead of String.304 301 bool needSkip; 302 StringBuilder result; 305 303 // Do pre action for open tag. 306 String result = preActionBeforeSerializeOpenTag(element, param, &needSkip);304 result.append(preActionBeforeSerializeOpenTag(element, param, &needSkip)); 307 305 if (needSkip) 308 306 return; 309 307 // Add open tag 310 result += "<" + element->nodeName().lower(); 308 result.append('<'); 309 result.append(element->nodeName().lower()); 311 310 // Go through all attributes and serialize them. 312 311 if (element->hasAttributes()) { 313 312 unsigned numAttrs = element->attributeCount(); 314 313 for (unsigned i = 0; i < numAttrs; i++) { 315 result += " ";314 result.append(' '); 316 315 // Add attribute pair 317 316 const Attribute *attribute = element->attributeItem(i); 318 result += attribute->name().toString();319 result += "=\"";317 result.append(attribute->name().toString()); 318 result.appendLiteral("=\""); 320 319 if (!attribute->value().isEmpty()) { 321 320 const String& attrValue = attribute->value(); … … 327 326 // For links start with "javascript:", we do not change it. 328 327 if (attrValue.startsWith("javascript:", false)) 329 result += attrValue;328 result.append(attrValue); 330 329 else { 331 330 // Get the absolute link … … 335 334 // Check whether we have local files for those link. 336 335 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)); 340 342 } else 341 result += completeURL;343 result.append(completeURL); 342 344 } 343 345 } else { 344 346 if (param->isHTMLDocument) 345 result += m_htmlEntities.convertEntitiesInString(attrValue);347 result.append(m_htmlEntities.convertEntitiesInString(attrValue)); 346 348 else 347 result += m_xmlEntities.convertEntitiesInString(attrValue);349 result.append(m_xmlEntities.convertEntitiesInString(attrValue)); 348 350 } 349 351 } 350 result += "\"";352 result.append('\"'); 351 353 } 352 354 } … … 356 358 // Complete the open tag for element when it has child/children. 357 359 if (element->hasChildNodes() || param->haveAddedContentsBeforeEnd) 358 result += ">";360 result.append('>'); 359 361 // Append the added contents generate in post action of open tag. 360 result += addedContents;362 result.append(addedContents); 361 363 // Save the result to data buffer. 362 saveHTMLContentToBuffer(result , param);364 saveHTMLContentToBuffer(result.toString(), param); 363 365 } 364 366 … … 368 370 { 369 371 bool needSkip; 372 StringBuilder result; 370 373 // Do pre action for end tag. 371 String result = preActionBeforeSerializeEndTag(element, 372 param, 373 &needSkip); 374 result.append(preActionBeforeSerializeEndTag(element, param, &needSkip)); 374 375 if (needSkip) 375 376 return; 376 377 // Write end tag when element has child/children. 377 378 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('>'); 381 382 } else { 382 383 // Check whether we have to write end tag for empty element. 383 384 if (param->isHTMLDocument) { 384 result += ">";385 result.append('>'); 385 386 // FIXME: This code is horribly wrong. WebPageSerializerImpl must die. 386 387 if (!static_cast<const HTMLElement*>(element)->ieForbidsInsertHTML()) { 387 388 // 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('>'); 391 392 } 392 393 } else { 393 394 // For xml base document. 394 result += " />";395 result.appendLiteral(" />"); 395 396 } 396 397 } 397 398 // Do post action for end tag. 398 result += postActionAfterSerializeEndTag(element, param);399 result.append(postActionAfterSerializeEndTag(element, param)); 399 400 // Save the result to data buffer. 400 saveHTMLContentToBuffer(result , param);401 saveHTMLContentToBuffer(result.toString(), param); 401 402 } 402 403
Note: See TracChangeset
for help on using the changeset viewer.