Title: [136747] trunk/Source/WebKit/blackberry
Revision
136747
Author
[email protected]
Date
2012-12-05 13:14:17 -0800 (Wed, 05 Dec 2012)

Log Message

[BlackBerry] Scroll position shifts while FCC & selection handle are dragged
https://bugs.webkit.org/show_bug.cgi?id=104156

Patch by Andrew Lo <[email protected]> on 2012-12-05
Reviewed by Rob Buis.
Internally reviewed by Mike Fenton.

Only ensureFocusTextElementVisible on selectionChanged when
an element is being re-focused.
Internal PR256329

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (136746 => 136747)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-12-05 21:10:18 UTC (rev 136746)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-12-05 21:14:17 UTC (rev 136747)
@@ -1,3 +1,23 @@
+2012-12-05  Andrew Lo  <[email protected]>
+
+        [BlackBerry] Scroll position shifts while FCC & selection handle are dragged
+        https://bugs.webkit.org/show_bug.cgi?id=104156
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Mike Fenton.
+
+        Only ensureFocusTextElementVisible on selectionChanged when
+        an element is being re-focused.
+        Internal PR256329
+
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::InputHandler):
+        (BlackBerry::WebKit::InputHandler::setElementFocused):
+        (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+        (BlackBerry::WebKit::InputHandler::selectionChanged):
+        * WebKitSupport/InputHandler.h:
+        (InputHandler):
+
 2012-12-05  Leo Yang  <[email protected]>
 
         [BlackBerry] Enable CSS_IMAGE_RESOLUTION

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (136746 => 136747)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-12-05 21:10:18 UTC (rev 136746)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-12-05 21:14:17 UTC (rev 136747)
@@ -130,7 +130,7 @@
     , m_currentFocusElement(0)
     , m_inputModeEnabled(false)
     , m_processingChange(false)
-    , m_changingFocus(false)
+    , m_shouldEnsureFocusTextElementVisibleOnSelectionChanged(false)
     , m_currentFocusElementType(TextEdit)
     , m_currentFocusElementTextEditMask(DEFAULT_STYLE)
     , m_composingTextStart(0)
@@ -843,6 +843,9 @@
     if (frame->selection()->isFocused() != isInputModeEnabled())
         frame->selection()->setFocused(isInputModeEnabled());
 
+    // Ensure visible when refocusing.
+    m_shouldEnsureFocusTextElementVisibleOnSelectionChanged = isActiveTextEdit();
+
     // Clear the existing focus node details.
     setElementUnfocused(true /*refocusOccuring*/);
 
@@ -1118,6 +1121,7 @@
         break;
     }
     case VisibleSelection::NoSelection:
+        m_shouldEnsureFocusTextElementVisibleOnSelectionChanged = true;
         return;
     }
 
@@ -1419,7 +1423,10 @@
     // Scroll the field if necessary. This must be done even if we are processing
     // a change as the text change may have moved the caret. IMF doesn't require
     // the update, but the user needs to see the caret.
-    ensureFocusTextElementVisible(EdgeIfNeeded);
+    if (m_shouldEnsureFocusTextElementVisibleOnSelectionChanged) {
+        ensureFocusTextElementVisible(EdgeIfNeeded);
+        m_shouldEnsureFocusTextElementVisibleOnSelectionChanged = false;
+    }
 
     ASSERT(m_currentFocusElement->document() && m_currentFocusElement->document()->frame());
 

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h (136746 => 136747)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h	2012-12-05 21:10:18 UTC (rev 136746)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h	2012-12-05 21:14:17 UTC (rev 136747)
@@ -210,7 +210,7 @@
     bool m_inputModeEnabled;
 
     bool m_processingChange;
-    bool m_changingFocus;
+    bool m_shouldEnsureFocusTextElementVisibleOnSelectionChanged;
 
     FocusElementType m_currentFocusElementType;
     int64_t m_currentFocusElementTextEditMask;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to