2009-02-12 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Feb 2009 16:20:16 +0000 (16:20 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Feb 2009 16:20:16 +0000 (16:20 +0000)
commit16609798d789b3a0a1f4aa718e26d40faa5ee8bf
tree52ae2d382ae860ecd30dee676520cdbc0ccbf53f
parent5bfe2da6ec108048ae04eb5fb3b80cf4e11e3fed
2009-02-12  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        Speed up document.write a bit.

        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::documentWrite): Added. Uses SegmentedString to avoid conversion from
        UString to String and to avoid appending strings. Also added code to handle
        newlines efficiently.
        (WebCore::JSHTMLDocument::write): Changed to use documentWrite.
        (WebCore::JSHTMLDocument::writeln): Ditto.

        * dom/Document.cpp:
        (WebCore::Document::prepareToWrite): Added. Refactored the initialization part
        of write into a separate function for use in the JavaScript binding.
        (WebCore::Document::write): Changed to call prepareToWrite.

        * dom/Document.h: Added declaration for prepareToWrite.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/bindings/js/JSHTMLDocumentCustom.cpp
WebCore/dom/Document.cpp
WebCore/dom/Document.h