Bug 75220 - Find indicators overlap when a match spans multiple text boxes
Summary: Find indicators overlap when a match spans multiple text boxes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: mitz
URL:
Keywords: InRadar
: 69816 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-25 20:49 PST by mitz
Modified: 2012-04-11 09:54 PDT (History)
2 users (show)

See Also:


Attachments
If find indicators for individual text boxes would overlap, use a single find indicator encompassing all text boxes (6.96 KB, patch)
2011-12-25 20:57 PST, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2011-12-25 20:49:34 PST
Find indicators overlap when a match spans multiple text boxes
Comment 1 mitz 2011-12-25 20:57:21 PST
Created attachment 120522 [details]
If find indicators for individual text boxes would overlap, use a single find indicator encompassing all text boxes
Comment 2 Darin Adler 2011-12-25 21:00:40 PST
Comment on attachment 120522 [details]
If find indicators for individual text boxes would overlap, use a single find indicator encompassing all text boxes

View in context: https://bugs.webkit.org/attachment.cgi?id=120522&action=review

> Source/WebCore/ChangeLog:8
> +        * WebCore.exp.in: Exported new unionRect(const Vector<FloatRect>&) and exisitng

Typo: exisitng

> Source/WebCore/platform/graphics/FloatRect.h:243
> +FloatRect unionRect(const Vector<FloatRect>&);

Wish there was a generic way to make this take any collection with begin/end instead of just a Vector specifically.

> Source/WebKit2/UIProcess/FindIndicator.cpp:90
> +static bool findIndicatorsForTextRectsOverlap(const Vector<WebCore::FloatRect>& textRects)

No need for WebCore:: prefix here.

> Source/WebKit2/UIProcess/FindIndicator.cpp:108
> +        for (size_t j = indicatorRects.size(); j; ) {
> +            --j;
> +            if (indicatorRect.intersects(indicatorRects[j]))
> +                return true;
> +        }

Is there any way to mitigate the n^2 nature of this algorithm?
Comment 3 mitz 2011-12-25 21:21:49 PST
(In reply to comment #2)
> (From update of attachment 120522 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=120522&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        * WebCore.exp.in: Exported new unionRect(const Vector<FloatRect>&) and exisitng
> 
> Typo: exisitng

Fixed.

> > Source/WebKit2/UIProcess/FindIndicator.cpp:90
> > +static bool findIndicatorsForTextRectsOverlap(const Vector<WebCore::FloatRect>& textRects)
> 
> No need for WebCore:: prefix here.

Fixed.

> 
> > Source/WebKit2/UIProcess/FindIndicator.cpp:108
> > +        for (size_t j = indicatorRects.size(); j; ) {
> > +            --j;
> > +            if (indicatorRect.intersects(indicatorRects[j]))
> > +                return true;
> > +        }
> 
> Is there any way to mitigate the n^2 nature of this algorithm?

Sadly, I don’t know the answer.

Thanks for the review!

Landed in <http://trac.webkit.org/r103677>.
Comment 4 Alexey Proskuryakov 2011-12-25 21:23:48 PST
*** Bug 69816 has been marked as a duplicate of this bug. ***
Comment 5 mitz 2012-04-11 09:54:42 PDT
<rdar://problem/11215218>