Title: [96689] trunk/Source/WebCore
Revision
96689
Author
pfeld...@chromium.org
Date
2011-10-05 03:12:56 -0700 (Wed, 05 Oct 2011)

Log Message

Web Inspector: add CSS model classes to the compilation.
https://bugs.webkit.org/show_bug.cgi?id=69376

Patch by Pavel Feldman <pfeld...@chromium.org> on 2011-10-05
Reviewed by Yury Semikhatsky.

* inspector/compile-front-end.sh:
* inspector/front-end/CSSCompletions.js:
* inspector/front-end/CSSKeywordCompletions.js:
(WebInspector.CSSKeywordCompletions.forProperty):
* inspector/front-end/CSSStyleModel.js:
(WebInspector.CSSStyleDeclaration):
(WebInspector.CSSStyleModelResourceBinding.prototype.setContent):
(WebInspector.CSSStyleModelResourceBinding.prototype.canSetContent):
* inspector/front-end/ResourceTreeModel.js:
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylesSidebarPane.prototype._containsInherited):
(WebInspector.StylePropertiesSection.prototype.isPropertyInherited):
(WebInspector.StylePropertiesSection.prototype.isPropertyOverloaded):
(WebInspector.ComputedStylePropertiesSection.prototype.rebuildComputedTrace):
* inspector/front-end/externs.js:
(Array.prototype.keySet):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96688 => 96689)


--- trunk/Source/WebCore/ChangeLog	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/ChangeLog	2011-10-05 10:12:56 UTC (rev 96689)
@@ -1,3 +1,27 @@
+2011-10-05  Pavel Feldman  <pfeld...@chromium.org>
+
+        Web Inspector: add CSS model classes to the compilation.
+        https://bugs.webkit.org/show_bug.cgi?id=69376
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/compile-front-end.sh:
+        * inspector/front-end/CSSCompletions.js:
+        * inspector/front-end/CSSKeywordCompletions.js:
+        (WebInspector.CSSKeywordCompletions.forProperty):
+        * inspector/front-end/CSSStyleModel.js:
+        (WebInspector.CSSStyleDeclaration):
+        (WebInspector.CSSStyleModelResourceBinding.prototype.setContent):
+        (WebInspector.CSSStyleModelResourceBinding.prototype.canSetContent):
+        * inspector/front-end/ResourceTreeModel.js:
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype._containsInherited):
+        (WebInspector.StylePropertiesSection.prototype.isPropertyInherited):
+        (WebInspector.StylePropertiesSection.prototype.isPropertyOverloaded):
+        (WebInspector.ComputedStylePropertiesSection.prototype.rebuildComputedTrace):
+        * inspector/front-end/externs.js:
+        (Array.prototype.keySet):
+
 2011-10-05  Kent Tamura  <tk...@chromium.org>
 
         Input styles are unexpectedly shared regardless of required status difference.

Modified: trunk/Source/WebCore/inspector/compile-front-end.sh (96688 => 96689)


--- trunk/Source/WebCore/inspector/compile-front-end.sh	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/inspector/compile-front-end.sh	2011-10-05 10:12:56 UTC (rev 96689)
@@ -44,12 +44,15 @@
         --js Source/WebCore/inspector/front-end/Object.js \
         --js Source/WebCore/inspector/front-end/Settings.js \
         --js Source/WebCore/inspector/front-end/UserMetrics.js \
-    --module jsmodule_sdk:20:jsmodule_common \
+    --module jsmodule_sdk:23:jsmodule_common \
         --js Source/WebCore/inspector/front-end/CompilerSourceMapping.js \
         --js Source/WebCore/inspector/front-end/CompilerSourceMappingProvider.js \
         --js Source/WebCore/inspector/front-end/ConsoleModel.js \
         --js Source/WebCore/inspector/front-end/ContentProviders.js \
         --js Source/WebCore/inspector/front-end/CookieParser.js \
+        --js Source/WebCore/inspector/front-end/CSSCompletions.js \
+        --js Source/WebCore/inspector/front-end/CSSKeywordCompletions.js \
+        --js Source/WebCore/inspector/front-end/CSSStyleModel.js \
         --js Source/WebCore/inspector/front-end/BreakpointManager.js \
         --js Source/WebCore/inspector/front-end/Database.js \
         --js Source/WebCore/inspector/front-end/DOMAgent.js \

