Changeset 230447 in webkit


Ignore:
Timestamp:
Apr 9, 2018 12:31:01 PM (6 years ago)
Author:
Megan Gardner
Message:

Switch to UIWKTextInteractionAssistant for non-editable text
https://bugs.webkit.org/show_bug.cgi?id=182834

Switch to only using one assistant for text selection.

Reviewed by Timothy Hatcher and Andy Estes.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView useSelectionAssistantWithGranularity:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r230443 r230447  
     12018-04-09  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Switch to UIWKTextInteractionAssistant for non-editable text
     4        https://bugs.webkit.org/show_bug.cgi?id=182834
     5
     6        Switch to only using one assistant for text selection.
     7
     8        Reviewed by Timothy Hatcher and Andy Estes.
     9
     10        * UIProcess/ios/WKContentViewInteraction.mm:
     11        (-[WKContentView useSelectionAssistantWithGranularity:]):
     12
    1132018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
    214
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r230217 r230447  
    19031903- (void)useSelectionAssistantWithGranularity:(WKSelectionGranularity)selectionGranularity
    19041904{
    1905 #if ENABLE(UNIFIED_TEXT_SELECTION)
    1906     selectionGranularity = WKSelectionGranularityCharacter;
    1907 #endif
    1908     if (selectionGranularity == WKSelectionGranularityDynamic) {
    1909         if (_textSelectionAssistant) {
    1910             [_textSelectionAssistant deactivateSelection];
    1911             _textSelectionAssistant = nil;
    1912         }
    1913         if (!_webSelectionAssistant)
    1914             _webSelectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:self]);
    1915     } else if (selectionGranularity == WKSelectionGranularityCharacter) {
    1916         if (_webSelectionAssistant)
    1917             _webSelectionAssistant = nil;
    1918 
    1919         if (!_textSelectionAssistant)
    1920             _textSelectionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]);
    1921         else {
    1922             // Reset the gesture recognizers in case editibility has changed.
    1923             [_textSelectionAssistant setGestureRecognizers];
    1924         }
    1925 
    1926         if (self.isFirstResponder && !self.suppressAssistantSelectionView)
    1927             [_textSelectionAssistant activateSelection];
    1928     }
     1905    _webSelectionAssistant = nil;
     1906
     1907    if (!_textSelectionAssistant)
     1908        _textSelectionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]);
     1909    else {
     1910        // Reset the gesture recognizers in case editibility has changed.
     1911        [_textSelectionAssistant setGestureRecognizers];
     1912    }
     1913
     1914    if (self.isFirstResponder && !self.suppressAssistantSelectionView)
     1915        [_textSelectionAssistant activateSelection];
    19291916}
    19301917
Note: See TracChangeset for help on using the changeset viewer.