Changeset 251379 in webkit


Ignore:
Timestamp:
Oct 21, 2019, 1:43:00 PM (5 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Provide a flag for technology preview builds
https://bugs.webkit.org/show_bug.cgi?id=203164
<rdar://problem/56202164>

Reviewed by Devin Rousso.

Source/WebCore:

  • inspector/InspectorFrontendHost.cpp:

(WebCore::InspectorFrontendHost::isExperimentalBuild):

  • inspector/InspectorFrontendHost.h:
  • inspector/InspectorFrontendHost.idl:

Source/WebInspectorUI:

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Test/Test.js:
  • UserInterface/Base/Main.js:
  • UserInterface/Base/Setting.js:

(WI.isTechnologyPreviewBuild):
(WI.arePreviewFeaturesEnabled):

  • UserInterface/Views/SettingsTabContentView.js:

(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
In non-TechnologyPreview builds, if there are Preview Features provide a
setting switch that can be used to match the TechnologyPreview features.

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r251378 r251379  
     12019-10-21  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Provide a flag for technology preview builds
     4        https://bugs.webkit.org/show_bug.cgi?id=203164
     5        <rdar://problem/56202164>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * inspector/InspectorFrontendHost.cpp:
     10        (WebCore::InspectorFrontendHost::isExperimentalBuild):
     11        * inspector/InspectorFrontendHost.h:
     12        * inspector/InspectorFrontendHost.idl:
     13
    1142019-10-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
    215
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp

    r250996 r251379  
    447447}
    448448
     449bool InspectorFrontendHost::isExperimentalBuild()
     450{
     451#if ENABLE(EXPERIMENTAL_FEATURES)
     452    return true;
     453#else
     454    return false;
     455#endif
     456}
     457
    449458void InspectorFrontendHost::unbufferedLog(const String& message)
    450459{
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.h

    r247043 r251379  
    112112
    113113    bool isUnderTest();
     114    bool isExperimentalBuild();
    114115    void unbufferedLog(const String& message);
    115116
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.idl

    r247043 r251379  
    8484
    8585    boolean isUnderTest();
     86    boolean isExperimentalBuild();
    8687
    8788    void beep();
  • trunk/Source/WebInspectorUI/ChangeLog

    r251376 r251379  
     12019-10-21  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Provide a flag for technology preview builds
     4        https://bugs.webkit.org/show_bug.cgi?id=203164
     5        <rdar://problem/56202164>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * Localizations/en.lproj/localizedStrings.js:
     10
     11        * UserInterface/Test/Test.js:
     12        * UserInterface/Base/Main.js:
     13        * UserInterface/Base/Setting.js:
     14        (WI.isTechnologyPreviewBuild):
     15        (WI.arePreviewFeaturesEnabled):
     16        * UserInterface/Views/SettingsTabContentView.js:
     17        (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
     18        In non-TechnologyPreview builds, if there are Preview Features provide a
     19        setting switch that can be used to match the TechnologyPreview features.
     20
    1212019-10-21  Devin Rousso  <drousso@apple.com>
    222
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r251227 r251379  
    442442localizedStrings["Enable Local Override"] = "Enable Local Override";
    443443localizedStrings["Enable New Tab Bar"] = "Enable New Tab Bar";
     444localizedStrings["Enable Preview Features"] = "Enable Preview Features";
    444445localizedStrings["Enable Program"] = "Enable Program";
    445446localizedStrings["Enable Rule"] = "Enable Rule";
     
    10641065localizedStrings["Specificity: No value for selected element"] = "Specificity: No value for selected element";
    10651066localizedStrings["Spelling"] = "Spelling";
     1067localizedStrings["Staging:"] = "Staging:";
    10661068localizedStrings["Stalled"] = "Stalled";
    10671069localizedStrings["Start"] = "Start";
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r251229 r251379  
    32363236
    32373237WI.isEngineeringBuild = false;
     3238WI.isExperimentalBuild = InspectorFrontendHost.isExperimentalBuild();
    32383239
    32393240// OpenResourceDialog delegate
  • trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js

    r251306 r251379  
    187187
    188188    // Experimental
     189    experimentalEnablePreviewFeatures: new WI.Setting("experimental-enable-preview-features", false),
    189190    experimentalEnableLayersTab: new WI.Setting("experimental-enable-layers-tab", false),
    190191    experimentalEnableNewTabBar: new WI.Setting("experimental-enable-new-tab-bar", false),
     
    212213    debugLayoutDirection: new WI.Setting("debug-layout-direction-override", "system"),
    213214};
     215
     216WI.previewFeatures = [];
     217
     218WI.isTechnologyPreviewBuild = function()
     219{
     220    return WI.isExperimentalBuild && !WI.isEngineeringBuild;
     221};
     222
     223WI.arePreviewFeaturesEnabled = function()
     224{
     225    if (WI.isExperimentalBuild)
     226        return true;
     227
     228    if (WI.settings.experimentalEnablePreviewFeatures.value)
     229        return true;
     230
     231    return false;
     232};
  • trunk/Source/WebInspectorUI/UserInterface/Test/Test.js

    r251227 r251379  
    184184
    185185WI.isDebugUIEnabled = () => false;
     186
     187WI.isEngineeringBuild = false;
     188WI.isExperimentalBuild = true;
    186189
    187190WI.unlocalizedString = (string) => string;
  • trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js

    r251306 r251379  
    347347        let initialValues = new Map;
    348348
     349        // WebKit may by default enable certain features in a Technology Preview that are not enabled in trunk.
     350        // Provide a switch that will make non-preview builds behave like an experimental build, for those preview features.
     351        let hasPreviewFeatures = WI.previewFeatures.length > 0;
     352        if (hasPreviewFeatures && (WI.isTechnologyPreviewBuild() || WI.isEngineeringBuild)) {
     353            experimentalSettingsView.addSetting(WI.UIString("Staging:"), WI.settings.experimentalEnablePreviewFeatures, WI.UIString("Enable Preview Features"));
     354            experimentalSettingsView.addSeparator();
     355        }
     356
    349357        if (InspectorBackend.hasDomain("LayerTree")) {
    350358            experimentalSettingsView.addSetting(WI.UIString("Layers:"), WI.settings.experimentalEnableLayersTab, WI.UIString("Enable Layers Tab"));
     
    382390        }
    383391
     392        listenForChange(WI.settings.experimentalEnablePreviewFeatures);
    384393        listenForChange(WI.settings.experimentalEnableLayersTab);
    385394        listenForChange(WI.settings.experimentalEnableNewTabBar);
Note: See TracChangeset for help on using the changeset viewer.