Changeset 107992 in webkit


Ignore:
Timestamp:
Feb 16, 2012 4:04:35 PM (12 years ago)
Author:
tonikitoo@webkit.org
Message:

2012-02-16 Antonio Gomes <agomes@rim.com>

[BlackBerry] Implemented a way to defer client navigation change client notifications
https://bugs.webkit.org/show_bug.cgi?id=78848

Reviewed by Rob Buis.

Currently we postpone touch_down till touch_up if user touches
the screen and an input field has the WebKit focus. This is done
so we can scroll the page without hidding the vkb needlessly.

However, it breaks the conversion of touch to mouse events
if an input field has the focus in the following scenario:
an <input type=text> is focused and an user grab and-drag
a <input type=range> knob/slide. It does not work until the
user unfocuses the currently focused edit field.

Patch introduces a way to unfocus a currently focused input field,
without requesting the client to show or hide the virtual keyboard
right way. Instead it gets a delayed notification of the vkb mode requested
at either touch_released/mouse_up or touch_cancel time.

For now, due to content side issues with major web sites,
only delay navigation mode notification changes if we are not dealing with
input modes.

  • WebKitSupport/InputHandler.cpp: (BlackBerry::WebKit::InputHandler::InputHandler): (BlackBerry::WebKit::InputHandler::nodeFocused): (BlackBerry::WebKit::InputHandler::setElementFocused): (BlackBerry::WebKit::InputHandler::setNavigationMode): (WebKit): (BlackBerry::WebKit::InputHandler::setDelayClientNotificationOfNavigationModeChange): (BlackBerry::WebKit::InputHandler::processPendingClientNavigationModeChangeNotification): (BlackBerry::WebKit::InputHandler::notifyClientOfNavigationModeChange): (BlackBerry::WebKit::InputHandler::willOpenPopupForNode): (BlackBerry::WebKit::InputHandler::setPopupListIndexes): (BlackBerry::WebKit::InputHandler::spannableTextInRange): (BlackBerry::WebKit::InputHandler::removeComposedText): (BlackBerry::WebKit::InputHandler::firstSpanInString): (BlackBerry::WebKit::InputHandler::setText): (BlackBerry::WebKit::InputHandler::setRelativeCursorPosition):
  • WebKitSupport/InputHandler.h: (InputHandler):
