Changeset 249368 in webkit


Ignore:
Timestamp:
Sep 1, 2019 1:42:36 PM (5 years ago)
Author:
Wenson Hsieh
Message:

Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
https://bugs.webkit.org/show_bug.cgi?id=201346
<rdar://problem/54885784>

Reviewed by Dean Jackson.

Source/WebKit:

For apps that are linked on or after iOS 13, we add a context menu interaction to the content view, which
requires us to disable (or avoid adding) the highlight long press gesture recognizer. However, for apps that are
linked on the iOS 12 SDK or prior, this gesture is still present, and fires when long pressing for (roughly) up
to 0.75 seconds if a tap gesture was not recognized instead. Firing this gesture sends a click event to the
page; this brings back some form of <rdar://problem/53889373>, but only when holding for slightly longer than a
normal tap, and also only in apps linked on iOS 12 or earlier. To fix this, we apply a similar solution as in
r248433 and detect whether a long press gesture interrupted scroll view deceleration in
-gestureRecognizerShouldBegin:. If so, we return NO to avoid clicking. See per-method comments below for more
details.

Testing this bug as-is was tricky, since there's no way in layout tests to simulate being linked on or before a
given SDK version. Luckily, recall that:

  1. This bug occurs when the highlight gesture recognizer is enabled and added to the content view.
  2. The highlight gesture recognizer only needs to be disabled or removed when context menu interaction is added.

As such, we should be able to restore the highlight gesture recognizer by suppressing the context menu
interaction in an app linked-on-or-after iOS 13, by setting allowsLinkPreview to NO. Unfortunately, this doesn't
quite work, since we currently always avoid adding the highlight gesture recognizer if the app is linked on
iOS 13 or later.

However, this means that the highlight gesture recognizer is absent from the content view in apps linked against
iOS 13 that disable link previews, even though its absence is not required. This means that long pressing a
clickable element in a web view that disables link previews does not show a tap highlight on iOS 13, whereas it
would on iOS 12; this is a regression, albeit a very subtle one. To fix this subtle issue and make it possible
to write a test for this bug, we refactor some logic for creating and configuring the highlight long press
gesture, such that we now unconditionally add the highlight gesture, but only enable it in apps linked on or
after iOS 13 if link previews (i.e. context menu interaction) are not allowed.

Test: fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html

  • SourcesCocoa.txt:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView setAllowsLinkPreview:]):

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

(-[WKContentView setupInteraction]):

Refactor our gesture setup logic to always create and add the long press and highlight long press gestures, but
conditionally disable them based on whether or not (1) the context menu is available, and (2) WKWebView's
allowsLinkPreview property.

(-[WKContentView _didChangeLinkPreviewAvailability]):
(-[WKContentView _updateLongPressAndHighlightLongPressGestures]):

Add a new helper to update the enabled state of the long press and highlight long press gestures, by consulting
-_shouldUseContextMenu and -allowsLinkPreview. This is called when setting up the gestures, as well as whenever
-allowsLinkPreview changes.

(-[WKContentView gestureRecognizerShouldBegin:]):

Factor out logic to ascend the view hierarchy in search of a UIScrollView that was interrupted while
decelerating into a local lambda function; use this for both the highlight gesture and the single tap gesture,
to determine whether they should begin.

  • UIProcess/ios/WKHighlightLongPressGestureRecognizer.h: Added.
  • UIProcess/ios/WKHighlightLongPressGestureRecognizer.mm: Added.

In order to remember the UIScrollView (if any) tracked by the highlight long press gesture, we subclass
_UIWebHighlightLongPressGestureRecognizer. While UILongPressGestureRecognizer does have SPI to ask for a list of
UITouches, by the time the gesture has been recognized and the gesture delegates are invoked, these UITouches
no longer correspond to UIViews. As such, the only time we have access to the list of UITouches with their
UIViews is during the touches* subclass hooks.

(-[WKHighlightLongPressGestureRecognizer reset]):

Clear out the tracked UIScrollView here, when the gesture is reset (i.e. after ending, or being canceled).

(-[WKHighlightLongPressGestureRecognizer touchesBegan:withEvent:]):

Remember the last touched UIScrollView here.

(-[WKHighlightLongPressGestureRecognizer lastTouchedScrollView]):

  • WebKit.xcodeproj/project.pbxproj:

Tools:

Add a new test option to allow tests to disable link previews.

  • WebKitTestRunner/TestController.cpp:

(WTR::updateTestOptionsFromTestHeader):

  • WebKitTestRunner/TestOptions.h:

Drive-by fix: also check enableLazyImageLoading when determining whether two TestOptions are the same.

