WebCore/ChangeLog

 12009-09-14 Shu Chang <Chang.Shu@nokia.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Need a short description and bug URL (OOPS!)
 6
 7 Optimize the code so only the text from start to end is scaned.
 8 https://bugs.webkit.org/show_bug.cgi?id=29092
 9
 10 On a platform with webkit+Qt+Symbian, the parsing time for a 600K text
 11 file improved 90% and overall loading time improved 20%.
 12 Ran WebKitTools/Scripts/run-webkit-tests, and no new problem was found.
 13
 14 * dom/Text.cpp:
 15 (WebCore::Text::createWithLengthLimit):
 16
1172009-09-14 Yael Aharon <yael.aharon@nokia.com>
218
319 Reviewed by Tor Arne Vestbø.
48354

WebCore/dom/Text.cpp

@@PassRefPtr<Text> Text::createWithLengthL
315315 unsigned end = start + min(charsLeft, maxChars);
316316
317317 // Check we are not on an unbreakable boundary.
318  TextBreakIterator* it = characterBreakIterator(data.characters(), dataLength);
319  if (end < dataLength && !isTextBreak(it, end))
320  end = textBreakPreceding(it, end);
321 
 318 if(end < dataLength) {
 319 TextBreakIterator* it = characterBreakIterator(data.characters() + start, end - start + 1);
 320 if (!isTextBreak(it, end - start))
 321 end = textBreakPreceding(it, end - start) + start;
 322 }
 323
322324 // If we have maxChars of unbreakable characters the above could lead to
323325 // an infinite loop.
324326 // FIXME: It would be better to just have the old value of end before calling
48354