Changeset 230745 in webkit


Ignore:
Timestamp:
Apr 17, 2018 6:03:22 PM (6 years ago)
Author:
Megan Gardner
Message:

Don't activate selection on become first responder
https://bugs.webkit.org/show_bug.cgi?id=184719

Reviewed by Tim Horton.

If we activate the selection immediately on becoming first responder, we cause the selection view to delete itself
since it is not guaranteed to have selection rects immediately due to async/two process architecture. The selection
is activated already when the selection rects change, so there is no reason to activate it now. This has likely worked
in the past because this selection assistant was only for editable text, which would immediately set a caret, which
is a selection. Now that this is for non-editable text as well, activating the selection is problematic.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView becomeFirstResponderForWebView]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r230743 r230745  
     12018-04-17  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Don't activate selection on become first responder
     4        https://bugs.webkit.org/show_bug.cgi?id=184719
     5
     6        Reviewed by Tim Horton.
     7       
     8        If we activate the selection immediately on becoming first responder, we cause the selection view to delete itself
     9        since it is not guaranteed to have selection rects immediately due to async/two process architecture. The selection
     10        is activated already when the selection rects change, so there is no reason to activate it now. This has likely worked
     11        in the past because this selection assistant was only for editable text, which would immediately set a caret, which
     12        is a selection. Now that this is for non-editable text as well, activating the selection is problematic.
     13
     14        * UIProcess/ios/WKContentViewInteraction.mm:
     15        (-[WKContentView becomeFirstResponderForWebView]):
     16
    1172018-04-11  Brian Burg  <bburg@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r230686 r230745  
    938938        didBecomeFirstResponder = [super becomeFirstResponder];
    939939    }
    940     if (didBecomeFirstResponder && !self.suppressAssistantSelectionView)
    941         [_textSelectionAssistant activateSelection];
    942940
    943941    return didBecomeFirstResponder;
Note: See TracChangeset for help on using the changeset viewer.