⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243241 in webkit


Ignore:
Timestamp:
Mar 20, 2019, 2:27:47 PM (7 years ago)
Author:
dino@apple.com
Message:

[iOS] Enable fast clicking everywhere
https://bugs.webkit.org/show_bug.cgi?id=196023
<rdar://problem/49073589>

Reviewed by Wenson Hsieh.

Source/WebKit:

Set FastClicksEverywhere to on by default for iPhone & iPad.

  • Shared/WebPreferences.yaml:
  • Shared/WebPreferencesDefaultValues.h:

LayoutTests:

Add a new test for the case where "Fast Clicks Everywhere" is explicitly
set to false. This required implementing a humanSpeedZoomByDoubleTappingAt
variation.

  • fast/events/ios/ipad/fast-click-always-expected.txt:
  • fast/events/ios/ipad/fast-click-always.html:
  • fast/events/ios/ipad/fast-click-not-always-expected.txt: Added.
  • fast/events/ios/ipad/fast-click-not-always.html:
  • resources/ui-helper.js:

(window.UIHelper.humanSpeedZoomByDoubleTappingAt): New helper function that pauses between
double taps, and resolves when the zoom finishes.

Location:
trunk
Files:
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243239 r243241  
     12019-03-20  Dean Jackson  <dino@apple.com>
     2
     3        [iOS] Enable fast clicking everywhere
     4        https://bugs.webkit.org/show_bug.cgi?id=196023
     5        <rdar://problem/49073589>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        Add a new test for the case where "Fast Clicks Everywhere" is explicitly
     10        set to false. This required implementing a humanSpeedZoomByDoubleTappingAt
     11        variation.
     12
     13        * fast/events/ios/ipad/fast-click-always-expected.txt:
     14        * fast/events/ios/ipad/fast-click-always.html:
     15        * fast/events/ios/ipad/fast-click-not-always-expected.txt: Added.
     16        * fast/events/ios/ipad/fast-click-not-always.html:
     17        * resources/ui-helper.js:
     18        (window.UIHelper.humanSpeedZoomByDoubleTappingAt): New helper function that pauses between
     19        double taps, and resolves when the zoom finishes.
     20
    1212019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/LayoutTests/fast/events/ios/ipad/fast-click-always-expected.txt

    r243015 r243241  
    11PASS: Click fired on element with handler.
    2 This document doesn't have fast clicks because it sets a viewport width. It has a significant zoom since the viewport width is significantly bigger than the body width. However, it sets fast click everywhere to on, so double tapping on the rectangle above should send a click event.
     2This document doesn't have fast clicks because it sets a viewport width. It has a significant zoom since the viewport width is significantly bigger than the body width. However, since fast click everywhere is set to true, double tapping on the rectangle above should send a click event.
  • trunk/LayoutTests/fast/events/ios/ipad/fast-click-always.html

    r243015 r243241  
    1 <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:FastClicksEverywhere=true ] -->
     1<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
    22
    33<html>
     
    5050<div id="description">This document doesn't have fast clicks because
    5151    it sets a viewport width. It has a significant zoom since the viewport
    52     width is significantly bigger than the body width. However, it sets fast click everywhere to
    53     on, so double tapping on the rectangle above should send a click event.</div>
     52    width is significantly bigger than the body width. However, since fast click everywhere
     53    is set to true, double tapping on the rectangle above should send a click event.</div>
    5454</body>
    5555</html>
  • trunk/LayoutTests/fast/events/ios/ipad/fast-click-not-always-expected.txt

    r243240 r243241  
    1 PASS: Click fired on element with handler.
    2 This document doesn't have fast clicks because it sets a viewport width. It has a significant zoom since the viewport width is significantly bigger than the body width. However, it sets fast click everywhere to on, so double tapping on the rectangle above should send a click event.
     1PASS: Double tap caused zoom.
     2This document doesn't have fast clicks because it sets a viewport width. It has a significant zoom since the viewport width is significantly bigger than the body width. However, it sets fast click everywhere to false, so double tapping on the rectangle above should zoom.
  • trunk/LayoutTests/fast/events/ios/ipad/fast-click-not-always.html

    r243240 r243241  
    1 <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:FastClicksEverywhere=true ] -->
     1<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:FastClicksEverywhere=false ] -->
    22
    33<html>
     
    2626            if (!window.testRunner)
    2727                return;
    28             await UIHelper.humanSpeedDoubleTapAt(30, 30);
     28
     29            await UIHelper.humanSpeedZoomByDoubleTappingAt(30, 30);
     30            document.getElementById("target").textContent = "PASS: Double tap caused zoom.";
     31            testRunner.notifyDone();
    2932        }
    3033
    3134        function handleClick(event)
    3235        {
    33             document.getElementById("target").textContent = "PASS: Click fired on element with handler.";
     36            document.getElementById("target").textContent = "FAIL: Click fired on element with handler.";
    3437            testRunner.notifyDone();
    3538        }
     
    5154    it sets a viewport width. It has a significant zoom since the viewport
    5255    width is significantly bigger than the body width. However, it sets fast click everywhere to
    53     on, so double tapping on the rectangle above should send a click event.</div>
     56    false, so double tapping on the rectangle above should zoom.</div>
    5457</body>
    5558</html>
  • trunk/LayoutTests/resources/ui-helper.js

    r242979 r243241  
    9696            await new Promise(resolveAfterDelay => setTimeout(resolveAfterDelay, 120));
    9797            await UIHelper.tapAt(x, y);
     98            resolve();
     99        });
     100    }
     101
     102    static humanSpeedZoomByDoubleTappingAt(x, y)
     103    {
     104        console.assert(this.isIOS());
     105
     106        if (!this.isWebKit2()) {
     107            // FIXME: Add a sleep in here.
     108            eventSender.addTouchPoint(x, y);
     109            eventSender.touchStart();
     110            eventSender.releaseTouchPoint(0);
     111            eventSender.touchEnd();
     112            eventSender.addTouchPoint(x, y);
     113            eventSender.touchStart();
     114            eventSender.releaseTouchPoint(0);
     115            eventSender.touchEnd();
     116            return Promise.resolve();
     117        }
     118
     119        return new Promise(async (resolve) => {
     120            await UIHelper.tapAt(x, y);
     121            await new Promise(resolveAfterDelay => setTimeout(resolveAfterDelay, 120));
     122            await new Promise((resolveAfterZoom) => {
     123                testRunner.runUIScript(`
     124                    uiController.didEndZoomingCallback = () => {
     125                        uiController.didEndZoomingCallback = null;
     126                        uiController.uiScriptComplete(uiController.zoomScale);
     127                    };
     128                    uiController.singleTapAtPoint(${x}, ${y}, () => {});`, resolveAfterZoom);
     129            });
    98130            resolve();
    99131        });
  • trunk/Source/WebKit/ChangeLog

    r243240 r243241  
     12019-03-20  Dean Jackson  <dino@apple.com>
     2
     3        [iOS] Enable fast clicking everywhere
     4        https://bugs.webkit.org/show_bug.cgi?id=196023
     5        <rdar://problem/49073589>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        Set FastClicksEverywhere to on by default for iPhone & iPad.
     10
     11        * Shared/WebPreferences.yaml:
     12        * Shared/WebPreferencesDefaultValues.h:
     13
    1142019-03-20  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r243181 r243241  
    15041504FastClicksEverywhere:
    15051505  type: bool
    1506   defaultValue: false
     1506  defaultValue: DEFAULT_FAST_CLICKS_EVERYWHERE
    15071507  condition: PLATFORM(IOS_FAMILY)
    15081508  humanReadableName: "Fast clicks everywhere"
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h

    r242814 r243241  
    252252#define DEFAULT_DOM_PASTE_ACCESS_REQUESTS_ENABLED false
    253253#endif
     254
     255#if PLATFORM(IOS_FAMILY)
     256#if PLATFORM(WATCHOS)
     257#define DEFAULT_FAST_CLICKS_EVERYWHERE false
     258#else
     259#define DEFAULT_FAST_CLICKS_EVERYWHERE true
     260#endif
     261#endif
Note: See TracChangeset for help on using the changeset viewer.