Modified: trunk/Source/WebCore/inspector/front-end/CSSCompletions.js (96688 => 96689)


--- trunk/Source/WebCore/inspector/front-end/CSSCompletions.js	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/inspector/front-end/CSSCompletions.js	2011-10-05 10:12:56 UTC (rev 96689)
@@ -30,6 +30,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ */
 WebInspector.CSSCompletions = function(values, acceptEmptyPrefix)
 {
     this._values = values.slice();

Modified: trunk/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js (96688 => 96689)


--- trunk/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js	2011-10-05 10:12:56 UTC (rev 96689)
@@ -28,15 +28,18 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ */
 WebInspector.CSSKeywordCompletions = {
     forProperty: function(propertyName)
     {
         var acceptedKeywords = ["initial"];
-        if (propertyName in this._propertyKeywordMap)
-            acceptedKeywords = acceptedKeywords.concat(this._propertyKeywordMap[propertyName]);
-        if (propertyName in this._colorAwareProperties)
+        if (propertyName in WebInspector.CSSKeywordCompletions._propertyKeywordMap)
+            acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap[propertyName]);
+        if (propertyName in WebInspector.CSSKeywordCompletions._colorAwareProperties)
             acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);
-        if (propertyName in WebInspector.StylesSidebarPane.InheritedProperties)
+        if (propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties)
             acceptedKeywords.push("inherit");
         return new WebInspector.CSSCompletions(acceptedKeywords, true);
     },
@@ -47,6 +50,15 @@
     }
 };
 
+// Taken from http://www.w3.org/TR/CSS21/propidx.html.
+WebInspector.CSSKeywordCompletions.InheritedProperties = [
+    "azimuth", "border-collapse", "border-spacing", "caption-side", "color", "cursor", "direction", "elevation",
+    "empty-cells", "font-family", "font-size", "font-style", "font-variant", "font-weight", "font", "letter-spacing",
+    "line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", "orphans", "pitch-range",
+    "pitch", "quotes", "richness", "speak-header", "speak-numeral", "speak-punctuation", "speak", "speech-rate", "stress",
+    "text-align", "text-indent", "text-transform", "text-shadow", "visibility", "voice-family", "volume", "white-space", "widows", "word-spacing"
+].keySet();
+
 WebInspector.CSSKeywordCompletions._colors = [
     "aqua", "black", "blue", "fuchsia", "gray", "green", "lime", "maroon", "navy", "olive", "orange", "purple", "red",
     "silver", "teal", "white", "yellow", "transparent", "currentcolor", "grey", "aliceblue", "antiquewhite",
@@ -66,7 +78,7 @@
     "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue",
     "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "thistle", "tomato", "turquoise", "violet",
     "wheat", "whitesmoke", "yellowgreen"
-],
+];
 
 WebInspector.CSSKeywordCompletions._colorAwareProperties = [
     "background", "background-color", "border", "border-color", "border-top", "border-right", "border-bottom",

Modified: trunk/Source/WebCore/inspector/front-end/CSSStyleModel.js (96688 => 96689)


--- trunk/Source/WebCore/inspector/front-end/CSSStyleModel.js	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/inspector/front-end/CSSStyleModel.js	2011-10-05 10:12:56 UTC (rev 96689)
@@ -191,6 +191,9 @@
         return node.ownerDocumentElement().id;
     },
 
+    /**
+     * @param {function()=} callback
+     */
     _fireStyleSheetChanged: function(styleSheetId, majorChange, callback)
     {
         callback = callback || function() {};
@@ -242,7 +245,7 @@
 
     var propertyIndex = 0;
     for (var i = 0; i < payloadPropertyCount; ++i) {
-        var property = new WebInspector.CSSProperty.parsePayload(this, i, payload.cssProperties[i]);
+        var property = WebInspector.CSSProperty.parsePayload(this, i, payload.cssProperties[i]);
         this._allProperties.push(property);
         if (property.disabled)
             this.__disabledProperties[i] = property;
@@ -657,12 +660,17 @@
     setContent: function(resource, content, majorChange, userCallback)
     {
         if (this._urlToStyleSheetId[resource.url]) {
-            this._innerSetContent(resource.url, content, majorChange, userCallback);
+            this._innerSetContent(resource.url, content, majorChange, userCallback, null);
             return;
         }
         this._loadStyleSheetHeaders(this._innerSetContent.bind(this, resource.url, content, majorChange, userCallback));
     },
 
+    canSetContent: function()
+    {
+        return true;
+    },
+
     _inspectedURLChanged: function(event)
     {
         // Main frame navigation - clear history.
@@ -732,3 +740,8 @@
 }
 
 WebInspector.CSSStyleModelResourceBinding.prototype.__proto__ = WebInspector.ResourceDomainModelBinding.prototype;
+
+/**
+ * @type {WebInspector.CSSStyleModel}
+ */
+WebInspector.cssModel = null;

Modified: trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js (96688 => 96689)


--- trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js	2011-10-05 10:12:56 UTC (rev 96689)
@@ -438,3 +438,8 @@
         this._resourceTreeModel._frameDetached(frameId);
     }
 }
