From e2afcfe99bcff8b3dd274d615f574e61b018f18a Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Mon, 16 Apr 2012 18:27:42 +0000 Subject: [PATCH] [BlackBerry] Increase padding for text element https://bugs.webkit.org/show_bug.cgi?id=83903 Patch by Yongxin Dai 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 | 18 ++++++++++++++++++ .../WebKit/blackberry/WebKitSupport/InputHandler.cpp | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog index 8b8e11c..89d11e3 100644 --- a/Source/WebKit/blackberry/ChangeLog +++ b/Source/WebKit/blackberry/ChangeLog @@ -1,3 +1,21 @@ +2012-04-16 Yongxin Dai + + [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 [BlackBerry] Add ability for DRT to handle HTTP authentication challenges. diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp index 60474e4..c6c8472 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp @@ -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); -- 2.7.4