Bug 129586 - Find results on simple lines are not marked correctly
Summary: Find results on simple lines are not marked correctly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-03-02 17:01 PST by Antti Koivisto
Modified: 2014-03-03 13:06 PST (History)
0 users

See Also:


Attachments
patch (21.41 KB, patch)
2014-03-03 08:50 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
rebased (21.43 KB, patch)
2014-03-03 09:38 PST, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2014-03-02 17:01:37 PST
Some cases end up being O(n^2)
Comment 1 Antti Koivisto 2014-03-03 08:50:18 PST
Created attachment 225657 [details]
patch
Comment 2 Antti Koivisto 2014-03-03 08:50:53 PST
<rdar://problem/15618878>
Comment 3 Antti Koivisto 2014-03-03 09:38:41 PST
Created attachment 225662 [details]
rebased
Comment 4 Andreas Kling 2014-03-03 09:48:34 PST
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.)
Comment 5 Antti Koivisto 2014-03-03 13:06:08 PST
https://trac.webkit.org/r165002