HTMLConstructionSite::insertTextNode isn't optimized for 8 bit strings
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2012 18:41:05 +0000 (18:41 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2012 18:41:05 +0000 (18:41 +0000)
commit12fc9eef2fb6179202dc7a8415aa551c6974fc90
tree9f99e44777e44a30dbec7f3c5bb6fcb28bc475ee
parenta54945a5f598da4ad31ada3a2a7d6cf0bd5ad69c
HTMLConstructionSite::insertTextNode isn't optimized for 8 bit strings
https://bugs.webkit.org/show_bug.cgi?id=97740

Reviewed by Darin Adler.

Source/WebCore:

Changed parserAppendData to take a string instead of a UChar*.  Also added an optional offset
argument to handle string+offset.  The actual string append now uses the appropriate string
size.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
* dom/CharacterData.h:
(CharacterData):
* dom/Text.cpp:
(WebCore::Text::createWithLengthLimit):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertTextNode):

Source/WTF:

Added an append method that takes an LChar source.  Made both the UChar and LChar versions optimally handle
the appendee and appendend string bitness.

* wtf/text/WTFString.cpp:
(WTF::String::append):
* wtf/text/WTFString.h:
(String):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/text/WTFString.cpp
Source/WTF/wtf/text/WTFString.h
Source/WebCore/ChangeLog
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/CharacterData.h
Source/WebCore/dom/Text.cpp
Source/WebCore/html/parser/HTMLConstructionSite.cpp