summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/WebProcess/WebPage/FindController.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-25 19:08:45 +0100
committerSteve Block <steveblock@google.com>2011-06-08 13:51:31 +0100
commit2bde8e466a4451c7319e3a072d118917957d6554 (patch)
tree28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebKit2/WebProcess/WebPage/FindController.cpp
parent6939c99b71d9372d14a0c74a772108052e8c48c8 (diff)
downloadexternal_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/FindController.cpp')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/FindController.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/FindController.cpp b/Source/WebKit2/WebProcess/WebPage/FindController.cpp
index 8e9dba7..3e7b268 100644
--- a/Source/WebKit2/WebProcess/WebPage/FindController.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/FindController.cpp
@@ -153,6 +153,10 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve
return false;
IntRect selectionRect = enclosingIntRect(selectedFrame->selection()->bounds());
+
+ // Selection rect can be empty for matches that are currently obscured from view.
+ if (selectionRect.isEmpty())
+ return false;
// We want the selection rect in window coordinates.
IntRect selectionRectInWindowCoordinates = selectedFrame->view()->contentsToWindow(selectionRect);
@@ -161,7 +165,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve
selectedFrame->selection()->getClippedVisibleTextRectangles(textRects);
// Create a backing store and paint the find indicator text into it.
- RefPtr<ShareableBitmap> findIndicatorTextBackingStore = ShareableBitmap::createShareable(selectionRect.size());
+ RefPtr<ShareableBitmap> findIndicatorTextBackingStore = ShareableBitmap::createShareable(selectionRect.size(), ShareableBitmap::SupportsAlpha);
if (!findIndicatorTextBackingStore)
return false;
@@ -178,7 +182,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve
selectedFrame->view()->paint(graphicsContext.get(), paintRect);
selectedFrame->view()->setPaintBehavior(PaintBehaviorNormal);
- SharedMemory::Handle handle;
+ ShareableBitmap::Handle handle;
if (!findIndicatorTextBackingStore->createHandle(handle))
return false;
@@ -203,7 +207,7 @@ void FindController::hideFindIndicator()
if (!m_isShowingFindIndicator)
return;
- SharedMemory::Handle handle;
+ ShareableBitmap::Handle handle;
m_webPage->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), handle, false));
m_isShowingFindIndicator = false;
}