Changeset 136633 in webkit


Ignore:
Timestamp:
Dec 4, 2012 9:11:12 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] VKB flickers in and out when tapping on webview after text selection on URL bar
https://bugs.webkit.org/show_bug.cgi?id=103874
PR245678

Patch by Sean Wang <Xuewen.Wang@torchmobile.com.cn> on 2012-12-04
Reviewed by Rob Buis.
Internally reviewed by Mike Fenton.

When the virtual keyboard is hiding, the viewport is changed and the page needs
to relayout.At the same time, the user interface thread is executing compositeLayers
and it will dispatch the updateDelegatedOverlays() to webkit thread which will trigger
the selectionPositionChanged() in webkit thread.

When the selectionPositionChanged() calls frame->selection()->selection().
visibleStart() and frame->selection()->selection().visibleEnd(), it will
trigger page relayout and return the relayouted selection start and end position.
These positions are out of the range which is recorded before its relayout.
As a result it think the selection start and end are all clipped out and it send
out an "empty selection"(not selected) changing event.

When the WebPageClient receives the empty selection changing event, it will consider
the selection process aborted and might cancel selection-related user interaction.
This is not what we intend to happen.

This patch stops the changing handling process and returns when the page needs relayout,
and the selection will be updated again when the page finishs relayout.

  • WebKitSupport/SelectionHandler.cpp:

(BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):

Location:
trunk/Source/WebKit/blackberry
Files:
2 edited

Legend:

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

    r136621 r136633  
     12012-12-04  Sean Wang  <Xuewen.Wang@torchmobile.com.cn>
     2        [BlackBerry] VKB flickers in and out when tapping on webview after text selection on URL bar
     3        https://bugs.webkit.org/show_bug.cgi?id=103874
     4        PR245678
     5
     6        Reviewed by Rob Buis.
     7        Internally reviewed by Mike Fenton.
     8
     9        When the virtual keyboard is hiding, the viewport is changed and the page needs
     10        to relayout.At the same time, the user interface thread  is executing compositeLayers
     11        and it will dispatch the updateDelegatedOverlays() to webkit thread which will trigger
     12        the selectionPositionChanged() in webkit thread.
     13
     14        When the selectionPositionChanged() calls frame->selection()->selection().
     15        visibleStart() and frame->selection()->selection().visibleEnd(), it will
     16        trigger page relayout and return the relayouted selection start and end position.
     17        These positions are out of the range which is recorded before its relayout.
     18        As a result it think the selection start and end are all clipped out and it send
     19        out an "empty selection"(not selected) changing event.
     20
     21        When the WebPageClient receives the empty selection changing event, it will consider
     22        the selection process aborted and might cancel selection-related user interaction.
     23        This is not what we intend to happen.
     24
     25        This patch stops the changing handling process and returns when the page needs relayout,
     26        and the selection will be updated again when the page finishs relayout.
     27
     28        * WebKitSupport/SelectionHandler.cpp:
     29        (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
     30
    1312012-12-04  Andrew Lo  <anlo@rim.com>
    232
  • trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp

    r135655 r136633  
    885885    // selection is active and becomes caret selection.
    886886    Frame* frame = m_webPage->focusedOrMainFrame();
     887
     888    if (frame->view()->needsLayout())
     889        return;
     890
    887891    WebCore::IntPoint framePos = m_webPage->frameOffset(frame);
    888892    if (m_selectionActive && (m_caretActive || frame->selection()->isNone()))
Note: See TracChangeset for help on using the changeset viewer.