Bug 204026 - Web Inspector: Unchecking Enable Preview Features on Engineering and Preview builds does not affect WI.arePreviewFeaturesEnabled()
Summary: Web Inspector: Unchecking Enable Preview Features on Engineering and Preview ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-08 15:19 PST by Nikita Vasilyev
Modified: 2020-01-17 16:16 PST (History)
4 users (show)

See Also:


Attachments
Patch (3.87 KB, patch)
2019-11-08 15:36 PST, Nikita Vasilyev
bburg: review-
bburg: commit-queue-
Details | Formatted Diff | Diff
Patch (3.71 KB, patch)
2020-01-17 13:46 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2019-11-08 15:19:30 PST
WI.arePreviewFeaturesEnabled() correctly returns true by default on Engineering and Preview builds.

However, this setting

    Staging: [ ] Enable Preview Features

doesn't affect WI.arePreviewFeaturesEnabled(), which is used to determine whether or not we show the new P3 color picker.
If the setting is unchecked, WI.arePreviewFeaturesEnabled() still returns true.
Comment 1 Radar WebKit Bug Importer 2019-11-08 15:29:01 PST
<rdar://problem/57037089>
Comment 2 Nikita Vasilyev 2019-11-08 15:36:57 PST
Created attachment 383172 [details]
Patch
Comment 3 BJ Burg 2019-11-08 17:13:55 PST
Comment on attachment 383172 [details]
Patch

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

I don't understand the need for a separate WI.canShowPreviewFeatures().

> Source/WebInspectorUI/UserInterface/Base/Setting.js:189
> +    experimentalEnablePreviewFeatures: new WI.Setting("experimental-enable-preview-features", true),

I'm not sure what to think here. Why has the default changed?

I would assume Safari Technology Preview should always show experimental features, whereas production builds should hide them behind a checkbox? In that case the default should depend on

if (WI.isExperimentalBuild && !WI.isEngineeringBuild)

> Source/WebInspectorUI/UserInterface/Base/Setting.js:223
> +    return hasPreviewFeatures && (WI.isExperimentalBuild || WI.isEngineeringBuild);

This is redundant. Engineering builds always define ENABLE(EXPERIMENTAL_FEATURES).

> Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:349
> +        if (WI.canShowPreviewFeatures()) {

Please just make this

if (WI.arePreviewFeaturesEnabled() && WI.previewFeatures.length)
Comment 4 Nikita Vasilyev 2019-11-08 17:57:12 PST
Comment on attachment 383172 [details]
Patch

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

All I care is to be able disable & enable preview preview features in the engineering build. Now I can't do that because the checkbox does nothing.

>> Source/WebInspectorUI/UserInterface/Base/Setting.js:189
>> +    experimentalEnablePreviewFeatures: new WI.Setting("experimental-enable-preview-features", true),
> 
> I'm not sure what to think here. Why has the default changed?
> 
> I would assume Safari Technology Preview should always show experimental features, whereas production builds should hide them behind a checkbox? In that case the default should depend on
> 
> if (WI.isExperimentalBuild && !WI.isEngineeringBuild)

Production builds hide preview features and don't even show the checkbox. This patch didn't change that.

This patch allows to disable preview features in engineering and STP builds. Before this patch the setting existed but the checkbox wouldn't actually do anything.

Re: "Why has the default changed?". Preview features should be enabled by default in engineering and STP builds. Changing the default was the most straightforward fix. Let me know if you have other suggestions.

>> Source/WebInspectorUI/UserInterface/Base/Setting.js:223
>> +    return hasPreviewFeatures && (WI.isExperimentalBuild || WI.isEngineeringBuild);
> 
> This is redundant. Engineering builds always define ENABLE(EXPERIMENTAL_FEATURES).

Thanks.

>> Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:349
>> +        if (WI.canShowPreviewFeatures()) {
> 
> Please just make this
> 
> if (WI.arePreviewFeaturesEnabled() && WI.previewFeatures.length)

This is used in two different places and it has a comment. I thought I would make sense not to repeat it.
Comment 5 BJ Burg 2020-01-06 09:24:33 PST
Comment on attachment 383172 [details]
Patch

Please rebase the patch and address the redundant check I pointed out, thanks.
Comment 6 Nikita Vasilyev 2020-01-17 13:46:50 PST
Created attachment 388086 [details]
Patch

Rebaselined.
Comment 7 BJ Burg 2020-01-17 14:58:29 PST
Comment on attachment 388086 [details]
Patch

r=me
Comment 8 WebKit Commit Bot 2020-01-17 16:15:42 PST
The commit-queue encountered the following flaky tests while processing attachment 388086 [details]:

editing/spelling/spellcheck-async-remove-frame.html bug 158401 (authors: morrita@google.com, rniwa@webkit.org, and tony@chromium.org)
The commit-queue is continuing to process your patch.
Comment 9 WebKit Commit Bot 2020-01-17 16:16:13 PST
Comment on attachment 388086 [details]
Patch

Clearing flags on attachment: 388086

Committed r254773: <https://trac.webkit.org/changeset/254773>
Comment 10 WebKit Commit Bot 2020-01-17 16:16:15 PST
All reviewed patches have been landed.  Closing bug.