Skip to content

Commit

Permalink
"Async UIKit Interactions" enablement should default to the correspon…
Browse files Browse the repository at this point in the history
…ding system feature flag

https://bugs.webkit.org/show_bug.cgi?id=265548
rdar://118945616

Reviewed by Megan Gardner and Abrar Rahman Protyasha.

Make the default value of this internal feature flag match the closely-related system feature flag,
`UIKit/async_text_input`.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebKit/Shared/WebPreferencesDefaultValues.h:
* Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm:
(WebKit::defaultUseAsyncUIKitInteractions):
* Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:

Also, adjust the corresponding `run-webkit-tests` argument to make it possible to run layout tests
with the WebKit feature flag off, even if `UIKit/async_text_input` is enabled in the simulator.

(parse_args):

Canonical link: https://commits.webkit.org/271321@main
  • Loading branch information
whsieh committed Nov 30, 2023
1 parent b217c0b commit 94f99d6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6660,7 +6660,7 @@ UseAsyncUIKitInteractions:
WebKitLegacy:
default: false
WebKit:
default: false
default: WebKit::defaultUseAsyncUIKitInteractions()
WebCore:
default: false

Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/Shared/WebPreferencesDefaultValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ bool defaultCSSOMViewScrollingAPIEnabled();
bool defaultShouldPrintBackgrounds();
bool defaultAlternateFormControlDesignEnabled();
bool defaultVideoFullscreenRequiresElementFullscreen();
bool defaultUseAsyncUIKitInteractions();
#if ENABLE(TEXT_AUTOSIZING)
bool defaultTextAutosizingUsesIdempotentMode();
#endif
Expand Down
13 changes: 13 additions & 0 deletions Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#if PLATFORM(IOS_FAMILY)

#import <pal/spi/cocoa/FeatureFlagsSPI.h>
#import <pal/spi/ios/ManagedConfigurationSPI.h>
#import <pal/system/ios/Device.h>
#import <pal/system/ios/UserInterfaceIdiom.h>
Expand Down Expand Up @@ -74,6 +75,18 @@ bool defaultMediaSourceEnabled()

#endif

bool defaultUseAsyncUIKitInteractions()
{
static bool enabled = false;
#if HAVE(UI_ASYNC_TEXT_INTERACTION)
static std::once_flag flag;
std::call_once(flag, [] {
enabled = os_feature_enabled(UIKit, async_text_input);
});
#endif
return enabled;
}

} // namespace WebKit

#endif // PLATFORM(IOS_FAMILY)
8 changes: 4 additions & 4 deletions Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ def parse_args(args):
"--no-use-gpu-process", action="store_true", default=False,
help=("Disable GPU process for DOM rendering.")),
optparse.make_option(
"--use-async-uikit-interactions", action="store_true", default=False,
help=("Opt into async UIKit interactions (iOS-family WebKit2 ports only)")),
"--no-use-async-uikit-interactions", action="store_true", default=False,
help=("Opt out of async UIKit interactions (iOS-family WebKit2 ports only)")),
optparse.make_option(
"--prefer-integrated-gpu", action="store_true", default=False,
help=("Prefer using the lower-power integrated GPU on a dual-GPU system. Note that other running applications and the tests themselves can override this request.")),
Expand Down Expand Up @@ -415,12 +415,12 @@ def parse_args(args):
raise RuntimeError('--accessibility-isolated-tree implicitly sets the result flavor, this should not be overridden')
options.result_report_flavor = 'accessibility-isolated-tree'

if options.use_async_uikit_interactions:
if options.no_use_async_uikit_interactions:
host = Host()
host.initialize_scm()
if not options.internal_feature:
options.internal_feature = []
options.internal_feature.append('UseAsyncUIKitInteractions')
options.internal_feature.append('UseAsyncUIKitInteractions=0')

return options, args

Expand Down

0 comments on commit 94f99d6

Please sign in to comment.