Title: [148770] trunk/Source/WebCore
Revision
148770
Author
[email protected]
Date
2013-04-19 14:10:34 -0700 (Fri, 19 Apr 2013)

Log Message

StyledMarkupAccumulator::appendText() should not allocate an intermediary StringBuilder
https://bugs.webkit.org/show_bug.cgi?id=114847

Reviewed by Geoffrey Garen.

For some reason StyledMarkupAccumulator::appendText() was allocating a separate buffer
for invoking appendStyleNodeOpenTag. This is a bad idea.

* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
(WebCore::StyledMarkupAccumulator::appendText):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (148769 => 148770)


--- trunk/Source/WebCore/ChangeLog	2013-04-19 21:06:06 UTC (rev 148769)
+++ trunk/Source/WebCore/ChangeLog	2013-04-19 21:10:34 UTC (rev 148770)
@@ -1,3 +1,17 @@
+2013-04-19  Benjamin Poulain  <[email protected]>
+
+        StyledMarkupAccumulator::appendText() should not allocate an intermediary StringBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=114847
+
+        Reviewed by Geoffrey Garen.
+
+        For some reason StyledMarkupAccumulator::appendText() was allocating a separate buffer
+        for invoking appendStyleNodeOpenTag. This is a bad idea.
+
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
+        (WebCore::StyledMarkupAccumulator::appendText):
+
 2013-04-19  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Support the SourceMap header, X-SourceMap was deprecated

Modified: trunk/Source/WebCore/editing/markup.cpp (148769 => 148770)


--- trunk/Source/WebCore/editing/markup.cpp	2013-04-19 21:06:06 UTC (rev 148769)
+++ trunk/Source/WebCore/editing/markup.cpp	2013-04-19 21:10:34 UTC (rev 148770)
@@ -197,8 +197,7 @@
     else
         out.appendLiteral("<span style=\"");
     appendAttributeValue(out, style->asText(), document->isHTMLDocument());
-    out.append('\"');
-    out.append('>');
+    out.appendLiteral("\">");
 }
 
 const String& StyledMarkupAccumulator::styleNodeCloseTag(bool isBlock)
@@ -234,9 +233,7 @@
         // FIXME: Should this be included in forceInline?
         wrappingStyle->style()->setProperty(CSSPropertyFloat, CSSValueNone);
 
-        StringBuilder openTag;
-        appendStyleNodeOpenTag(openTag, wrappingStyle->style(), text->document());
-        out.append(openTag.characters(), openTag.length());
+        appendStyleNodeOpenTag(out, wrappingStyle->style(), text->document());
     }
 
     if (!shouldAnnotate() || parentIsTextarea)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to