Show
Ignore:
Timestamp:
03/12/07 16:57:56 (22 months ago)
Author:
antti
Message:

LayoutTests:

Reviewed by Alexey


Test that this works correctly with composed characters
http://bugs.webkit.org/show_bug.cgi?id=12833
REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
<rdar://problem/5028159>

  • fast/text/large-text-composed-char-expected.checksum: Added.
  • fast/text/large-text-composed-char-expected.png: Added.
  • fast/text/large-text-composed-char-expected.txt: Added.
  • fast/text/large-text-composed-char.html: Added.

WebCore:

Reviewed by Alexey.

Fix http://bugs.webkit.org/show_bug.cgi?id=12833
REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
<rdar://problem/5028159>


Divide large text blocks (>64kB) over multiple text nodes. This limits linebox searches to
a manageable subset.


  • dom/Text.cpp: (WebCore::Text::createWithLengthLimit):
  • dom/Text.h:
  • html/HTMLParser.cpp: (WebCore::HTMLParser::parseToken):
  • loader/TextDocument.cpp: (WebCore::TextTokenizer::write):
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/dom/Text.h

    r18874 r20127  
    2929 
    3030namespace WebCore { 
     31     
     32const unsigned cTextNodeLengthLimit = 1 << 16; 
    3133 
    3234class Text : public CharacterData 
     
    5759 
    5860    virtual String toString() const; 
     61     
     62    static PassRefPtr<Text> createWithLengthLimit(Document*, const String&, unsigned& charsLeft, unsigned maxChars = cTextNodeLengthLimit); 
    5963 
    6064#ifndef NDEBUG