[webkit-reviews] review granted: [Bug 217784] Create API to enable/disable text interaction gestures in WKWebView : [Attachment 415256] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 3 16:05:45 PST 2020


Wenson Hsieh <wenson_hsieh at apple.com> has granted katherine_cheney at apple.com's
request for review:
Bug 217784: Create API to enable/disable text interaction gestures in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=217784

Attachment 415256: Patch

https://bugs.webkit.org/attachment.cgi?id=415256&action=review




--- Comment #34 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 415256
  --> https://bugs.webkit.org/attachment.cgi?id=415256
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415256&action=review

> Source/WTF/Scripts/Preferences/WebPreferences.yaml:2286
> +	 default: true

Should this default to false on watchOS? (I'd imagine that once we remove the
old _textInteractionGesturesEnabled SPI, watchOS WebKit clients shouldn't be
required to set `textInteractionGesturesEnabled` to `NO` to get the right
behavior).

> Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h:65
> + at property (nonatomic) BOOL textInteractionGesturesEnabled
WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

I'm not sure if "text interaction gestures" is a term that is really used on
macOS to describe selecting text and modifying caret selections…but I'd imagine
other folks (both WebKit and outside of WebKit) will have more input here. IMO,
`textSelectionEnabled` or `textInteractionEnabled` seem more concise and
accurate.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDisableSelection.mm:58
> +    EXPECT_STREQ("", selectedText2.UTF8String);

Nit - you can use EXPECT_WK_STREQ here instead to avoid the extra
`.UTF8String`.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDisableSelection.mm:93
> +    EXPECT_STREQ("", selectedText2.UTF8String);

Ditto.


More information about the webkit-reviews mailing list