[iOS] Cursor hidden in text area once it scrolls.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 May 2015 23:02:56 +0000 (23:02 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 May 2015 23:02:56 +0000 (23:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145451
rdar://problem/20356413

Reviewed by Simon Fraser.

This patch fixes both the touch scrolling inside the
overflow area as well as the programmatic scroll that
occurs when inserting a new line. The first issue is fixed by
implementing the chrome client methods didLayout,
didStartOverflowScroll and didEndOverflowScroll. The second
required changing the implementation of notifyRevealedSelectionByScrollingFrame.
We not only need to notify the client to redraw the selection,
but we also need to recompute the editorState, because scrolling
might have occurred.
I've removed the NotifyRevealedSelection message that was not needed
any longer, since EditorStateChanged will do exactly what we want.

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::editorStateChanged):
(WebKit::WebPageProxy::notifyRevealedSelection): Deleted.
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame):
(WebKit::WebChromeClient::didLayout):
(WebKit::WebChromeClient::didStartOverflowScroll):
(WebKit::WebChromeClient::didEndOverflowScroll):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm

index 61ac84c72a3b313a034bd211f247f9705a33267a..10b1e2ad3512482377fc56d133a37b35c15cbf67 100644 (file)
@@ -1,3 +1,34 @@
+2015-05-29  Enrica Casucci  <enrica@apple.com>
+
+        [iOS] Cursor hidden in text area once it scrolls.
+        https://bugs.webkit.org/show_bug.cgi?id=145451
+        rdar://problem/20356413
+
+        Reviewed by Simon Fraser.
+
+        This patch fixes both the touch scrolling inside the
+        overflow area as well as the programmatic scroll that
+        occurs when inserting a new line. The first issue is fixed by
+        implementing the chrome client methods didLayout,
+        didStartOverflowScroll and didEndOverflowScroll. The second
+        required changing the implementation of notifyRevealedSelectionByScrollingFrame.
+        We not only need to notify the client to redraw the selection,
+        but we also need to recompute the editorState, because scrolling
+        might have occurred.
+        I've removed the NotifyRevealedSelection message that was not needed
+        any longer, since EditorStateChanged will do exactly what we want.
+
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::editorStateChanged):
+        (WebKit::WebPageProxy::notifyRevealedSelection): Deleted.
+        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+        (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame):
+        (WebKit::WebChromeClient::didLayout):
+        (WebKit::WebChromeClient::didStartOverflowScroll):
+        (WebKit::WebChromeClient::didEndOverflowScroll):
+
 2015-05-29  Chris Dumez  <cdumez@apple.com>
 
         [iOS] Update WebContent process sandbox profile for AWD logging
index 02943756c027cc0a28f5478d6798ed3c3f531d50..c9cd887dc3484a08e0c1621bf8f8a312f439df86 100644 (file)
@@ -1390,8 +1390,6 @@ private:
 
     void enableInspectorNodeSearch();
     void disableInspectorNodeSearch();
-
-    void notifyRevealedSelection();
 #endif // PLATFORM(IOS)
 
     void clearLoadDependentCallbacks();
index db82a72e4d5befa9acf1f5d15535af249a293268..a85c2d677b68de8510975db87d519a2bbfc85870 100644 (file)
@@ -369,8 +369,8 @@ messages -> WebPageProxy {
 
     StartAssistingNode(struct WebKit::AssistedNodeInformation information, bool userIsInteracting, bool blurPreviousNode, WebKit::UserData userData)
     StopAssistingNode()
-    NotifyRevealedSelection()
-
+    OverflowScrollWillStartScroll()
+    OverflowScrollDidEndScroll()
     ShowInspectorHighlight(struct WebCore::Highlight highlight)
     HideInspectorHighlight()
 
index c1a2b8e5dbe467714952d244c0caab73aec3bbe8..4ba0cb1bf0b696257f862787dbbac498fd25ae31 100644 (file)
@@ -608,11 +608,6 @@ void WebPageProxy::applicationDidBecomeActive()
     m_process->send(Messages::WebPage::ApplicationDidBecomeActive(), m_pageID);
 }
 
-void WebPageProxy::notifyRevealedSelection()
-{
-    m_pageClient.selectionDidChange();
-}
-
 void WebPageProxy::extendSelection(WebCore::TextGranularity granularity)
 {
     m_process->send(Messages::WebPage::ExtendSelection(static_cast<uint32_t>(granularity)), m_pageID);
@@ -924,7 +919,7 @@ void WebPageProxy::editorStateChanged(const EditorState& editorState)
     
     // We always need to notify the client on iOS to make sure the selection is redrawn,
     // even during composition to support phrase boundary gesture.
-    notifyRevealedSelection();
+    m_pageClient.selectionDidChange();
 }
 
 #if USE(QUICK_LOOK)
index 063a536ebcd13c23327961726459a1725429aadf..a25591ecdac73bf07022101b08a5e6c9c66e0f16 100644 (file)
@@ -76,7 +76,7 @@ void WebChromeClient::clearContentChangeObservers(WebCore::Frame*)
 
 void WebChromeClient::notifyRevealedSelectionByScrollingFrame(WebCore::Frame*)
 {
-    m_page->send(Messages::WebPageProxy::NotifyRevealedSelection());
+    m_page->didChangeSelection();
 }
 
 bool WebChromeClient::isStopping()
@@ -85,19 +85,20 @@ bool WebChromeClient::isStopping()
     return false;
 }
 
-void WebChromeClient::didLayout(LayoutType)
+void WebChromeClient::didLayout(LayoutType type)
 {
-    notImplemented();
+    if (type == Scroll)
+        m_page->didChangeSelection();
 }
 
 void WebChromeClient::didStartOverflowScroll()
 {
-    notImplemented();
+    m_page->send(Messages::WebPageProxy::OverflowScrollWillStartScroll());
 }
 
 void WebChromeClient::didEndOverflowScroll()
 {
-    notImplemented();
+    m_page->send(Messages::WebPageProxy::OverflowScrollDidEndScroll());
 }
 
 bool WebChromeClient::hasStablePageScaleFactor() const