+
+/**
+ * @type {WebInspector.ResourceTreeModel}
+ */
+WebInspector.resourceTreeModel = null;

Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (96688 => 96689)


--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-10-05 10:12:56 UTC (rev 96689)
@@ -105,14 +105,6 @@
 
 WebInspector.StylesSidebarPane.StyleValueDelimiters = " \t\n\"':;,/()";
 
-// Taken from http://www.w3.org/TR/CSS21/propidx.html.
-WebInspector.StylesSidebarPane.InheritedProperties = [
-    "azimuth", "border-collapse", "border-spacing", "caption-side", "color", "cursor", "direction", "elevation",
-    "empty-cells", "font-family", "font-size", "font-style", "font-variant", "font-weight", "font", "letter-spacing",
-    "line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", "orphans", "pitch-range",
-    "pitch", "quotes", "richness", "speak-header", "speak-numeral", "speak-punctuation", "speak", "speech-rate", "stress",
-    "text-align", "text-indent", "text-transform", "text-shadow", "visibility", "voice-family", "volume", "white-space", "widows", "word-spacing"
-].keySet();
 
 // Keep in sync with RenderStyleConstants.h PseudoId enum. Array below contains pseudo id names for corresponding enum indexes.
 // First item is empty due to its artificial NOPSEUDO nature in the enum.
@@ -630,7 +622,7 @@
         for (var i = 0; i < properties.length; ++i) {
             var property = properties[i];
             // Does this style contain non-overridden inherited property?
-            if (property.isLive && property.name in WebInspector.StylesSidebarPane.InheritedProperties)
+            if (property.isLive && property.name in WebInspector.CSSKeywordCompletions.InheritedProperties)
                 return true;
         }
         return false;
@@ -924,7 +916,7 @@
         if (this.isInherited) {
             // While rendering inherited stylesheet, reverse meaning of this property.
             // Render truly inherited properties with black, i.e. return them as non-inherited.
-            return !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties);
+            return !(propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties);
         }
         return false;
     },
@@ -934,7 +926,7 @@
         if (!this._usedProperties || this.noAffect)
             return false;
 
-        if (this.isInherited && !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties)) {
+        if (this.isInherited && !(propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties)) {
             // In the inherited sections, only show overrides for the potentially inherited properties.
             return false;
         }
@@ -1304,7 +1296,7 @@
                 var property = section.uniqueProperties[j];
                 if (property.disabled)
                     continue;
-                if (section.isInherited && !(property.name in WebInspector.StylesSidebarPane.InheritedProperties))
+                if (section.isInherited && !(property.name in WebInspector.CSSKeywordCompletions.InheritedProperties))
                     continue;
 
                 var treeElement = this._propertyTreeElements[property.name];

Modified: trunk/Source/WebCore/inspector/front-end/externs.js (96688 => 96689)


--- trunk/Source/WebCore/inspector/front-end/externs.js	2011-10-05 09:28:55 UTC (rev 96688)
+++ trunk/Source/WebCore/inspector/front-end/externs.js	2011-10-05 10:12:56 UTC (rev 96689)
@@ -88,6 +88,8 @@
  */
 Array.prototype.remove = function(obj, onlyFirst) {}
 
+Array.prototype.keySet = function() {}
+
 WebInspector.extensionServer = {}
 WebInspector.extensionServer.notifyResourceContentCommitted = function(resource, content) {}
 WebInspector.extensionServer.notifyPanelShown = function(panel) {}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to