[WK2] FindController::hideFindUI should unmark highlighted text matches
authorsergio@webkit.org <sergio@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 09:54:28 +0000 (09:54 +0000)
committersergio@webkit.org <sergio@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 09:54:28 +0000 (09:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77747

Reviewed by Carlos Garcia Campos.

Unmark all text matches whenever FindController::hideFindUI is
called to allow callers using the ShowHighlight find option to
remove highlighting.

This patch enables a unit test for the WebKitFindController
previously guarded by a #if(0) after r109222.

* UIProcess/API/gtk/tests/TestWebKitFindController.cpp:
(testFindControllerHide):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::hideFindUI):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp
Source/WebKit2/WebProcess/WebPage/FindController.cpp

index 2556a29..99c7c86 100644 (file)
@@ -1,3 +1,22 @@
+2012-06-22  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WK2] FindController::hideFindUI should unmark highlighted text matches
+        https://bugs.webkit.org/show_bug.cgi?id=77747
+
+        Reviewed by Carlos Garcia Campos.
+
+        Unmark all text matches whenever FindController::hideFindUI is
+        called to allow callers using the ShowHighlight find option to
+        remove highlighting.
+
+        This patch enables a unit test for the WebKitFindController
+        previously guarded by a #if(0) after r109222.
+
+        * UIProcess/API/gtk/tests/TestWebKitFindController.cpp:
+        (testFindControllerHide):
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::hideFindUI):
+
 2012-06-21  Christophe Dumez  <christophe.dumez@intel.com>
 
         [WK2] Add C API to inspect a Web Intent
index ae9ff2f..a185db8 100644 (file)
@@ -324,8 +324,6 @@ static void testFindControllerHide(FindControllerTest* test, gconstpointer)
     g_assert(highlightPixbuf);
     g_assert(!gdkPixbufEqual(originalPixbuf.get(), highlightPixbuf.get()));
 
-#if (0)
-    // Requires http://webkit.org/b/77747 to be fixed
     WebKitFindController* findController = webkit_web_view_get_find_controller(test->m_webView);
     webkit_find_controller_search_finish(findController);
     webkit_web_view_execute_editing_command(test->m_webView, "Unselect");
@@ -334,7 +332,6 @@ static void testFindControllerHide(FindControllerTest* test, gconstpointer)
     GRefPtr<GdkPixbuf> unhighlightPixbuf = gdk_pixbuf_get_from_window(webViewGdkWindow, 0, 0, allocatedHeight, allocatedWidth);
     g_assert(unhighlightPixbuf);
     g_assert(gdkPixbufEqual(originalPixbuf.get(), unhighlightPixbuf.get()));
-#endif
 }
 
 static void testFindControllerInstance(FindControllerTest* test, gconstpointer)
index 7f00bc7..8955709 100644 (file)
@@ -164,6 +164,7 @@ void FindController::hideFindUI()
     if (m_findPageOverlay)
         m_webPage->uninstallPageOverlay(m_findPageOverlay, false);
 
+    m_webPage->corePage()->unmarkAllTextMatches();
     hideFindIndicator();
 }