Bug 170904

Summary: [WK2] Respect a new internal setting for defaulting to character selection granularity
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebKit2Assignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, buildbot, commit-queue, mitz, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
mitz: review+, buildbot: commit-queue-
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch for landing none

Description Wenson Hsieh 2017-04-17 09:26:39 PDT
<rdar://problem/31364280>
Comment 1 Wenson Hsieh 2017-04-17 09:47:57 PDT
Created attachment 307272 [details]
Patch
Comment 2 Build Bot 2017-04-17 11:27:09 PDT
Comment on attachment 307272 [details]
Patch

Attachment 307272 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3552101

New failing tests:
webrtc/multi-video.html
Comment 3 Build Bot 2017-04-17 11:27:10 PDT
Created attachment 307284 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 4 mitz 2017-04-17 11:30:37 PDT
Comment on attachment 307272 [details]
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:201
> +    BOOL defaultToSelectionGranularityCharacter = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitDebugDefaultSelectionGranularityCharacter"] && WebKit::linkedOnOrAfter(WebKit::SDKVersion::FirstToUseSelectionGranularityCharacterByDefault);
> +    _selectionGranularity = defaultToSelectionGranularityCharacter ? WKSelectionGranularityCharacter : WKSelectionGranularityDynamic;

Perhaps for wider testing it would be good to make the user default affect all apps regardless of when they were built?

Seems like this needs to be guarded with #if PLATFORM(IOS).
Comment 5 Wenson Hsieh 2017-04-17 11:39:52 PDT
(In reply to mitz from comment #4)
> Comment on attachment 307272 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=307272&action=review
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:201
> > +    BOOL defaultToSelectionGranularityCharacter = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitDebugDefaultSelectionGranularityCharacter"] && WebKit::linkedOnOrAfter(WebKit::SDKVersion::FirstToUseSelectionGranularityCharacterByDefault);
> > +    _selectionGranularity = defaultToSelectionGranularityCharacter ? WKSelectionGranularityCharacter : WKSelectionGranularityDynamic;
> 
> Perhaps for wider testing it would be good to make the user default affect
> all apps regardless of when they were built?

Sounds good. I think I will make this adjustment as a followup after we live with the default on for a bit and we're sure that first-party compatibility is not an issue. Perhaps we could then repurpose (and rename) this flag to force using WKSelectionGranularityCharacter, even when the application is linked on an iOS 10 SDK or earlier.

> 
> Seems like this needs to be guarded with #if PLATFORM(IOS).

Whoops, that's right -- fixed.
Comment 6 Wenson Hsieh 2017-04-17 11:42:27 PDT
Created attachment 307286 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2017-04-17 12:26:33 PDT
Comment on attachment 307286 [details]
Patch for landing

Clearing flags on attachment: 307286

Committed r215421: <http://trac.webkit.org/changeset/215421>