Changeset 246213 in webkit


Ignore:
Timestamp:
Jun 7, 2019 1:55:45 PM (5 years ago)
Author:
graouts@webkit.org
Message:

Restrict fast clicks everywhere to desktop content mode
https://bugs.webkit.org/show_bug.cgi?id=198610
<rdar://problem/50114230>

Reviewed by Dean Jackson.

Source/WebKit:

We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.

This patch had been reverted once because it yielded some regressions in existing tests, notably under
fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
rathern than the recognition of two single taps.

  • UIProcess/WebPageProxy.h:

(WebKit::WebPageProxy::allowsFastClicksEverywhere const):

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
(_didStartProvisionalLoadForMainFrame):

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

LayoutTests:

Add a new test that enables fast clicks but also sets a mobile content mode.

We also mark fast/visual-viewport/ios/min-scale-greater-than-one.html as non-flaky
since the flakiness was due to the fast clicks everywhere behavior being enabled on iPhone.

Finally, we can now remove the hack where ui.tap() in the Pointer Events utility returned
a promise with a one-second delay since the issue of double-taps being recognized instead of
two consecutive single taps across two tests has been resolved.

  • fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt: Added.
  • fast/events/ios/ipad/fast-click-always-mobile-content-mode.html: Added.
  • platform/ios-simulator-wk2/TestExpectations:
  • pointerevents/utils.js:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246203 r246213  
     12019-06-07  Antoine Quint  <graouts@apple.com>
     2
     3        Restrict fast clicks everywhere to desktop content mode
     4        https://bugs.webkit.org/show_bug.cgi?id=198610
     5        <rdar://problem/50114230>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a new test that enables fast clicks but also sets a mobile content mode.
     10       
     11        We also mark fast/visual-viewport/ios/min-scale-greater-than-one.html as non-flaky
     12        since the flakiness was due to the fast clicks everywhere behavior being enabled on iPhone.
     13
     14        Finally, we can now remove the hack where ui.tap() in the Pointer Events utility returned
     15        a promise with a one-second delay since the issue of double-taps being recognized instead of
     16        two consecutive single taps across two tests has been resolved.
     17
     18        * fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt: Added.
     19        * fast/events/ios/ipad/fast-click-always-mobile-content-mode.html: Added.
     20        * platform/ios-simulator-wk2/TestExpectations:
     21        * pointerevents/utils.js:
     22
    1232019-06-07  Shawn Roberts  <sroberts@apple.com>
    224
  • trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations

    r246175 r246213  
    5353webkit.org/b/196233 fast/viewport/ios/initial-scale-after-changing-view-scale.html [ Pass Timeout ]
    5454
    55 webkit.org/b/196236 [ Debug ] fast/visual-viewport/ios/min-scale-greater-than-one.html [ Pass Failure ]
    56 
    5755webkit.org/b/196269 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html [ Pass Timeout ]
    5856webkit.org/b/196269 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html [ Pass Timeout ]
     
    6361webkit.org/b/191709 editing/deleting/delete-emoji-9.html [ Pass Failure ]
    6462webkit.org/b/191709 editing/deleting/delete-emoji.html [ Pass Failure ]
    65 
    66 webkit.org/b/196300 fast/visual-viewport/ios/min-scale-greater-than-one.html [ Pass Failure ]
    6763
    6864webkit.org/b/196298 fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html [ Pass Failure ]
  • trunk/LayoutTests/pointerevents/utils.js

    r245506 r246213  
    119119    tap(options)
    120120    {
    121         // Add a delay to ensure sequence of tap() calls don't yield double taps.
    122         const delay = 1000;
    123         return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`).then(() => {
    124             return new Promise(resolve => setTimeout(resolve, delay));
    125         });
     121        return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`);
    126122    }
    127123
  • trunk/Source/WebKit/ChangeLog

    r246204 r246213  
     12019-06-07  Antoine Quint  <graouts@apple.com>
     2
     3        Restrict fast clicks everywhere to desktop content mode
     4        https://bugs.webkit.org/show_bug.cgi?id=198610
     5        <rdar://problem/50114230>
     6
     7        Reviewed by Dean Jackson.
     8
     9        We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
     10        when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.
     11
     12        This patch had been reverted once because it yielded some regressions in existing tests, notably under
     13        fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
     14        used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
     15        to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
     16        rathern than the recognition of two single taps.
     17
     18        * UIProcess/WebPageProxy.h:
     19        (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
     20        * UIProcess/ios/WKContentViewInteraction.mm:
     21        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
     22        (_didStartProvisionalLoadForMainFrame):
     23        * UIProcess/ios/WebPageProxyIOS.mm:
     24        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
     25
    1262019-06-07  Brent Fulgham  <bfulgham@apple.com>
    227
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r246201 r246213  
    519519    bool hasCommittedAnyProvisionalLoads() const { return m_hasCommittedAnyProvisionalLoads; }
    520520
     521    bool allowsFastClicksEverywhere() const { return m_allowsFastClicksEverywhere; }
     522
    521523    void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
    522524    bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
     
    24822484    bool m_openedByDOM { false };
    24832485    bool m_hasCommittedAnyProvisionalLoads { false };
     2486    bool m_allowsFastClicksEverywhere { false };
    24842487
    24852488    HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r246183 r246213  
    15881588        return;
    15891589
    1590     if (_page->preferences().fastClicksEverywhere()) {
     1590    if (_page->preferences().fastClicksEverywhere() && _page->allowsFastClicksEverywhere()) {
    15911591        RELEASE_LOG(ViewGestures, "Potential tap found an element and fast taps are forced on. Trigger click. (%p)", self);
    15921592        [self _setDoubleTapGesturesEnabled:NO];
     
    37923792    [_doubleTapGestureRecognizerForDoubleClick setEnabled:NO];
    37933793    [_doubleTapGestureRecognizerForDoubleClick setEnabled:YES];
     3794    // We also need to disable the double-tap gesture recognizers that are enabled for double-tap-to-zoom and which
     3795    // are enabled when a single tap is first recognized. This avoids tests running in sequence and simulating taps
     3796    // in the same location to trigger double-tap recognition.
     3797    [self _setDoubleTapGesturesEnabled:NO];
    37943798}
    37953799
  • trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r246183 r246213  
    13771377    }
    13781378
     1379    m_allowsFastClicksEverywhere = false;
     1380
    13791381    if (!useDesktopBrowsingMode)
    13801382        return WebContentMode::Mobile;
     
    13981400        policies.setSimulatedMouseEventsDispatchPolicy(WebsiteSimulatedMouseEventsDispatchPolicy::Allow);
    13991401        policies.setLegacyOverflowScrollingTouchPolicy(WebsiteLegacyOverflowScrollingTouchPolicy::Disable);
     1402        m_allowsFastClicksEverywhere = true;
    14001403    }
    14011404
Note: See TracChangeset for help on using the changeset viewer.