Some cases end up being O(n^2)
Created attachment 225657 [details] patch
<rdar://problem/15618878>
Created attachment 225662 [details] rebased
Comment on attachment 225662 [details] rebased View in context: https://bugs.webkit.org/attachment.cgi?id=225662&action=review r=me > Source/WebCore/editing/TextIterator.cpp:544 > - while (runEnd < str.length() && (deprecatedIsCollapsibleWhitespace(str[runEnd]) || str[runEnd] == '\t')) > + while (runEnd < end && (deprecatedIsCollapsibleWhitespace(str[runEnd]) || str[runEnd] == '\t')) It irks me that we are calling operator[] on WTF::String in a loop instead of at least just operating on the StringImpl, but this is hardly time||place for that kinda cleanup. > Source/WebCore/editing/TextIterator.cpp:1304 > - if (!renderer->firstTextBox() && text.length() > 0) > + if (!renderer->hasRenderedText() && text.length() > 0) We should make the fat linebox getters assert that we are not in simple linebox mode. (Or better yet, abstract away the ability to call them in the wrong context by encapsulating lines.)
https://trac.webkit.org/r165002