Bug 182485 - [iOS] UI for Experimental Features does not correctly update preferences
Summary: [iOS] UI for Experimental Features does not correctly update preferences
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 149264
  Show dependency treegraph
 
Reported: 2018-02-05 07:41 PST by Frédéric Wang (:fredw)
Modified: 2018-02-23 06:09 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2018-02-05 07:41:45 PST
I'm testing with iOS Simulator 10.0, using a nightly build and the public SDK. Here is a way to reproduce:

1) Launch Safari with Tools/Script/run-safari --ios-simulator
2) Use Home button and go to "Settings => Safari => Experimental Features". Disable all but "Constant Properties". Use Home button and go back to Safari, so that the settings are updated.
3) Debug MobileSafari, place a break point on WebPreferences::setEnabledForFeature after the key string is retrieved (DerivedSources/WebKit2/WebPreferencesExperimentalFeatures.cpp)
4) Use Home button, go back to Settings and enable WebGPU. Use Home button and go back to Safari, so that the settings are updated. Breakpoint is not called.
5) Use Home button, go back to Settings and disable WebGPU. Use Home button and go back to Safari, so that the settings are updated. Breakpoint is not called.
6) Use Home button; go back to Settings and enable Async Frame Scrolling. Use Home button and go back to Safari, so that the settings are updated. Breakpoint is called with key "AsyncFrameScrollingEnabled".
7) Use Home button, go back to Settings and enable WebGPU. Use Home button and go back to Safari, so that the settings are updated. Breakpoint is called with key "AsyncFrameScrollingEnabled".
8) Use Home button, go back to Settings and disable Async Frame Scrolling. Use Home button and go back to Safari, so that the settings are updated. Breakpoint is not called.

Actual result: WebPreferences::setEnabledForFeature is sometimes not called, sometimes not for the modified key. 
Expected result: WebPreferences::setEnabledForFeature should be called for each key that was modified.
Comment 1 Frédéric Wang (:fredw) 2018-02-22 14:04:06 PST
After more analysis, this is a more accurate description of the behavior I see:

* For the options that are not in the setters[] array then WebPreferences::setEnabledForFeature is never called. This includes the obsolete UI items "CSS display: contents", "Remove Legacy WebRTC API" and "Viewport Fit". Note that I was testing with WEBGPU disabled in comment 0 so "WebGPUEnabled" was not in the setters[] array.

* If you enable "Constant Properties", then WebPreferences::setEnabledForFeature is *not* called for "ConstantPropertiesEnabled". If you disable "Constant Properties" then WebPreferences::setEnabledForFeature is called.

* For other properties, this is the other way around: WebPreferences::setEnabledForFeature is called when the option is enabled but *not* when the option is disabled. This includes the case of "AsyncFrameScrollingEnabled" mentioned in comment 0.

* If "Constant Properties" was disabled when you modified the value of another option then WebPreferences::setEnabledForFeature is called for "ConstantPropertiesEnabled" in addition to any other calls mentioned above.
Comment 2 Radar WebKit Bug Importer 2018-02-22 14:25:53 PST
<rdar://problem/37802321>