Changeset 196597 in webkit


Ignore:
Timestamp:
Feb 15, 2016 1:37:10 PM (8 years ago)
Author:
timothy@apple.com
Message:

Web Inspector: Show inherited CSS variables in the Style sidebar
https://bugs.webkit.org/show_bug.cgi?id=154215
rdar://problem/24644058

Reviewed by Joseph Pecoraro.

  • UserInterface/Models/CSSProperty.js:

(WebInspector.CSSProperty.isInheritedPropertyName): Added.
(WebInspector.CSSProperty.prototype.update): Use WebInspector.CSSProperty.isInheritedPropertyName.

  • UserInterface/Models/DOMNodeStyles.js:

(WebInspector.DOMNodeStyles.prototype._parseStyleDeclarationPayload): Use WebInspector.CSSProperty.isInheritedPropertyName.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r196596 r196597  
     12016-02-15  Timothy Hatcher  <timothy@apple.com>
     2
     3        Web Inspector: Show inherited CSS variables in the Style sidebar
     4        https://bugs.webkit.org/show_bug.cgi?id=154215
     5        rdar://problem/24644058
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * UserInterface/Models/CSSProperty.js:
     10        (WebInspector.CSSProperty.isInheritedPropertyName): Added.
     11        (WebInspector.CSSProperty.prototype.update): Use WebInspector.CSSProperty.isInheritedPropertyName.
     12        * UserInterface/Models/DOMNodeStyles.js:
     13        (WebInspector.DOMNodeStyles.prototype._parseStyleDeclarationPayload): Use WebInspector.CSSProperty.isInheritedPropertyName.
     14
    1152016-02-15  Timothy Hatcher  <timothy@apple.com>
    216
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js

    r188993 r196597  
    3636    }
    3737
     38    // Static
     39
     40    static isInheritedPropertyName(name)
     41    {
     42        console.assert(typeof name === "string");
     43        if (name in WebInspector.CSSKeywordCompletions.InheritedProperties)
     44            return true;
     45        // Check if the name is a CSS variable.
     46        return name.startsWith("--");
     47    }
     48
    3849    // Public
    3950
     
    91102        this._implicit = implicit;
    92103        this._anonymous = anonymous;
    93         this._inherited = name in WebInspector.CSSKeywordCompletions.InheritedProperties;
     104        this._inherited = WebInspector.CSSProperty.isInheritedPropertyName(name);
    94105        this._valid = valid;
    95106        this._styleSheetTextRange = styleSheetTextRange || null;
  • trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js

    r194717 r196597  
    615615            var propertyPayload = payload.cssProperties[i];
    616616
    617             if (inherited && propertyPayload.name in WebInspector.CSSKeywordCompletions.InheritedProperties)
     617            if (inherited && WebInspector.CSSProperty.isInheritedPropertyName(propertyPayload.name))
    618618                ++inheritedPropertyCount;
    619619
Note: See TracChangeset for help on using the changeset viewer.