Changeset 251883 in webkit


Ignore:
Timestamp:
Oct 31, 2019 3:00:22 PM (4 years ago)
Author:
Devin Rousso
Message:

Web Inspector: REGRESSION(r251038): Elements: Computed: variables are shown in the Properties section instead of in the Variables section
https://bugs.webkit.org/show_bug.cgi?id=203668

Reviewed by Matt Baker.

  • UserInterface/Views/ComputedStyleDetailsPanel.js:

(WI.ComputedStyleDetailsPanel.prototype.initialLayout):

  • UserInterface/Views/ComputedStyleSection.js:

(WI.ComputedStyleSection):
(WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Added.
(WI.ComputedStyleSection.prototype.get propertiesToRender):
Reintroduce the propertyVisibilityMode concept to WI.ComputedStyleSection so that the
Computed details panel can prevent CSS variables from being shown in the Properites section.

  • UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:

(WI.SpreadsheetCSSStyleDeclarationSection.prototype.get propertiesToRender):
Replace variable getter with isVariable to match r251038.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r251871 r251883  
     12019-10-31  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: REGRESSION(r251038): Elements: Computed: variables are shown in the Properties section instead of in the Variables section
     4        https://bugs.webkit.org/show_bug.cgi?id=203668
     5
     6        Reviewed by Matt Baker.
     7
     8        * UserInterface/Views/ComputedStyleDetailsPanel.js:
     9        (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
     10        * UserInterface/Views/ComputedStyleSection.js:
     11        (WI.ComputedStyleSection):
     12        (WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Added.
     13        (WI.ComputedStyleSection.prototype.get propertiesToRender):
     14        Reintroduce the `propertyVisibilityMode` concept to `WI.ComputedStyleSection` so that the
     15        Computed details panel can prevent CSS variables from being shown in the Properites section.
     16
     17        * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
     18        (WI.SpreadsheetCSSStyleDeclarationSection.prototype.get propertiesToRender):
     19        Replace `variable` getter with `isVariable` to match r251038.
     20
    1212019-10-31  Devin Rousso  <drousso@apple.com>
    222
  • trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js

    r251038 r251883  
    105105        this._computedStyleSection.addEventListener(WI.ComputedStyleSection.Event.FilterApplied, this._handleEditorFilterApplied, this);
    106106        this._computedStyleSection.showsImplicitProperties = this._computedStyleShowAllSetting.value;
     107        this._computedStyleSection.propertyVisibilityMode = WI.ComputedStyleSection.PropertyVisibilityMode.HideVariables;
    107108        this._computedStyleSection.showsShorthandsInsteadOfLonghands = this._computedStylePreferShorthandsSetting.value;
    108109        this._computedStyleSection.alwaysShowPropertyNames = ["display", "width", "height"];
  • trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.js

    r251038 r251883  
    4141        this._showsShorthandsInsteadOfLonghands = false;
    4242        this._alwaysShowPropertyNames = new Set;
     43        this._propertyVisibilityMode = WI.ComputedStyleSection.PropertyVisibilityMode.ShowAll;
    4344        this._hideFilterNonMatchingProperties = false;
    4445        this._filterText = null;
     
    105106    {
    106107        this._alwaysShowPropertyNames = new Set(propertyNames);
     108
     109        this.needsLayout();
     110    }
     111
     112    set propertyVisibilityMode(propertyVisibilityMode)
     113    {
     114        if (this._propertyVisibilityMode === propertyVisibilityMode)
     115            return;
     116
     117        this._propertyVisibilityMode = propertyVisibilityMode;
    107118
    108119        this.needsLayout();
     
    132143        properties.sort((a, b) => a.name.extendedLocaleCompare(b.name));
    133144
     145        let hideVariables = this._propertyVisibilityMode === ComputedStyleSection.PropertyVisibilityMode.HideVariables;
     146        let hideNonVariables = this._propertyVisibilityMode === ComputedStyleSection.PropertyVisibilityMode.HideNonVariables;
     147
    134148        return properties.filter((property) => {
    135149            if (this._alwaysShowPropertyNames.has(property.canonicalName))
     
    143157                    return false;
    144158            } else if (property.isShorthand)
     159                return false;
     160
     161            if (property.isVariable && hideVariables)
     162                return false;
     163
     164            if (!property.isVariable && hideNonVariables)
    145165                return false;
    146166
     
    272292
    273293WI.ComputedStyleSection.StyleClassName = "computed-style-section";
     294
     295WI.ComputedStyleSection.PropertyVisibilityMode = {
     296    ShowAll: Symbol("variable-visibility-show-all"),
     297    HideVariables: Symbol("variable-visibility-hide-variables"),
     298    HideNonVariables: Symbol("variable-visibility-hide-non-variables"),
     299};
  • trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js

    r248537 r251883  
    234234            properties.sort((a, b) => a.name.extendedLocaleCompare(b.name));
    235235
     236        let hideVariables = this._propertyVisibilityMode === SpreadsheetCSSStyleDeclarationEditor.PropertyVisibilityMode.HideVariables;
     237        let hideNonVariables = this._propertyVisibilityMode === SpreadsheetCSSStyleDeclarationEditor.PropertyVisibilityMode.HideNonVariables;
     238
    236239        return properties.filter((property) => {
    237             if (!property.variable && this._propertyVisibilityMode === WI.SpreadsheetCSSStyleDeclarationEditor.PropertyVisibilityMode.HideNonVariables)
     240            if (!property.isVariable && hideNonVariables)
    238241                return false;
    239242
    240             if (property.variable && this._propertyVisibilityMode === WI.SpreadsheetCSSStyleDeclarationEditor.PropertyVisibilityMode.HideVariables)
     243            if (property.isVariable && hideVariables)
    241244                return false;
    242245
Note: See TracChangeset for help on using the changeset viewer.