From 2bde8e466a4451c7319e3a072d118917957d6554 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 25 May 2011 19:08:45 +0100 Subject: Merge WebKit at r82507: Initial merge by git Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e --- Source/WebKit2/WebProcess/WebPage/FindController.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Source/WebKit2/WebProcess/WebPage/FindController.cpp') 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 findIndicatorTextBackingStore = ShareableBitmap::createShareable(selectionRect.size()); + RefPtr 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(), handle, false)); m_isShowingFindIndicator = false; } -- cgit v1.1