Changeset 256378 in webkit


Ignore:
Timestamp:
Feb 11, 2020 2:57:39 PM (4 years ago)
Author:
dbates@webkit.org
Message:

Should not allow zooming to reveal focused element when suppressing selection assistant
https://bugs.webkit.org/show_bug.cgi?id=207575

Reviewed by Wenson Hsieh.

Do not tell the UIScrollView to scroll and zoom to reveal the focused element when the
selection assistant is being suppressed as it does not make sense to do so: the primary
motivation for zooming to reveal the focused (aka the editable) element is make it easier
to edit it.

This fixes a bug where previewing a partially offscreen link inside an editable element
would cause the page content to scroll and zoom to reveal the editable element. Previewing
a link is not considered an editing operation and selection assistance is prevented, but
"zoom to reveal" was inadvertently allowed. Now it is not.

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

(-[WKContentView _zoomToRevealFocusedElement]): Bail out if selection is being suppressed
for any reason. Note that pre-r245882 there was reason SuppressSelectionAssistantReason::DropAnimationIsRunning
that was used to suppress selection assistance AND allow "zoom to reveal". But this
reason was removed and there are no suppression reasons as of the time of writing where
it makes sense to have behavior like SuppressSelectionAssistantReason::DropAnimationIsRunning.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r256376 r256378  
     12020-02-11  Daniel Bates  <dabates@apple.com>
     2
     3        Should not allow zooming to reveal focused element when suppressing selection assistant
     4        https://bugs.webkit.org/show_bug.cgi?id=207575
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Do not tell the UIScrollView to scroll and zoom to reveal the focused element when the
     9        selection assistant is being suppressed as it does not make sense to do so: the primary
     10        motivation for zooming to reveal the focused (aka the editable) element is make it easier
     11        to edit it.
     12
     13        This fixes a bug where previewing a partially offscreen link inside an editable element
     14        would cause the page content to scroll and zoom to reveal the editable element. Previewing
     15        a link is not considered an editing operation and selection assistance is prevented, but
     16        "zoom to reveal" was inadvertently allowed. Now it is not.
     17
     18        * UIProcess/ios/WKContentViewInteraction.h:
     19        * UIProcess/ios/WKContentViewInteraction.mm:
     20        (-[WKContentView _zoomToRevealFocusedElement]): Bail out if selection is being suppressed
     21        for any reason. Note that pre-r245882 there was reason SuppressSelectionAssistantReason::DropAnimationIsRunning
     22        that was used to suppress selection assistance AND allow "zoom to reveal". But this
     23        reason was removed and there are no suppression reasons as of the time of writing where
     24        it makes sense to have behavior like SuppressSelectionAssistantReason::DropAnimationIsRunning.
     25
    1262020-02-11  Alex Christensen  <achristensen@webkit.org>
    227
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r256105 r256378  
    19371937- (void)_zoomToRevealFocusedElement
    19381938{
    1939     if (_suppressSelectionAssistantReasons.contains(WebKit::EditableRootIsTransparentOrFullyClipped) || _suppressSelectionAssistantReasons.contains(WebKit::FocusedElementIsTooSmall))
     1939    if (_suppressSelectionAssistantReasons)
    19401940        return;
    19411941
Note: See TracChangeset for help on using the changeset viewer.