[BlackBerry] Increase padding for text element
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 18:27:42 +0000 (18:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 18:27:42 +0000 (18:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83903

Patch by Yongxin Dai <yodai@rim.com> on 2012-04-16
Reviewed by Antonio Gomes.

PR 125888

Increase the padding value for focused text element to make selection handle
at least partially visible when the user is dragging at edge of viewport
in in-region scoll mode.

Reviewed internally by Mike Fenton.

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

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

Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

index 8b8e11c..89d11e3 100644 (file)
@@ -1,3 +1,21 @@
+2012-04-16  Yongxin Dai  <yodai@rim.com>
+
+        [BlackBerry] Increase padding for text element
+        https://bugs.webkit.org/show_bug.cgi?id=83903
+
+        Reviewed by Antonio Gomes.
+        
+        PR 125888
+        
+        Increase the padding value for focused text element to make selection handle
+        at least partially visible when the user is dragging at edge of viewport
+        in in-region scoll mode.
+        Reviewed internally by Mike Fenton.
+
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+
 2012-04-16  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
 
         [BlackBerry] Add ability for DRT to handle HTTP authentication challenges.
index 60474e4..c6c8472 100644 (file)
@@ -623,7 +623,13 @@ void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType)
             }
 
             // Pad the rect to improve the visual appearance.
-            selectionFocusRect.inflate(4 /* padding in pixels */);
+            // Padding must be large enough to expose the selection / FCC should they exist. Dragging the handle offscreen and releasing
+            // will not trigger an automatic scroll. Using a padding of 40 will fully exposing the width of the current handle and half of
+            // the height making it usable.
+            // FIXME: This will need to be updated when the graphics change.
+            // FIXME: The value of 40 should be calculated as a unit of measure using Graphics::Screen::primaryScreen()->heightInMMToPixels
+            // using a relative value to the size of the handle. We should also consider expanding different amounts horizontally vs vertically.
+            selectionFocusRect.inflate(40 /* padding in pixels */);
             WebCore::IntRect revealRect = layer->getRectToExpose(actualScreenRect, selectionFocusRect,
                                                                  horizontalScrollAlignment,
                                                                  verticalScrollAlignment);