Location:
trunk/Source/WebKit/blackberry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/ChangeLog

    r107991 r107992  
     12012-02-16  Antonio Gomes  <agomes@rim.com>
     2
     3        [BlackBerry] Implemented a way to defer client navigation change client notifications
     4        https://bugs.webkit.org/show_bug.cgi?id=78848
     5
     6        Reviewed by Rob Buis.
     7
     8        Currently we postpone touch_down till touch_up if user touches
     9        the screen and an input field has the WebKit focus. This is done
     10        so we can scroll the page without hidding the vkb needlessly.
     11
     12        However, it breaks the conversion of touch to mouse events
     13        if an input field has the focus in the following scenario:
     14        an <input type=text> is focused and an user grab and-drag
     15        a <input type=range> knob/slide. It does not work until the
     16        user unfocuses the currently focused edit field.
     17
     18        Patch introduces a way to unfocus a currently focused input field,
     19        without requesting the client to show or hide the virtual keyboard
     20        right way. Instead it gets a delayed notification of the vkb mode requested
     21        at either touch_released/mouse_up or touch_cancel time.
     22
     23        For now, due to content side issues with major web sites,
     24        only delay navigation mode notification changes if we are not dealing with
     25        input modes.
     26
     27        * WebKitSupport/InputHandler.cpp:
     28        (BlackBerry::WebKit::InputHandler::InputHandler):
     29        (BlackBerry::WebKit::InputHandler::nodeFocused):
     30        (BlackBerry::WebKit::InputHandler::setElementFocused):
     31        (BlackBerry::WebKit::InputHandler::setNavigationMode):
     32        (WebKit):
     33        (BlackBerry::WebKit::InputHandler::setDelayClientNotificationOfNavigationModeChange):
     34        (BlackBerry::WebKit::InputHandler::processPendingClientNavigationModeChangeNotification):
     35        (BlackBerry::WebKit::InputHandler::notifyClientOfNavigationModeChange):
     36        (BlackBerry::WebKit::InputHandler::willOpenPopupForNode):
     37        (BlackBerry::WebKit::InputHandler::setPopupListIndexes):
     38        (BlackBerry::WebKit::InputHandler::spannableTextInRange):
     39        (BlackBerry::WebKit::InputHandler::removeComposedText):
     40        (BlackBerry::WebKit::InputHandler::firstSpanInString):
     41        (BlackBerry::WebKit::InputHandler::setText):
     42        (BlackBerry::WebKit::InputHandler::setRelativeCursorPosition):
     43        * WebKitSupport/InputHandler.h:
     44        (InputHandler):
     45
    1462012-02-16  Antonio Gomes  <agomes@rim.com>
    247
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

    r107471 r107992  
    117117    , m_composingTextStart(0)
    118118    , m_composingTextEnd(0)
     119    , m_pendingKeyboardStateChange(NoChange)
     120    , m_delayClientNotificationOfNavigationModeChange(false)
    119121{
    120122}
     
    475477    FocusLog(BlackBerry::Platform::LogLevelInfo, "InputHandler::setElementFocused, Type=%d, Style=%d", type, m_currentFocusElementTextEditMask);
    476478
    477     m_webPage->m_client->inputFocusGained(type, m_currentFocusElementTextEditMask);
     479    m_webPage->m_client->inputFocusGained(type,
     480                                          m_currentFocusElementTextEditMask,
     481                                          m_delayClientNotificationOfNavigationModeChange /* wait an explicit keyboard show call */);
    478482    m_navigationMode = true;
    479483
     
    749753
    750754    if (sendMessage)
     755        notifyClientOfNavigationModeChange(active);
     756}
     757
     758void InputHandler::setDelayClientNotificationOfNavigationModeChange(bool value)
     759{
     760    m_delayClientNotificationOfNavigationModeChange = value;
     761    m_pendingKeyboardStateChange = NoChange;
     762}
     763
     764void InputHandler::processPendingClientNavigationModeChangeNotification()
     765{
     766    if (!m_delayClientNotificationOfNavigationModeChange) {
     767        ASSERT(m_pendingKeyboardStateChange == NoChange);
     768        return;
     769    }
     770
     771    m_delayClientNotificationOfNavigationModeChange = false;
     772
     773    if (m_pendingKeyboardStateChange == NoChange)
     774        return;
     775
     776    notifyClientOfNavigationModeChange(m_pendingKeyboardStateChange == Visible);
     777    m_pendingKeyboardStateChange = NoChange;
     778}
     779
     780void InputHandler::notifyClientOfNavigationModeChange(bool active)
     781{
     782    if (!m_delayClientNotificationOfNavigationModeChange) {
    751783        m_webPage->m_client->inputSetNavigationMode(active);
     784        return;
     785    }
     786
     787    m_pendingKeyboardStateChange = active ? Visible : NotVisible;
    752788}
    753789
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h

    r107449 r107992  
    7878    void setInputValue(const WTF::String&);
    7979
     80    void setDelayClientNotificationOfNavigationModeChange(bool value);
     81    void processPendingClientNavigationModeChangeNotification();
     82
     83    void notifyClientOfNavigationModeChange(bool active);
     84
    8085    bool isInputMode() const { return isActiveTextEdit(); }
    8186    bool isMultilineInputMode() const { return isActiveTextEdit() && elementType(m_currentFocusElement.get()) == BlackBerry::Platform::InputTypeTextArea; }
     
    118123
    119124private:
     125    enum PendingKeyboardStateChange { NoChange, Visible, NotVisible };
     126
    120127    void setElementFocused(WebCore::Element*);
    121128    void setPluginFocused(WebCore::Element*);
     
    184191    int m_composingTextStart;
    185192    int m_composingTextEnd;
     193
     194    PendingKeyboardStateChange m_pendingKeyboardStateChange;
     195    bool m_delayClientNotificationOfNavigationModeChange;
    186196};
    187197
Note: See TracChangeset for help on using the changeset viewer.