Changeset 148770 in webkit


Ignore:
Timestamp:
Apr 19, 2013 2:10:34 PM (11 years ago)
Author:
benjamin@webkit.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148769 r148770  
     12013-04-19  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        StyledMarkupAccumulator::appendText() should not allocate an intermediary StringBuilder
     4        https://bugs.webkit.org/show_bug.cgi?id=114847
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        For some reason StyledMarkupAccumulator::appendText() was allocating a separate buffer
     9        for invoking appendStyleNodeOpenTag. This is a bad idea.
     10
     11        * editing/markup.cpp:
     12        (WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
     13        (WebCore::StyledMarkupAccumulator::appendText):
     14
    1152013-04-19  Joseph Pecoraro  <pecoraro@apple.com>
    216
  • trunk/Source/WebCore/editing/markup.cpp

    r146264 r148770  
    198198        out.appendLiteral("<span style=\"");
    199199    appendAttributeValue(out, style->asText(), document->isHTMLDocument());
    200     out.append('\"');
    201     out.append('>');
     200    out.appendLiteral("\">");
    202201}
    203202
     
    235234        wrappingStyle->style()->setProperty(CSSPropertyFloat, CSSValueNone);
    236235
    237         StringBuilder openTag;
    238         appendStyleNodeOpenTag(openTag, wrappingStyle->style(), text->document());
    239         out.append(openTag.characters(), openTag.length());
     236        appendStyleNodeOpenTag(out, wrappingStyle->style(), text->document());
    240237    }
    241238
Note: See TracChangeset for help on using the changeset viewer.