Changeset 231054 in webkit


Ignore:
Timestamp:
Apr 26, 2018, 11:05:20 AM (7 years ago)
Author:
Megan Gardner
Message:

Activate selection when interacting with editable content
https://bugs.webkit.org/show_bug.cgi?id=185017

Reviewed by Tim Horton.

Source/WebKit:

Fixes a regression from r231016 where selection now does not work when interacting with
editable content. When we go into editable content, we should turn on the assistant.
This fulfills the requirement of user interaction as well, so any javascript selections
after this point should be valid.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _startAssistingKeyboard]):
(-[WKContentView _stopAssistingKeyboard]):

LayoutTests:

Fixed double-tap-on-editable-and-noneditable test, as it was not actually written correctly.
Should actually double tap on correct content and check for the correct output now.
Added two more tests to make sure that selections really are happening in editable content.

  • fast/events/touch/ios/double-tap-on-editable-and-noneditable.html:
  • fast/events/touch/ios/double-tap-on-editable-content-for-selection-expected.txt: Added.
  • fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text-expected.txt: Added.
  • fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html: Added.
  • fast/events/touch/ios/double-tap-on-editable-content-for-selection.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r231050 r231054  
     12018-04-25  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Activate selection when interacting with editable content
     4        https://bugs.webkit.org/show_bug.cgi?id=185017
     5
     6        Reviewed by Tim Horton.
     7       
     8        Fixed double-tap-on-editable-and-noneditable test, as it was not actually written correctly.
     9        Should actually double tap on correct content and check for the correct output now.
     10        Added two more tests to make sure that selections really are happening in editable content.
     11
     12        * fast/events/touch/ios/double-tap-on-editable-and-noneditable.html:
     13        * fast/events/touch/ios/double-tap-on-editable-content-for-selection-expected.txt: Added.
     14        * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text-expected.txt: Added.
     15        * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html: Added.
     16        * fast/events/touch/ios/double-tap-on-editable-content-for-selection.html: Added.
     17       
    1182018-04-25  Brent Fulgham  <bfulgham@apple.com>
    219
  • trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-and-noneditable.html

    r230850 r231054  
    2828            output += '<br>';
    2929
    30             var editableTargetRect = document.getElementById('noneditableTapPoint').getBoundingClientRect();
     30            var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
    3131
    3232            var editableTapPointX = editableTargetRect.x + editableTargetRect.width / 2;
    3333            var editableTapPointY = editableTargetRect.y + editableTargetRect.height / 2;
    3434
    35             await doubleTapAtPoint(noneditableTapPointX, noneditableTapPointY);
    36             if (document.getSelection().type == "None")
     35            await doubleTapAtPoint(editableTapPointX, editableTapPointY);
     36            if (document.getSelection().type != "None")
    3737                output += 'PASS: Has Selection';
    3838            else
     
    7676</head>
    7777<body>
    78 
    7978    <div id="noneditable">
    8079        <p>Lorem ipsum dolor sit amet, <span id="noneditableTapPoint">consectetur</span> adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
  • trunk/Source/WebKit/ChangeLog

    r231051 r231054  
     12018-04-25  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Activate selection when interacting with editable content
     4        https://bugs.webkit.org/show_bug.cgi?id=185017
     5
     6        Reviewed by Tim Horton.
     7       
     8        Fixes a regression from r231016 where selection now does not work when interacting with
     9        editable content. When we go into editable content, we should turn on the assistant.
     10        This fulfills the requirement of user interaction as well, so any javascript selections
     11        after this point should be valid.
     12
     13        * UIProcess/ios/WKContentViewInteraction.mm:
     14        (-[WKContentView _startAssistingKeyboard]):
     15        (-[WKContentView _stopAssistingKeyboard]):
     16
    1172018-04-26  Per Arne Vollan  <pvollan@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r231022 r231054  
    39683968{
    39693969    [self useSelectionAssistantWithGranularity:WKSelectionGranularityCharacter];
     3970   
     3971    if (self.isFirstResponder && !self.suppressAssistantSelectionView)
     3972        [_textSelectionAssistant activateSelection];
    39703973
    39713974#if !ENABLE(EXTRA_ZOOM_MODE)
     
    39773980{
    39783981    [self useSelectionAssistantWithGranularity:_webView._selectionGranularity];
     3982   
     3983    [_textSelectionAssistant deactivateSelection];
    39793984}
    39803985
Note: See TracChangeset for help on using the changeset viewer.