Title: [196597] trunk/Source/WebInspectorUI
Revision
196597
Author
[email protected]
Date
2016-02-15 13:37:10 -0800 (Mon, 15 Feb 2016)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (196596 => 196597)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-02-15 21:30:00 UTC (rev 196596)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-02-15 21:37:10 UTC (rev 196597)
@@ -1,5 +1,19 @@
 2016-02-15  Timothy Hatcher  <[email protected]>
 
+        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.
+
+2016-02-15  Timothy Hatcher  <[email protected]>
+
         Web Inspector: Sidebars are defaulting to their minimum width, instead of a good width
         https://bugs.webkit.org/show_bug.cgi?id=154218
         rdar://problem/24644192

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js (196596 => 196597)


--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js	2016-02-15 21:30:00 UTC (rev 196596)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js	2016-02-15 21:37:10 UTC (rev 196597)
@@ -35,6 +35,17 @@
         this.update(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, true);
     }
 
+    // Static
+
+    static isInheritedPropertyName(name)
+    {
+        console.assert(typeof name === "string");
+        if (name in WebInspector.CSSKeywordCompletions.InheritedProperties)
+            return true;
+        // Check if the name is a CSS variable.
+        return name.startsWith("--");
+    }
+
     // Public
 
     get ownerStyle()
@@ -90,7 +101,7 @@
         this._enabled = enabled;
         this._implicit = implicit;
         this._anonymous = anonymous;
-        this._inherited = name in WebInspector.CSSKeywordCompletions.InheritedProperties;
+        this._inherited = WebInspector.CSSProperty.isInheritedPropertyName(name);
         this._valid = valid;
         this._styleSheetTextRange = styleSheetTextRange || null;
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (196596 => 196597)


--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js	2016-02-15 21:30:00 UTC (rev 196596)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js	2016-02-15 21:37:10 UTC (rev 196597)
@@ -614,7 +614,7 @@
         for (var i = 0; payload.cssProperties && i < payload.cssProperties.length; ++i) {
             var propertyPayload = payload.cssProperties[i];
 
-            if (inherited && propertyPayload.name in WebInspector.CSSKeywordCompletions.InheritedProperties)
+            if (inherited && WebInspector.CSSProperty.isInheritedPropertyName(propertyPayload.name))
                 ++inheritedPropertyCount;
 
             var property = this._parseStylePropertyPayload(propertyPayload, i, styleDeclaration, text);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to