Title: [110653] trunk/Source/WebKit2
Revision
110653
Author
[email protected]
Date
2012-03-13 18:09:47 -0700 (Tue, 13 Mar 2012)

Log Message

Find bouncy doesn’t hide when a subframe is scrolled
https://bugs.webkit.org/show_bug.cgi?id=81060
<rdar://problem/9365329>

Reviewed by Andreas Kling.

Instead of hiding the find indicator when pageDidScroll is called, add a check to FindController::drawRect and hide
the find indicator there if the find selection bounds have changed since the last call to drawRect.

* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
(WebKit::FindController::drawRect):
* WebProcess/WebPage/FindController.h:
(FindController):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pageDidScroll):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (110652 => 110653)


--- trunk/Source/WebKit2/ChangeLog	2012-03-14 01:07:29 UTC (rev 110652)
+++ trunk/Source/WebKit2/ChangeLog	2012-03-14 01:09:47 UTC (rev 110653)
@@ -1,3 +1,22 @@
+2012-03-13  Anders Carlsson  <[email protected]>
+
+        Find bouncy doesn’t hide when a subframe is scrolled
+        https://bugs.webkit.org/show_bug.cgi?id=81060
+        <rdar://problem/9365329>
+
+        Reviewed by Andreas Kling.
+
+        Instead of hiding the find indicator when pageDidScroll is called, add a check to FindController::drawRect and hide
+        the find indicator there if the find selection bounds have changed since the last call to drawRect.
+
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindIndicator):
+        (WebKit::FindController::drawRect):
+        * WebProcess/WebPage/FindController.h:
+        (FindController):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::pageDidScroll):
+
 2012-03-13  Jeff Miller  <[email protected]>
 
         Support loading a WKPage from web archive data

Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (110652 => 110653)


--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2012-03-14 01:07:29 UTC (rev 110652)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2012-03-14 01:09:47 UTC (rev 110653)
@@ -216,6 +216,7 @@
     }            
 
     m_webPage->send(Messages::WebPageProxy::SetFindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage->corePage()->deviceScaleFactor(), handle, !isShowingOverlay, shouldAnimate));
+    m_findIndicatorRect = selectionRectInWindowCoordinates;
     m_isShowingFindIndicator = true;
 
     return true;
@@ -347,6 +348,16 @@
     // Clear out the holes.
     for (size_t i = 0; i < rects.size(); ++i)
         graphicsContext.fillRect(rects[i]);
+
+    if (!m_isShowingFindIndicator)
+        return;
+
+    if (Frame* selectedFrame = frameWithSelection(m_webPage->corePage())) {
+        IntRect findIndicatorRect = selectedFrame->view()->contentsToWindow(enclosingIntRect(selectedFrame->selection()->bounds()));
+
+        if (findIndicatorRect != m_findIndicatorRect)
+            hideFindIndicator();
+    }
 }
 
 bool FindController::mouseEvent(PageOverlay* pageOverlay, const WebMouseEvent& mouseEvent)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.h (110652 => 110653)


--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.h	2012-03-14 01:07:29 UTC (rev 110652)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.h	2012-03-14 01:09:47 UTC (rev 110653)
@@ -28,13 +28,13 @@
 
 #include "PageOverlay.h"
 #include "WebFindOptions.h"
+#include <WebCore/IntRect.h>
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
     class Frame;
-    class IntRect;
 }
 
 namespace WebKit {
@@ -77,6 +77,7 @@
     // Whether the UI process is showing the find indicator. Note that this can be true even if
     // the find indicator isn't showing, but it will never be false when it is showing.
     bool m_isShowingFindIndicator;
+    WebCore::IntRect m_findIndicatorRect;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (110652 => 110653)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-03-14 01:07:29 UTC (rev 110652)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-03-14 01:09:47 UTC (rev 110653)
@@ -1163,9 +1163,6 @@
 
 void WebPage::pageDidScroll()
 {
-    // Hide the find indicator.
-    m_findController.hideFindIndicator();
-
     m_uiClient.pageDidScroll(this);
 
     send(Messages::WebPageProxy::PageDidScroll());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to