../WebCore: WebCore changes for: Find indicators overlap when a match spans multiple...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Dec 2011 05:20:02 +0000 (05:20 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Dec 2011 05:20:02 +0000 (05:20 +0000)
commite8cde4aa97423a1944c5e9097bb07a84588fcf69
tree146df3315633a53530fef6a6109cf438f78e4aa5
parentc025a3062924177d5e0ad45732afe05fbd30a0e1
../WebCore: WebCore changes for: Find indicators overlap when a match spans multiple text boxes
https://bugs.webkit.org/show_bug.cgi?id=75220

Reviewed by Darin Adler.

* WebCore.exp.in: Exported new unionRect(const Vector<FloatRect>&) and existing
FloatRect::intersects().
* platform/graphics/FloatRect.cpp:
(WebCore::unionRect): Added.
* platform/graphics/FloatRect.h:

../WebKit2: Find indicators overlap when a match spans multiple text boxes
https://bugs.webkit.org/show_bug.cgi?id=75220

Reviewed by Darin Adler.

* UIProcess/FindIndicator.cpp:
(WebKit::findIndicatorsForTextRectsOverlap): Added this helper function that checks for
pairwise intersections between all indicator rects.
(WebKit::FindIndicator::FindIndicator): Changed to use a single rect (the union of all text
rects) if any two indicator rects would otherwise overlap. This is similar to what Safari
does, and it eliminates overlapping rects for adjacent text boxes. In rare cases (such as when
a match spans two lines and adjacent text boxes on one of those lines) it results in a find
indicator that is too large and obscures some non-match text.
* UIProcess/FindIndicator.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/FloatRect.cpp
Source/WebCore/platform/graphics/FloatRect.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/FindIndicator.cpp
Source/WebKit2/UIProcess/FindIndicator.h