Changeset 166027 in webkit


Ignore:
Timestamp:
Mar 20, 2014 5:07:34 PM (10 years ago)
Author:
enrica@apple.com
Message:

[iOS WebKit2] typing and deleting text lags behind the caret movement on google.com.
https://bugs.webkit.org/show_bug.cgi?id=130544
<rdar://problem/16380296>

Reviewed by Tim Horton.

On iOS the selection is drawn in the UIProcess. If the WebProcess is
processing multiple requests within the same runloop, the caret could be
updated in the UIProcess before the WebProcess has had a chance to paint.
This change synchronizes the selection drawing with the tile update.

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/WKContentView.mm:

(-[WKContentView _didCommitLayerTree:WebKit::]):

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _selectionChanged]):
(-[WKContentView _updateChangedSelection]):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::didChangeSelection):

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r166026 r166027  
     12014-03-20  Enrica Casucci  <enrica@apple.com>
     2
     3        [iOS WebKit2] typing and deleting text lags behind the caret movement on google.com.
     4        https://bugs.webkit.org/show_bug.cgi?id=130544
     5        <rdar://problem/16380296>
     6
     7        Reviewed by Tim Horton.
     8
     9        On iOS the selection is drawn in the UIProcess. If the WebProcess is
     10        processing multiple requests within the same runloop, the caret could be
     11        updated in the UIProcess before the WebProcess has had a chance to paint.
     12        This change synchronizes the selection drawing with the tile update.
     13
     14        * UIProcess/WebPageProxy.h:
     15        * UIProcess/ios/WKContentView.mm:
     16        (-[WKContentView _didCommitLayerTree:WebKit::]):
     17        * UIProcess/ios/WKContentViewInteraction.h:
     18        * UIProcess/ios/WKContentViewInteraction.mm:
     19        (-[WKContentView _selectionChanged]):
     20        (-[WKContentView _updateChangedSelection]):
     21        * WebProcess/WebPage/WebPage.cpp:
     22        (WebKit::WebPage::didChangeSelection):
     23
    1242014-03-20  Alexey Proskuryakov  <ap@apple.com>
    225
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r165652 r166027  
    295295
    296296    [_webView _didCommitLayerTree:layerTreeTransaction];
     297    [self _updateChangedSelection];
    297298}
    298299
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h

    r164955 r166027  
    111111    BOOL _hasValidPositionInformation;
    112112    BOOL _isTapHighlightIDValid;
     113    BOOL _selectionNeedsUpdate;
    113114}
    114115
     
    130131- (void)_stopAssistingNode;
    131132- (void)_selectionChanged;
     133- (void)_updateChangedSelection;
    132134- (BOOL)_interpretKeyEvent:(WebIOSEvent *)theEvent isCharEvent:(BOOL)isCharEvent;
    133135- (void)_positionInformationDidChange:(const WebKit::InteractionInformationAtPosition&)info;
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

    r166002 r166027  
    19191919- (void)_selectionChanged
    19201920{
     1921    _selectionNeedsUpdate = YES;
     1922}
     1923
     1924- (void)_updateChangedSelection
     1925{
     1926    if (!_selectionNeedsUpdate)
     1927        return;
     1928
    19211929    // FIXME: We need to figure out what to do if the selection is changed by Javascript.
    19221930    if (_textSelectionAssistant) {
     
    19261934    } else
    19271935        [_webSelectionAssistant selectionChanged];
     1936    _selectionNeedsUpdate = NO;
    19281937}
    19291938
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r166017 r166027  
    40984098{
    40994099    send(Messages::WebPageProxy::EditorStateChanged(editorState()));
     4100#if PLATFORM(IOS)
     4101    m_drawingArea->scheduleCompositingLayerFlush();
     4102#endif
    41004103}
    41014104
Note: See TracChangeset for help on using the changeset viewer.