Title: [105855] trunk/Source/WebKit2
Revision
105855
Author
[email protected]
Date
2012-01-25 00:54:19 -0800 (Wed, 25 Jan 2012)

Log Message

[WK2] FindController should not assume that ports do not want to highlight text matches
https://bugs.webkit.org/show_bug.cgi?id=76921

Reviewed by Darin Adler.

FindController must obey the FindOptionsShowHighlight flag instead
of assuming that ports do not want to highlight search matches.

* Shared/API/c/WKFindOptions.h: added kWKFindOptionsShowHighlight.
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toFindOptions): Ditto.
* Shared/WebFindOptions.h: added FindOptionsShowHighlight.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::findString):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (105854 => 105855)


--- trunk/Source/WebKit2/ChangeLog	2012-01-25 08:37:01 UTC (rev 105854)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-25 08:54:19 UTC (rev 105855)
@@ -1,3 +1,20 @@
+2012-01-24  Sergio Villar Senin  <[email protected]>
+
+        [WK2] FindController should not assume that ports do not want to highlight text matches
+        https://bugs.webkit.org/show_bug.cgi?id=76921
+
+        Reviewed by Darin Adler.
+
+        FindController must obey the FindOptionsShowHighlight flag instead
+        of assuming that ports do not want to highlight search matches.
+
+        * Shared/API/c/WKFindOptions.h: added kWKFindOptionsShowHighlight.
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toFindOptions): Ditto.
+        * Shared/WebFindOptions.h: added FindOptionsShowHighlight.
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::findString):
+
 2012-01-25  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Page clients don't need to be GObjects anymore in WebKit2 GTK+ API

Modified: trunk/Source/WebKit2/Shared/API/c/WKFindOptions.h (105854 => 105855)


--- trunk/Source/WebKit2/Shared/API/c/WKFindOptions.h	2012-01-25 08:37:01 UTC (rev 105854)
+++ trunk/Source/WebKit2/Shared/API/c/WKFindOptions.h	2012-01-25 08:54:19 UTC (rev 105855)
@@ -37,7 +37,8 @@
     kWKFindOptionsBackwards = 1 << 3,
     kWKFindOptionsWrapAround = 1 << 4,
     kWKFindOptionsShowOverlay = 1 << 5,
-    kWKFindOptionsShowFindIndicator = 1 << 6
+    kWKFindOptionsShowFindIndicator = 1 << 6,
+    kWKFindOptionsShowHighlight = 1 << 7
 };
 typedef uint32_t WKFindOptions;
 

Modified: trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h (105854 => 105855)


--- trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h	2012-01-25 08:37:01 UTC (rev 105854)
+++ trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h	2012-01-25 08:54:19 UTC (rev 105855)
@@ -688,6 +688,8 @@
         findOptions |= FindOptionsShowOverlay;
     if (wkFindOptions & kWKFindOptionsShowFindIndicator)
         findOptions |= FindOptionsShowFindIndicator;
+    if (wkFindOptions & kWKFindOptionsShowHighlight)
+        findOptions |= FindOptionsShowHighlight;
 
     return static_cast<FindOptions>(findOptions);
 }

Modified: trunk/Source/WebKit2/Shared/WebFindOptions.h (105854 => 105855)


--- trunk/Source/WebKit2/Shared/WebFindOptions.h	2012-01-25 08:37:01 UTC (rev 105854)
+++ trunk/Source/WebKit2/Shared/WebFindOptions.h	2012-01-25 08:54:19 UTC (rev 105855)
@@ -35,7 +35,8 @@
     FindOptionsBackwards = 1 << 3,
     FindOptionsWrapAround = 1 << 4,
     FindOptionsShowOverlay = 1 << 5,
-    FindOptionsShowFindIndicator = 1 << 6
+    FindOptionsShowFindIndicator = 1 << 6,
+    FindOptionsShowHighlight = 1 << 7
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (105854 => 105855)


--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2012-01-25 08:37:01 UTC (rev 105854)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2012-01-25 08:54:19 UTC (rev 105855)
@@ -111,10 +111,12 @@
         shouldShowOverlay = options & FindOptionsShowOverlay;
 
         if (shouldShowOverlay) {
+            bool shouldShowHighlight = options & FindOptionsShowHighlight;
+
             if (maxMatchCount == numeric_limits<unsigned>::max())
                 --maxMatchCount;
             
-            unsigned matchCount = m_webPage->corePage()->markAllMatchesForText(string, core(options), false, maxMatchCount + 1);
+            unsigned matchCount = m_webPage->corePage()->markAllMatchesForText(string, core(options), shouldShowHighlight, maxMatchCount + 1);
 
             // Check if we have more matches than allowed.
             if (matchCount > maxMatchCount) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to