(WTR::TestOptions::hasSameInitializationOptions const):

  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::TestController::platformCreateWebView):

LayoutTests:

Add a couple of new layout tests to verify that using a long press gesture to interrupt momentum scrolling in a
web view that uses API to disable link previews does not result in a click.

  • fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame-expected.txt: Added.
  • fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame.html: Added.
  • fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow-expected.txt: Added.
  • fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html: Added.
Location:
trunk
Files:
6 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249367 r249368  
     12019-09-01  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
     4        https://bugs.webkit.org/show_bug.cgi?id=201346
     5        <rdar://problem/54885784>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a couple of new layout tests to verify that using a long press gesture to interrupt momentum scrolling in a
     10        web view that uses API to disable link previews does not result in a click.
     11
     12        * fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame-expected.txt: Added.
     13        * fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame.html: Added.
     14        * fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow-expected.txt: Added.
     15        * fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html: Added.
     16
    1172019-09-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
    218
  • trunk/Source/WebKit/ChangeLog

    r249366 r249368  
     12019-09-01  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
     4        https://bugs.webkit.org/show_bug.cgi?id=201346
     5        <rdar://problem/54885784>
     6
     7        Reviewed by Dean Jackson.
     8
     9        For apps that are linked on or after iOS 13, we add a context menu interaction to the content view, which
     10        requires us to disable (or avoid adding) the highlight long press gesture recognizer. However, for apps that are
     11        linked on the iOS 12 SDK or prior, this gesture is still present, and fires when long pressing for (roughly) up
     12        to 0.75 seconds if a tap gesture was not recognized instead. Firing this gesture sends a click event to the
     13        page; this brings back some form of <rdar://problem/53889373>, but only when holding for slightly longer than a
     14        normal tap, and also only in apps linked on iOS 12 or earlier. To fix this, we apply a similar solution as in
     15        r248433 and detect whether a long press gesture interrupted scroll view deceleration in
     16        -gestureRecognizerShouldBegin:. If so, we return NO to avoid clicking. See per-method comments below for more
     17        details.
     18
     19        Testing this bug as-is was tricky, since there's no way in layout tests to simulate being linked on or before a
     20        given SDK version. Luckily, recall that:
     21        1. This bug occurs when the highlight gesture recognizer is enabled and added to the content view.
     22        2. The highlight gesture recognizer only needs to be disabled or removed when context menu interaction is added.
     23        As such, we should be able to restore the highlight gesture recognizer by suppressing the context menu
     24        interaction in an app linked-on-or-after iOS 13, by setting allowsLinkPreview to NO. Unfortunately, this doesn't
     25        quite work, since we currently always avoid adding the highlight gesture recognizer if the app is linked on
     26        iOS 13 or later.
     27
     28        However, this means that the highlight gesture recognizer is absent from the content view in apps linked against
     29        iOS 13 that disable link previews, even though its absence is not required. This means that long pressing a
     30        clickable element in a web view that disables link previews does not show a tap highlight on iOS 13, whereas it
     31        would on iOS 12; this is a regression, albeit a very subtle one. To fix this subtle issue and make it possible
     32        to write a test for this bug, we refactor some logic for creating and configuring the highlight long press
     33        gesture, such that we now unconditionally add the highlight gesture, but only enable it in apps linked on or
     34        after iOS 13 if link previews (i.e. context menu interaction) are not allowed.
     35
     36        Test: fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html
     37
     38        * SourcesCocoa.txt:
     39        * UIProcess/API/Cocoa/WKWebView.mm:
     40        (-[WKWebView setAllowsLinkPreview:]):
     41        * UIProcess/ios/WKContentViewInteraction.h:
     42        * UIProcess/ios/WKContentViewInteraction.mm:
     43        (-[WKContentView setupInteraction]):
     44
     45        Refactor our gesture setup logic to always create and add the long press and highlight long press gestures, but
     46        conditionally disable them based on whether or not (1) the context menu is available, and (2) WKWebView's
     47        allowsLinkPreview property.
     48
     49        (-[WKContentView _didChangeLinkPreviewAvailability]):
     50        (-[WKContentView _updateLongPressAndHighlightLongPressGestures]):
     51
     52        Add a new helper to update the enabled state of the long press and highlight long press gestures, by consulting
     53        -_shouldUseContextMenu and -allowsLinkPreview. This is called when setting up the gestures, as well as whenever
     54        -allowsLinkPreview changes.
     55
     56        (-[WKContentView gestureRecognizerShouldBegin:]):
     57
     58        Factor out logic to ascend the view hierarchy in search of a UIScrollView that was interrupted while
     59        decelerating into a local lambda function; use this for both the highlight gesture and the single tap gesture,
     60        to determine whether they should begin.
     61
     62        * UIProcess/ios/WKHighlightLongPressGestureRecognizer.h: Added.
     63        * UIProcess/ios/WKHighlightLongPressGestureRecognizer.mm: Added.
     64
     65        In order to remember the UIScrollView (if any) tracked by the highlight long press gesture, we subclass
     66        _UIWebHighlightLongPressGestureRecognizer. While UILongPressGestureRecognizer does have SPI to ask for a list of
     67        UITouches, by the time the gesture has been recognized and the gesture delegates are invoked, these UITouches
     68        no longer correspond to UIViews. As such, the only time we have access to the list of UITouches with their
     69        UIViews is during the touches* subclass hooks.
     70
     71        (-[WKHighlightLongPressGestureRecognizer reset]):
     72
     73        Clear out the tracked UIScrollView here, when the gesture is reset (i.e. after ending, or being canceled).
     74
     75        (-[WKHighlightLongPressGestureRecognizer touchesBegan:withEvent:]):
     76
     77        Remember the last touched UIScrollView here.
     78
     79        (-[WKHighlightLongPressGestureRecognizer lastTouchedScrollView]):
     80        * WebKit.xcodeproj/project.pbxproj:
     81
    1822019-08-30  Brent Fulgham  <bfulgham@apple.com>
    283
  • trunk/Source/WebKit/SourcesCocoa.txt

    r249155 r249368  
    423423UIProcess/ios/WKGeolocationProviderIOS.mm
    424424UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm
     425UIProcess/ios/WKHighlightLongPressGestureRecognizer.mm
    425426UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm
    426427UIProcess/ios/WKKeyboardScrollingAnimator.mm
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r249329 r249368  
    12681268    else
    12691269        [_contentView _unregisterPreview];
     1270    [_contentView _didChangeLinkPreviewAvailability];
    12701271#endif // HAVE(LINK_PREVIEW)
    12711272#endif // PLATFORM(IOS_FAMILY)
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r249112 r249368  
    100100@class _UILookupGestureRecognizer;
    101101@class _UIHighlightView;
    102 @class _UIWebHighlightLongPressGestureRecognizer;
    103102@class UIHoverGestureRecognizer;
    104103@class UITargetedPreview;
     
    110109@class WKFormInputControl;
    111110@class WKFormInputSession;
     111@class WKHighlightLongPressGestureRecognizer;
    112112@class WKInspectorNodeSearchGestureRecognizer;
    113113
     
    214214
    215215    RetainPtr<WKSyntheticTapGestureRecognizer> _singleTapGestureRecognizer;
    216     RetainPtr<_UIWebHighlightLongPressGestureRecognizer> _highlightLongPressGestureRecognizer;
     216    RetainPtr<WKHighlightLongPressGestureRecognizer> _highlightLongPressGestureRecognizer;
    217217    RetainPtr<UILongPressGestureRecognizer> _longPressGestureRecognizer;
    218218    RetainPtr<WKSyntheticTapGestureRecognizer> _doubleTapGestureRecognizer;
     
    549549@property (nonatomic, readonly) BOOL _shouldAvoidScrollingWhenFocusedContentIsVisible;
    550550
     551- (void)_didChangeLinkPreviewAvailability;
     552
    551553@end
    552554
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r249275 r249368  
    5353#import "WKFormInputControl.h"
    5454#import "WKFormSelectControl.h"
     55#import "WKHighlightLongPressGestureRecognizer.h"
    5556#import "WKImagePreviewViewController.h"
    5657#import "WKInspectorNodeSearchGestureRecognizer.h"
     
    756757    [self addGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()];
    757758
    758     _highlightLongPressGestureRecognizer = adoptNS([[_UIWebHighlightLongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_highlightLongPressRecognized:)]);
     759    _highlightLongPressGestureRecognizer = adoptNS([[WKHighlightLongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_highlightLongPressRecognized:)]);
    759760    [_highlightLongPressGestureRecognizer setDelay:highlightDelay];
    760761    [_highlightLongPressGestureRecognizer setDelegate:self];
     762    [self addGestureRecognizer:_highlightLongPressGestureRecognizer.get()];
     763
     764    [self _createAndConfigureLongPressGestureRecognizer];
    761765
    762766#if HAVE(LINK_PREVIEW)
    763     if (!self._shouldUseContextMenus) {
    764         [self addGestureRecognizer:_highlightLongPressGestureRecognizer.get()];
    765         [self _createAndConfigureLongPressGestureRecognizer];
    766     }
     767    [self _updateLongPressAndHighlightLongPressGestures];
    767768#endif
    768769
     
    10051006    [self addGestureRecognizer:_touchActionGestureRecognizer.get()];
    10061007#endif
     1008}
     1009
     1010- (void)_didChangeLinkPreviewAvailability
     1011{
     1012    [self _updateLongPressAndHighlightLongPressGestures];
     1013}
     1014
     1015- (void)_updateLongPressAndHighlightLongPressGestures
     1016{
     1017    // We only disable the highlight long press gesture in the case where UIContextMenu is available and we
     1018    // also allow link previews, since the context menu interaction's gestures need to take precedence over
     1019    // highlight long press gestures.
     1020    [_highlightLongPressGestureRecognizer setEnabled:!self._shouldUseContextMenus || !_webView.allowsLinkPreview];
     1021
     1022    // We only enable the long press gesture in the case where the app is linked on iOS 12 or earlier (and
     1023    // therefore prefers the legacy action sheet over context menus), and link previews are also enabled.
     1024    [_longPressGestureRecognizer setEnabled:!self._shouldUseContextMenus && _webView.allowsLinkPreview];
    10071025}
    10081026
     
    20922110        return _webView._stylusTapGestureShouldCreateEditableImage;
    20932111
    2094     if (gestureRecognizer == _singleTapGestureRecognizer) {
     2112    auto isInterruptingDecelerationForScrollViewOrAncestor = [&] (UIScrollView *scrollView) {
    20952113        UIScrollView *mainScroller = _webView.scrollView;
    2096         UIView *view = [_singleTapGestureRecognizer lastTouchedScrollView] ?: mainScroller;
     2114        UIView *view = scrollView ?: mainScroller;
    20972115        while (view) {
    20982116            if ([view isKindOfClass:UIScrollView.class] && [(UIScrollView *)view _isInterruptingDeceleration])
    2099                 return NO;
     2117                return YES;
    21002118
    21012119            if (mainScroller == view)
     
    21042122            view = view.superview;
    21052123        }
    2106         return YES;
    2107     }
     2124        return NO;
     2125    };
     2126
     2127    if (gestureRecognizer == _singleTapGestureRecognizer)
     2128        return !isInterruptingDecelerationForScrollViewOrAncestor([_singleTapGestureRecognizer lastTouchedScrollView]);
    21082129
    21092130    if (gestureRecognizer == _highlightLongPressGestureRecognizer
     
    21242145
    21252146    if (gestureRecognizer == _highlightLongPressGestureRecognizer) {
     2147        if (isInterruptingDecelerationForScrollViewOrAncestor([_highlightLongPressGestureRecognizer lastTouchedScrollView]))
     2148            return NO;
     2149
    21262150        if (hasFocusedElement(_focusedElementInformation)) {
    21272151            // This is a different element than the focused one.
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r249308 r249368  
    17081708                F4D5F51D206087A10038BBA8 /* WKTextInputListViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = F4D5F519206087A00038BBA8 /* WKTextInputListViewController.h */; };
    17091709                F4D5F51F206087A10038BBA8 /* WKQuickboardListViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = F4D5F51B206087A10038BBA8 /* WKQuickboardListViewController.h */; };
     1710                F4DB54E62319E733009E3155 /* WKHighlightLongPressGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F4DB54E42319E733009E3155 /* WKHighlightLongPressGestureRecognizer.h */; };
    17101711                F6113E25126CE1820057D0A7 /* APIUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = F6113E24126CE1820057D0A7 /* APIUserContentURLPattern.h */; };
    17111712                F6113E29126CE19B0057D0A7 /* WKUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = F6113E27126CE19B0057D0A7 /* WKUserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    47654766                F4D5F51B206087A10038BBA8 /* WKQuickboardListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKQuickboardListViewController.h; path = ios/forms/WKQuickboardListViewController.h; sourceTree = "<group>"; };
    47664767                F4D5F51C206087A10038BBA8 /* WKQuickboardListViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKQuickboardListViewController.mm; path = ios/forms/WKQuickboardListViewController.mm; sourceTree = "<group>"; };
     4768                F4DB54E42319E733009E3155 /* WKHighlightLongPressGestureRecognizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKHighlightLongPressGestureRecognizer.h; path = ios/WKHighlightLongPressGestureRecognizer.h; sourceTree = "<group>"; };
     4769                F4DB54E52319E733009E3155 /* WKHighlightLongPressGestureRecognizer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKHighlightLongPressGestureRecognizer.mm; path = ios/WKHighlightLongPressGestureRecognizer.mm; sourceTree = "<group>"; };
    47674770                F4F59AD32065A5C9006CAA46 /* WKSelectMenuListViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKSelectMenuListViewController.mm; path = ios/forms/WKSelectMenuListViewController.mm; sourceTree = "<group>"; };
    47684771                F4F59AD42065A5CA006CAA46 /* WKSelectMenuListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKSelectMenuListViewController.h; path = ios/forms/WKSelectMenuListViewController.h; sourceTree = "<group>"; };
     
    61026105                                0FCB4E4018BBE044000FCFC9 /* WKGeolocationProviderIOS.mm */,
    61036106                                0FCB4E4118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm */,
     6107                                F4DB54E42319E733009E3155 /* WKHighlightLongPressGestureRecognizer.h */,
     6108                                F4DB54E52319E733009E3155 /* WKHighlightLongPressGestureRecognizer.mm */,
    61046109                                933DF82D1B3BC09000AEA9E3 /* WKImagePreviewViewController.h */,
    61056110                                933DF82F1B3BC0B400AEA9E3 /* WKImagePreviewViewController.mm */,
     
    99399944                                C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */,
    99409945                                2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */,
     9946                                46C392292316EC4D008EED9B /* WebPageProxyIdentifier.h in Headers */,
    99419947                                BCBD3915125BB1A800D2C29F /* WebPageProxyMessages.h in Headers */,
    99429948                                512127C41908239A00DAF35C /* WebPasteboardOverrides.h in Headers */,
     
    1002910035                                2D12DAB520662C73006F00FB /* WKAnimationDelegate.h in Headers */,
    1003010036                                BCDDB32D124EC2E10048D13C /* WKAPICast.h in Headers */,
    10031                                 46C392292316EC4D008EED9B /* WebPageProxyIdentifier.h in Headers */,
    1003210037                                512E34E5130B4D0500ABD19A /* WKApplicationCacheManager.h in Headers */,
    1003310038                                A13DC682207AA6B20066EF72 /* WKApplicationStateTrackingView.h in Headers */,
     
    1017910184                                0FCB4E4F18BBE044000FCFC9 /* WKGeolocationProviderIOS.h in Headers */,
    1018010185                                BCC8B374125FB69000DE46A4 /* WKGeometry.h in Headers */,
     10186                                F4DB54E62319E733009E3155 /* WKHighlightLongPressGestureRecognizer.h in Headers */,
    1018110187                                1A422F8B18B29B5400D8CD96 /* WKHistoryDelegatePrivate.h in Headers */,
    1018210188                                B62E7312143047B00069EC35 /* WKHitTestResult.h in Headers */,
  • trunk/Tools/ChangeLog

    r249366 r249368  
     12019-09-01  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
     4        https://bugs.webkit.org/show_bug.cgi?id=201346
     5        <rdar://problem/54885784>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a new test option to allow tests to disable link previews.
     10
     11        * WebKitTestRunner/TestController.cpp:
     12        (WTR::updateTestOptionsFromTestHeader):
     13        * WebKitTestRunner/TestOptions.h:
     14
     15        Drive-by fix: also check enableLazyImageLoading when determining whether two TestOptions are the same.
     16
     17        (WTR::TestOptions::hasSameInitializationOptions const):
     18        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
     19        (WTR::TestController::platformCreateWebView):
     20
    1212019-08-30  Brent Fulgham  <bfulgham@apple.com>
    222
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r249096 r249368  
    14031403        else if (key == "enableLazyImageLoading")
    14041404            testOptions.enableLazyImageLoading = parseBooleanTestHeaderValue(value);
     1405        else if (key == "allowsLinkPreview")
     1406            testOptions.allowsLinkPreview = parseBooleanTestHeaderValue(value);
    14051407        pairStart = pairEnd + 1;
    14061408    }
  • trunk/Tools/WebKitTestRunner/TestOptions.h

    r248960 r249368  
    9696    bool enablePageCache { false };
    9797    bool enableLazyImageLoading { false };
     98    bool allowsLinkPreview { true };
    9899
    99100    double contentInsetTop { 0 };
     
    152153            || contentMode != options.contentMode
    153154            || enableAppNap != options.enableAppNap
    154             || enablePageCache != options.enablePageCache)
     155            || enablePageCache != options.enablePageCache
     156            || enableLazyImageLoading != options.enableLazyImageLoading
     157            || allowsLinkPreview != options.allowsLinkPreview)
    155158            return false;
    156159
  • trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

    r249096 r249368  
    178178    if (options.editable)
    179179        m_mainWebView->setEditable(true);
     180
     181    m_mainWebView->platformView().allowsLinkPreview = options.allowsLinkPreview;
    180182}
    181183
Note: See TracChangeset for help on using the changeset viewer.