Changeset 264481 in webkit


Ignore:
Timestamp:
Jul 16, 2020 2:59:33 PM (4 years ago)
Author:
Megan Gardner
Message:

Selection is not always clearing when tapping.
https://bugs.webkit.org/show_bug.cgi?id=214326
Source/WebKit:

<rdar://problem/65069201>

Reviewed by Wenson Hsieh.

In r262280 we stopped the UIWKGestureOneFingerTap gesture from starting if the tap was not inside
the current selection. That caused the selection to not always be cleared, especially when tapping
on an element that could create an overlay in which the selection was supposed to be obscured. We
short circuited this gesture because it used to cause a sync IPC message to be sent to the web process,
but that code has subsequently changed, so allowing the gesture to start and clear the selection in all
cases is no longer a performance concern, so changing the behavior back to allowing the gesture to always
start, even if the touch is not inside the selection rect.

Test: editing/selection/ios/hide-selection-after-tap-on-prevent-default-element.html

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

LayoutTests:

Reviewed by Wenson Hsieh.

  • editing/selection/ios/hide-selection-after-tap-on-prevent-default-element-expected.txt: Added.
  • editing/selection/ios/hide-selection-after-tap-on-prevent-default-element.html: Added.
  • resources/ui-helper.js:

(window.UIHelper.tapElement):

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r264479 r264481  
     12020-07-16  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Selection is not always clearing when tapping.
     4        https://bugs.webkit.org/show_bug.cgi?id=214326
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        * editing/selection/ios/hide-selection-after-tap-on-prevent-default-element-expected.txt: Added.
     9        * editing/selection/ios/hide-selection-after-tap-on-prevent-default-element.html: Added.
     10        * resources/ui-helper.js:
     11        (window.UIHelper.tapElement):
     12
    1132020-07-16  Truitt Savell  <tsavell@apple.com>
    214
  • trunk/LayoutTests/resources/ui-helper.js

    r264187 r264481  
    128128                });`, resolve);
    129129        });
     130    }
     131
     132    static tapElement(element, delay = 0)
     133    {
     134        const x = element.offsetLeft + (element.offsetWidth / 2);
     135        const y = element.offsetTop + (element.offsetHeight / 2);
     136        this.tapAt(x, y);
    130137    }
    131138
  • trunk/Source/WebKit/ChangeLog

    r264477 r264481  
     12020-07-16  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Selection is not always clearing when tapping.
     4        https://bugs.webkit.org/show_bug.cgi?id=214326
     5        <rdar://problem/65069201>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        In r262280 we stopped the UIWKGestureOneFingerTap gesture from starting if the tap was not inside
     10        the current selection. That caused the selection to not always be cleared, especially when tapping
     11        on an element that could create an overlay in which the selection was supposed to be obscured. We
     12        short circuited this gesture because it used to cause a sync IPC message to be sent to the web process,
     13        but that code has subsequently changed, so allowing the gesture to start and clear the selection in all
     14        cases is no longer a performance concern, so changing the behavior back to allowing the gesture to always
     15        start, even if the touch is not inside the selection rect.
     16
     17        Test: editing/selection/ios/hide-selection-after-tap-on-prevent-default-element.html
     18
     19        * UIProcess/ios/WKContentViewInteraction.mm:
     20        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
     21
    1222020-07-16  Eric Carlson  <eric.carlson@apple.com>
    223
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r264420 r264481  
    25862586            }
    25872587            default:
    2588                 if (!_page->editorState().selectionIsRange)
    2589                     return NO;
    2590                 return [self _pointIsInsideSelectionRect:point outBoundingRect:nil];
     2588                return _page->editorState().selectionIsRange;
    25912589            }
    25922590        }
Note: See TracChangeset for help on using the changeset viewer.