diff options
Diffstat (limited to 'Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp')
-rw-r--r-- | Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp index 690c1bbb7..0048a6430 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp @@ -66,6 +66,7 @@ #include <BlackBerryPlatformKeyboardEvent.h> #include <BlackBerryPlatformLog.h> #include <BlackBerryPlatformMisc.h> +#include <BlackBerryPlatformScreen.h> #include <BlackBerryPlatformSettings.h> #include <sys/keycodes.h> #include <wtf/text/CString.h> @@ -1050,7 +1051,7 @@ void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType) if (!isActiveTextEdit() || !isInputModeEnabled() || !m_currentFocusElement->document()) return; - if (!Platform::Settings::instance()->allowCenterScrollAdjustmentForInputFields() && scrollType != EdgeIfNeeded) + if (!(Platform::Settings::instance()->allowedScrollAdjustmentForInputFields() & scrollType)) return; Frame* elementFrame = m_currentFocusElement->document()->frame(); @@ -1158,9 +1159,10 @@ void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType) } // If the text is too small, zoom in to make it a minimum size. - static const int s_minimumTextHeightInPixels = 6; + // The minimum size being defined as 3 mm is a good value based on my observations. + static const int s_minimumTextHeightInPixels = Graphics::Screen::primaryScreen()->widthInMMToPixels(3); if (fontHeight && fontHeight < s_minimumTextHeightInPixels) - m_webPage->zoomAboutPoint(s_minimumTextHeightInPixels / fontHeight, m_webPage->centerOfVisibleContentsRect()); + m_webPage->zoomAboutPoint(s_minimumTextHeightInPixels / fontHeight, selectionFocusRect.location()); } void InputHandler::ensureFocusPluginElementVisible() |