Title: [136621] trunk/Source/WebKit/blackberry
Revision
136621
Author
commit-qu...@webkit.org
Date
2012-12-04 20:21:34 -0800 (Tue, 04 Dec 2012)

Log Message

[BlackBerry] Scroll adjustments while typing scroll off page, then bounce back.
https://bugs.webkit.org/show_bug.cgi?id=104045

Patch by Andrew Lo <a...@rim.com> on 2012-12-04
Reviewed by Rob Buis.
Internally reviewed by Mike Fenton & Jakob Petsovits.

Internal PR253845
The main frame's view should only be temporarily set to
not constrain scrolling to the content edge while the
scroll position is set at the end of the scroll animation.

Remove ensureFocusTextElementVisible from setSpannableTextAndRelativeCursor
in InputHandler since FrameSelection::revealSelection
already implements scroll adjustments due to typing.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::zoomBlock):
(BlackBerry::WebKit::WebPagePrivate::resetBlockZoom):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
(BlackBerry::WebKit::InputHandler::setSpannableTextAndRelativeCursor):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (136620 => 136621)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-12-05 04:19:22 UTC (rev 136620)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-12-05 04:21:34 UTC (rev 136621)
@@ -410,6 +410,7 @@
     , m_currentBlockZoomNode(0)
     , m_currentBlockZoomAdjustedNode(0)
     , m_shouldReflowBlock(false)
+    , m_shouldConstrainScrollingToContentEdge(true)
     , m_lastUserEventTimestamp(0.0)
     , m_pluginMouseButtonPressed(false)
     , m_pluginMayOpenNewTab(false)
@@ -2965,6 +2966,13 @@
     m_backingStore->d->suspendScreenUpdates();
     updateViewportSize();
 
+    FrameView* mainFrameView = m_mainFrame->view();
+    bool constrainsScrollingToContentEdge = true;
+    if (mainFrameView) {
+        constrainsScrollingToContentEdge = mainFrameView->constrainsScrollingToContentEdge();
+        mainFrameView->setConstrainsScrollingToContentEdge(m_shouldConstrainScrollingToContentEdge);
+    }
+
 #if ENABLE(VIEWPORT_REFLOW)
     requestLayoutIfNeeded();
     if (willUseTextReflow && m_shouldReflowBlock) {
@@ -3019,6 +3027,10 @@
 
     notifyTransformChanged();
     m_client->scaleChanged();
+
+    if (mainFrameView)
+        mainFrameView->setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdge);
+
     // FIXME: Do we really need to suspend/resume both backingstore and screen here?
     m_backingStore->d->resumeBackingStoreUpdates();
     m_backingStore->d->resumeScreenUpdates(BackingStore::RenderAndBlit);
@@ -3039,6 +3051,7 @@
     m_currentBlockZoomNode = 0;
     m_currentBlockZoomAdjustedNode = 0;
     m_shouldReflowBlock = false;
+    m_shouldConstrainScrollingToContentEdge = true;
 }
 
 void WebPage::destroyWebPageCompositor()

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (136620 => 136621)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-12-05 04:19:22 UTC (rev 136620)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-12-05 04:21:34 UTC (rev 136621)
@@ -543,6 +543,7 @@
     RefPtr<WebCore::Node> m_currentBlockZoomNode;
     RefPtr<WebCore::Node> m_currentBlockZoomAdjustedNode;
     bool m_shouldReflowBlock;
+    bool m_shouldConstrainScrollingToContentEdge;
 
     double m_lastUserEventTimestamp; // Used to detect user scrolling.
 

Modified: trunk/Source/WebKit/blackberry/ChangeLog (136620 => 136621)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-12-05 04:19:22 UTC (rev 136620)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-12-05 04:21:34 UTC (rev 136621)
@@ -1,3 +1,30 @@
+2012-12-04  Andrew Lo  <a...@rim.com>
+
+        [BlackBerry] Scroll adjustments while typing scroll off page, then bounce back.
+        https://bugs.webkit.org/show_bug.cgi?id=104045
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Mike Fenton & Jakob Petsovits.
+
+        Internal PR253845
+        The main frame's view should only be temporarily set to
+        not constrain scrolling to the content edge while the
+        scroll position is set at the end of the scroll animation.
+
+        Remove ensureFocusTextElementVisible from setSpannableTextAndRelativeCursor
+        in InputHandler since FrameSelection::revealSelection
+        already implements scroll adjustments due to typing.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+        (BlackBerry::WebKit::WebPagePrivate::zoomBlock):
+        (BlackBerry::WebKit::WebPagePrivate::resetBlockZoom):
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+        (BlackBerry::WebKit::InputHandler::setSpannableTextAndRelativeCursor):
+
 2012-12-04  Mike Fenton  <mifen...@rim.com>
 
         [BlackBerry] Remove assert and fix conditional for out of bounds requests in InputHandler::spannableTextInRange

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (136620 => 136621)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-12-05 04:19:22 UTC (rev 136620)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-12-05 04:21:34 UTC (rev 136621)
@@ -1150,6 +1150,7 @@
         }
     }
 
+    bool shouldConstrainScrollingToContentEdge = true;
     Position start = elementFrame->selection()->start();
     if (start.anchorNode() && start.anchorNode()->renderer()) {
         if (RenderLayer* layer = start.anchorNode()->renderer()->enclosingLayer()) {
@@ -1198,7 +1199,9 @@
                                                                  horizontalScrollAlignment,
                                                                  verticalScrollAlignment));
 
-            mainFrameView->setConstrainsScrollingToContentEdge(false);
+            // Don't constrain scroll position when animation finishes.
+            shouldConstrainScrollingToContentEdge = false;
+
             // In order to adjust the scroll position to ensure the focused input field is visible,
             // we allow overscrolling. However this overscroll has to be strictly allowed towards the
             // bottom of the page on the y axis only, where the virtual keyboard pops up from.
@@ -1210,8 +1213,6 @@
     }
 
     if (destinationScrollLocation != mainFrameView->scrollPosition() || zoomScaleRequired != m_webPage->currentScale()) {
-        mainFrameView->setConstrainsScrollingToContentEdge(true);
-
         InputLog(LogLevelInfo, "InputHandler::ensureFocusTextElementVisible zooming in to %f and scrolling to point %d, %d", zoomScaleRequired, destinationScrollLocation.x(), destinationScrollLocation.y());
 
         // Animate to given scroll position & zoom level
@@ -1220,6 +1221,7 @@
         m_webPage->m_shouldReflowBlock = false;
         m_webPage->m_userPerformedManualZoom = true;
         m_webPage->m_userPerformedManualScroll = true;
+        m_webPage->m_shouldConstrainScrollingToContentEdge = shouldConstrainScrollingToContentEdge;
         m_webPage->client()->animateBlockZoom(zoomScaleRequired, m_webPage->m_finalBlockPoint);
     }
 }
@@ -2316,10 +2318,6 @@
         m_composingTextEnd = insertionPoint + spannableString->length;
     }
 
-    // Scroll the field if necessary. The automatic update is suppressed
-    // by the processing change guard.
-    ensureFocusTextElementVisible(EdgeIfNeeded);
-
     return true;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to