REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 May 2014 18:06:35 +0000 (18:06 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 May 2014 18:06:35 +0000 (18:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133372
<rdar://problem/17045070>

Reviewed by Simon Fraser.

* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::willFindString):
(WebKit::FindController::didFailToFindString):
(WebKit::FindController::didHideFindIndicator):
Flip ignoreCompositionSelectionChange and updateAppearanceEnabled on all
frames, not just the main frame, because the found string can be in a subframe.
Ideally we would flip it on/off for each frame as we move the selection between them,
but would require a lot of work (and the overhead of touching each frame shouldn't be significant).

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/ios/FindControllerIOS.mm

index 1cd8104..ccee083 100644 (file)
@@ -1,3 +1,20 @@
+2014-05-29  Timothy Horton  <timothy_horton@apple.com>
+
+        REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes
+        https://bugs.webkit.org/show_bug.cgi?id=133372
+        <rdar://problem/17045070>
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebPage/ios/FindControllerIOS.mm:
+        (WebKit::FindController::willFindString):
+        (WebKit::FindController::didFailToFindString):
+        (WebKit::FindController::didHideFindIndicator):
+        Flip ignoreCompositionSelectionChange and updateAppearanceEnabled on all
+        frames, not just the main frame, because the found string can be in a subframe.
+        Ideally we would flip it on/off for each frame as we move the selection between them,
+        but would require a lot of work (and the overhead of touching each frame shouldn't be significant).
+
 2014-05-29  Dan Bernstein  <mitz@apple.com>
 
         WKBundleActivateMacFontAscentHack is unused
index 0bbc977..0907bdf 100644 (file)
@@ -113,23 +113,28 @@ void FindController::hideFindIndicator()
     didHideFindIndicator();
 }
 
-// FIXME: These should likely affect the frame owning the selection, not the main frame.
 void FindController::willFindString()
 {
-    m_webPage->mainFrame()->editor().setIgnoreCompositionSelectionChange(true);
-    m_webPage->mainFrame()->selection().setUpdateAppearanceEnabled(true);
+    for (Frame* coreFrame = m_webPage->mainFrame(); coreFrame; coreFrame = coreFrame->tree().traverseNext()) {
+        coreFrame->editor().setIgnoreCompositionSelectionChange(true);
+        coreFrame->selection().setUpdateAppearanceEnabled(true);
+    }
 }
 
 void FindController::didFailToFindString()
 {
-    m_webPage->mainFrame()->selection().setUpdateAppearanceEnabled(false);
-    m_webPage->mainFrame()->editor().setIgnoreCompositionSelectionChange(false);
+    for (Frame* coreFrame = m_webPage->mainFrame(); coreFrame; coreFrame = coreFrame->tree().traverseNext()) {
+        coreFrame->selection().setUpdateAppearanceEnabled(false);
+        coreFrame->editor().setIgnoreCompositionSelectionChange(false);
+    }
 }
 
 void FindController::didHideFindIndicator()
 {
-    m_webPage->mainFrame()->selection().setUpdateAppearanceEnabled(false);
-    m_webPage->mainFrame()->editor().setIgnoreCompositionSelectionChange(false);
+    for (Frame* coreFrame = m_webPage->mainFrame(); coreFrame; coreFrame = coreFrame->tree().traverseNext()) {
+        coreFrame->selection().setUpdateAppearanceEnabled(false);
+        coreFrame->editor().setIgnoreCompositionSelectionChange(false);
+    }
 }
 
 } // namespace WebKit