Title: [149689] trunk/Source/WebKit/blackberry
Revision
149689
Author
[email protected]
Date
2013-05-07 13:30:02 -0700 (Tue, 07 May 2013)

Log Message

[BlackBerry] Increase the padding size for caret based scrolling.
https://bugs.webkit.org/show_bug.cgi?id=115749

Reviewed by Rob Buis.

PR 322670.

Increasing the padding size for scrolling in order to optimize the
number of scrolls required during typing.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (149688 => 149689)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-05-07 19:42:03 UTC (rev 149688)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-05-07 20:30:02 UTC (rev 149689)
@@ -1,3 +1,18 @@
+2013-05-07  Mike Fenton  <[email protected]>
+
+        [BlackBerry] Increase the padding size for caret based scrolling.
+        https://bugs.webkit.org/show_bug.cgi?id=115749
+
+        Reviewed by Rob Buis.
+
+        PR 322670.
+
+        Increasing the padding size for scrolling in order to optimize the
+        number of scrolls required during typing.
+
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+
 2013-05-07  Nima Ghanavatian  <[email protected]>
 
         [BlackBerry] Maintain touch event state throughout processing

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (149688 => 149689)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2013-05-07 19:42:03 UTC (rev 149688)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2013-05-07 20:30:02 UTC (rev 149689)
@@ -1367,6 +1367,14 @@
         }
     }
 
+    const Platform::ViewportAccessor* viewportAccessor = m_webPage->m_webkitThreadViewportAccessor;
+    if (scrollType == EdgeIfNeeded
+        && (viewportAccessor->documentViewportRect().contains(selectionFocusRect))
+        && zoomScaleRequired == m_webPage->currentScale()) {
+        // Already in view and no zoom is required, return early.
+        return;
+    }
+
     bool shouldConstrainScrollingToContentEdge = true;
     Position start = elementFrame->selection()->start();
     if (start.anchorNode() && start.anchorNode()->renderer()) {
@@ -1409,8 +1417,7 @@
             // Pad the rect to improve the visual appearance.
             // Convert the padding back from transformed to ensure a consistent padding regardless of
             // zoom level as controls do not zoom.
-            static const int s_focusRectPaddingSize = Graphics::Screen::primaryScreen()->heightInMMToPixels(3);
-            const Platform::ViewportAccessor* viewportAccessor = m_webPage->m_webkitThreadViewportAccessor;
+            static const int s_focusRectPaddingSize = Graphics::Screen::primaryScreen()->heightInMMToPixels(12);
             selectionFocusRect.inflate(std::ceilf(viewportAccessor->documentFromPixelContents(Platform::FloatSize(0, s_focusRectPaddingSize)).height()));
 
             WebCore::IntRect revealRect(layer->getRectToExpose(actualScreenRect, selectionFocusRect,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to