Modified: trunk/Source/WebCore/inspector/front-end/AuditRules.js (96948 => 96949)
--- trunk/Source/WebCore/inspector/front-end/AuditRules.js 2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/AuditRules.js 2011-10-07 16:44:42 UTC (rev 96949)
@@ -63,6 +63,10 @@
return domainToResourcesMap;
}
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.GzipRule = function()
{
WebInspector.AuditRule.call(this, "network-gzip", "Enable gzip compression");
@@ -115,7 +119,10 @@
WebInspector.AuditRules.GzipRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.CombineExternalResourcesRule = function(id, name, type, resourceTypeName, allowedPerDomain)
{
WebInspector.AuditRule.call(this, id, name);
@@ -127,7 +134,7 @@
WebInspector.AuditRules.CombineExternalResourcesRule.prototype = {
doRun: function(resources, result, callback)
{
- var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type]);
+ var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type], false);
var penalizedResourceCount = 0;
// TODO: refactor according to the chosen i18n approach
var summary = result.addChild("", true);
@@ -150,21 +157,30 @@
WebInspector.AuditRules.CombineExternalResourcesRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CombineExternalResourcesRule}
+ */
WebInspector.AuditRules.CombineJsResourcesRule = function(allowedPerDomain) {
WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externaljs", "Combine external _javascript_", WebInspector.Resource.Type.Script, "_javascript_", allowedPerDomain);
}
WebInspector.AuditRules.CombineJsResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CombineExternalResourcesRule}
+ */
WebInspector.AuditRules.CombineCssResourcesRule = function(allowedPerDomain) {
WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externalcss", "Combine external CSS", WebInspector.Resource.Type.Stylesheet, "CSS", allowedPerDomain);
}
WebInspector.AuditRules.CombineCssResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.MinimizeDnsLookupsRule = function(hostCountThreshold) {
WebInspector.AuditRule.call(this, "network-minimizelookups", "Minimize DNS lookups");
this._hostCountThreshold = hostCountThreshold;
@@ -174,7 +190,7 @@
doRun: function(resources, result, callback)
{
var summary = result.addChild("");
- var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined);
+ var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined, false);
for (var domain in domainToResourcesMap) {
if (domainToResourcesMap[domain].length > 1)
continue;
@@ -183,7 +199,7 @@
continue;
if (!parsedURL.host.search(WebInspector.AuditRules.IPAddressRegexp))
continue; // an IP address
- summary.addSnippet(match[2]);
+ summary.addSnippet(domain);
result.violationCount++;
}
if (!summary.children || summary.children.length <= this._hostCountThreshold)
@@ -196,7 +212,10 @@
WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.ParallelizeDownloadRule = function(optimalHostnameCount, minRequestThreshold, minBalanceThreshold)
{
WebInspector.AuditRule.call(this, "network-parallelizehosts", "Parallelize downloads across hostnames");
@@ -205,7 +224,6 @@
this._minBalanceThreshold = minBalanceThreshold;
}
-
WebInspector.AuditRules.ParallelizeDownloadRule.prototype = {
doRun: function(resources, result, callback)
{
@@ -264,9 +282,12 @@
WebInspector.AuditRules.ParallelizeDownloadRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
-// The reported CSS rule size is incorrect (parsed != original in WebKit),
-// so use percentages instead, which gives a better approximation.
+/**
+ * The reported CSS rule size is incorrect (parsed != original in WebKit),
+ * so use percentages instead, which gives a better approximation.
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.UnusedCssRule = function()
{
WebInspector.AuditRule.call(this, "page-unusedcss", "Remove unused CSS rules");
@@ -392,7 +413,10 @@
WebInspector.AuditRules.UnusedCssRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.CacheControlRule = function(id, name)
{
WebInspector.AuditRule.call(this, id, name);
@@ -412,7 +436,7 @@
callback(result);
},
- handleNonCacheableResources: function()
+ handleNonCacheableResources: function(resources, result)
{
},
@@ -530,7 +554,10 @@
WebInspector.AuditRules.CacheControlRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CacheControlRule}
+ */
WebInspector.AuditRules.BrowserCacheControlRule = function()
{
WebInspector.AuditRules.CacheControlRule.call(this, "http-browsercache", "Leverage browser caching");
@@ -596,7 +623,10 @@
WebInspector.AuditRules.BrowserCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CacheControlRule}
+ */
WebInspector.AuditRules.ProxyCacheControlRule = function() {
WebInspector.AuditRules.CacheControlRule.call(this, "http-proxycache", "Leverage proxy caching");
}
@@ -633,7 +663,10 @@
WebInspector.AuditRules.ProxyCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.ImageDimensionsRule = function()
{
WebInspector.AuditRule.call(this, "page-imagedims", "Specify image dimensions");
@@ -726,7 +759,10 @@
WebInspector.AuditRules.ImageDimensionsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.CssInHeadRule = function()
{
WebInspector.AuditRule.call(this, "page-cssinhead", "Put CSS in the document head");
@@ -795,7 +831,10 @@
WebInspector.AuditRules.CssInHeadRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.StylesScriptsOrderRule = function()
{
WebInspector.AuditRule.call(this, "page-stylescriptorder", "Optimize the order of styles and scripts");
@@ -862,7 +901,10 @@
WebInspector.AuditRules.StylesScriptsOrderRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
WebInspector.AuditRules.CookieRuleBase = function(id, name)
{
WebInspector.AuditRule.call(this, id, name);
@@ -902,7 +944,10 @@
WebInspector.AuditRules.CookieRuleBase.prototype.__proto__ = WebInspector.AuditRule.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CookieRuleBase}
+ */
WebInspector.AuditRules.CookieSizeRule = function(avgBytesThreshold)
{
WebInspector.AuditRules.CookieRuleBase.call(this, "http-cookiesize", "Minimize cookie size");
@@ -1008,7 +1053,10 @@
WebInspector.AuditRules.CookieSizeRule.prototype.__proto__ = WebInspector.AuditRules.CookieRuleBase.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CookieRuleBase}
+ */
WebInspector.AuditRules.StaticCookielessRule = function(minResources)
{
WebInspector.AuditRules.CookieRuleBase.call(this, "http-staticcookieless", "Serve static content from a cookieless domain");
Modified: trunk/Source/WebCore/inspector/front-end/AuditsPanel.js (96948 => 96949)
--- trunk/Source/WebCore/inspector/front-end/AuditsPanel.js 2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/AuditsPanel.js 2011-10-07 16:44:42 UTC (rev 96949)
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ * @extends {WebInspector.Panel}
+ */
WebInspector.AuditsPanel = function()
{
WebInspector.Panel.call(this, "audits");
@@ -55,7 +59,7 @@
this._constructCategories();
this._launcherView = new WebInspector.AuditLauncherView(this.initiateAudit.bind(this));
- for (id in this.categoriesById)
+ for (var id in this.categoriesById)
this._launcherView.addCategory(this.categoriesById[id]);
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoadEventFired, this);
@@ -261,8 +265,9 @@
WebInspector.AuditsPanel.prototype.__proto__ = WebInspector.Panel.prototype;
-
-
+/**
+ * @constructor
+ */
WebInspector.AuditCategory = function(displayName)
{
this._displayName = displayName;
@@ -310,7 +315,9 @@
}
}
-
+/**
+ * @constructor
+ */
WebInspector.AuditRule = function(id, displayName)
{
this._id = id;
@@ -358,6 +365,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.AuditCategoryResult = function(category)
{
this.title = category.displayName;
@@ -371,6 +381,11 @@
}
}
+/**
+ * @constructor
+ * @param {boolean=} expanded
+ * @param {string=} className
+ */
WebInspector.AuditRuleResult = function(value, expanded, className)
{
this.value = value;
@@ -390,6 +405,10 @@
}
WebInspector.AuditRuleResult.prototype = {
+ /**
+ * @param {boolean=} expanded
+ * @param {string=} className
+ */
addChild: function(value, expanded, className)
{
if (!this.children)
@@ -416,6 +435,10 @@
}
}
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarTreeElement}
+ */
WebInspector.AuditsSidebarTreeElement = function()
{
this.small = false;
@@ -447,7 +470,10 @@
WebInspector.AuditsSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
-
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarTreeElement}
+ */
WebInspector.AuditResultSidebarTreeElement = function(results, mainResourceURL, ordinal)
{
this.results = results;