Bug 170904 - [WK2] Respect a new internal setting for defaulting to character selection granularity
Summary: [WK2] Respect a new internal setting for defaulting to character selection gr...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-17 09:26 PDT by Wenson Hsieh
Modified: 2017-04-17 16:42 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.80 KB, patch)
2017-04-17 09:47 PDT, Wenson Hsieh
mitz: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews125 for ios-simulator-wk2 (889.34 KB, application/zip)
2017-04-17 11:27 PDT, Build Bot
no flags Details
Patch for landing (2.84 KB, patch)
2017-04-17 11:42 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>