Changeset 54591 in webkit
- Timestamp:
- Feb 10, 2010 1:56:01 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54587 r54591 1 2010-02-09 Alexander Pavlov <apavlov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Add two basic categories for the Audits panel 6 https://bugs.webkit.org/show_bug.cgi?id=32930 7 8 * WebCore.gypi: 9 * WebCore.vcproj/WebCore.vcproj: 10 * inspector/front-end/AuditCategories.js: Added. 11 (WebInspector.AuditCategories.PagePerformance): 12 (WebInspector.AuditCategories.PagePerformance.prototype.initialize): 13 (WebInspector.AuditCategories.NetworkUtilization): 14 (WebInspector.AuditCategories.NetworkUtilization.prototype.initialize): 15 * inspector/front-end/AuditLauncherView.js: 16 (WebInspector.AuditLauncherView.prototype.updateResourceTrackingState): 17 (WebInspector.AuditLauncherView.prototype._createLauncherUI): 18 (WebInspector.AuditLauncherView.prototype.show): 19 * inspector/front-end/AuditRules.js: Added. 20 (WebInspector.AuditRules.arrayAsUL): 21 (WebInspector.AuditRules.getDomainToResourcesMap): 22 (WebInspector.AuditRules.evaluateInTargetWindow): 23 (WebInspector.AuditRules.GzipRule): 24 (WebInspector.AuditRules.GzipRule.prototype.doRun): 25 (WebInspector.AuditRules.GzipRule.prototype._isCompressed): 26 (WebInspector.AuditRules.GzipRule.prototype._shouldCompress): 27 (WebInspector.AuditRules.CombineExternalResourcesRule): 28 (WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun): 29 (WebInspector.AuditRules.CombineJsResourcesRule): 30 (WebInspector.AuditRules.CombineCssResourcesRule): 31 (WebInspector.AuditRules.MinimizeDnsLookupsRule): 32 (WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun): 33 (WebInspector.AuditRules.ParallelizeDownloadRule): 34 (WebInspector.AuditRules.ParallelizeDownloadRule.prototype.doRun): 35 (WebInspector.AuditRules.UnusedCssRule): 36 (WebInspector.AuditRules.UnusedCssRule.prototype._getUnusedStylesheetRatioMessage): 37 (WebInspector.AuditRules.UnusedCssRule.prototype._getUnusedTotalRatioMessage): 38 (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback): 39 (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.routine): 40 (WebInspector.AuditRules.UnusedCssRule.prototype.doRun): 41 (WebInspector.AuditRules.CacheControlRule): 42 (WebInspector.AuditRules.CacheControlRule.prototype.InfoCheck.1.FailCheck.0.WarningCheck.1.SevereCheck.2.doRun): 43 (WebInspector.AuditRules.CacheControlRule.prototype.handleNonCacheableResources): 44 (WebInspector.AuditRules.CacheControlRule.prototype._cacheableAndNonCacheableResources): 45 (WebInspector.AuditRules.CacheControlRule.prototype.execCheck): 46 (WebInspector.AuditRules.CacheControlRule.prototype.freshnessLifetimeGreaterThan): 47 (WebInspector.AuditRules.CacheControlRule.prototype.responseHeader): 48 (WebInspector.AuditRules.CacheControlRule.prototype.hasResponseHeader): 49 (WebInspector.AuditRules.CacheControlRule.prototype.isCompressible): 50 (WebInspector.AuditRules.CacheControlRule.prototype.isPubliclyCacheable): 51 (WebInspector.AuditRules.CacheControlRule.prototype.responseHeaderMatch): 52 (WebInspector.AuditRules.CacheControlRule.prototype.hasExplicitExpiration): 53 (WebInspector.AuditRules.CacheControlRule.prototype._isExplicitlyNonCacheable): 54 (WebInspector.AuditRules.CacheControlRule.prototype.isCacheableResource): 55 (WebInspector.AuditRules.BrowserCacheControlRule): 56 (WebInspector.AuditRules.BrowserCacheControlRule.prototype.handleNonCacheableResources): 57 (WebInspector.AuditRules.BrowserCacheControlRule.prototype.runChecks): 58 (WebInspector.AuditRules.BrowserCacheControlRule.prototype._missingExpirationCheck): 59 (WebInspector.AuditRules.BrowserCacheControlRule.prototype._varyCheck): 60 (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneMonthExpirationCheck): 61 (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneYearExpirationCheck): 62 (WebInspector.AuditRules.ProxyCacheControlRule): 63 (WebInspector.AuditRules.ProxyCacheControlRule.prototype.runChecks): 64 (WebInspector.AuditRules.ProxyCacheControlRule.prototype._questionMarkCheck): 65 (WebInspector.AuditRules.ProxyCacheControlRule.prototype._publicCachingCheck): 66 (WebInspector.AuditRules.ProxyCacheControlRule.prototype._setCookieCacheableCheck): 67 (WebInspector.AuditRules.ImageDimensionsRule): 68 (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun): 69 (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasDimension): 70 (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasWidth): 71 (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasHeight): 72 (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine): 73 (WebInspector.AuditRules.CssInHeadRule): 74 (WebInspector.AuditRules.CssInHeadRule.prototype.doRun): 75 (WebInspector.AuditRules.CssInHeadRule.prototype.doRun.routine.allViews): 76 (WebInspector.AuditRules.CssInHeadRule.prototype.doRun.routine): 77 (WebInspector.AuditRules.StylesScriptsOrderRule): 78 (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun): 79 (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun.routine): 80 (WebInspector.AuditRules.CookieRuleBase): 81 (WebInspector.AuditRules.CookieRuleBase.prototype.doRun.resultCallback): 82 (WebInspector.AuditRules.CookieRuleBase.prototype.doRun): 83 (WebInspector.AuditRules.CookieRuleBase.prototype.mapResourceCookies): 84 (WebInspector.AuditRules.CookieRuleBase.prototype._callbackForResourceCookiePairs): 85 (WebInspector.AuditRules.CookieSizeRule): 86 (WebInspector.AuditRules.CookieSizeRule.prototype._average): 87 (WebInspector.AuditRules.CookieSizeRule.prototype._max): 88 (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies): 89 (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies.avgSizeSorter): 90 (WebInspector.AuditRules.StaticCookielessRule): 91 (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies): 92 (WebInspector.AuditRules.StaticCookielessRule.prototype._collectorCallback): 93 * inspector/front-end/AuditsPanel.js: 94 (WebInspector.AuditsPanel.prototype._constructCategories): 95 (WebInspector.AuditsPanel.prototype._reloadResources): 96 (WebInspector.AuditsPanel.prototype.show): 97 (WebInspector.AuditsPanel.prototype._updateLauncherViewControls): 98 (WebInspector.AuditCategory): 99 (WebInspector.AuditCategory.prototype.get id): 100 (WebInspector.AuditCategory.prototype.get ruleCount): 101 (WebInspector.AuditCategory.prototype.runRules): 102 (WebInspector.AuditCategory.prototype._ensureInitialized): 103 (WebInspector.AuditCategoryResult): 104 * inspector/front-end/WebKit.qrc: 105 * inspector/front-end/audits.css: 106 * inspector/front-end/inspector.html: 107 * inspector/front-end/inspector.js: 108 (WebInspector.loaded): 109 (WebInspector.addPanelToolbarIcon): 110 (WebInspector.documentKeyDown): 111 1 112 2010-02-10 Adam Barth <abarth@webkit.org> 2 113 -
trunk/WebCore/WebCore.gypi
r54527 r54591 3701 3701 'inspector/front-end/inspector.html', 3702 3702 'inspector/front-end/AbstractTimelinePanel.js', 3703 'inspector/front-end/AuditCategories.js', 3703 3704 'inspector/front-end/AuditLauncherView.js', 3704 3705 'inspector/front-end/AuditResultView.js', 3706 'inspector/front-end/AuditRules.js', 3705 3707 'inspector/front-end/AuditsPanel.js', 3706 3708 'inspector/front-end/BottomUpProfileDataGridTree.js', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r54334 r54591 42701 42701 </File> 42702 42702 <File 42703 RelativePath="..\inspector\front-end\AuditCategories.js" 42704 > 42705 </File> 42706 <File 42703 42707 RelativePath="..\inspector\front-end\AuditLauncherView.js" 42704 42708 > … … 42706 42710 <File 42707 42711 RelativePath="..\inspector\front-end\AuditResultView.js" 42712 > 42713 </File> 42714 <File 42715 RelativePath="..\inspector\front-end\AuditRules.js" 42708 42716 > 42709 42717 </File> -
trunk/WebCore/inspector/front-end/AuditLauncherView.js
r52629 r54591 64 64 65 65 WebInspector.AuditLauncherView.prototype = { 66 updateResourceTrackingState: function( )66 updateResourceTrackingState: function(isTracking) 67 67 { 68 68 if (!this._auditPresentStateLabelElement) 69 69 return; 70 if ( InspectorBackend.resourceTrackingEnabled()) {70 if (isTracking) { 71 71 this._auditPresentStateLabelElement.nodeValue = WebInspector.UIString("Audit Present State"); 72 72 this._auditPresentStateElement.disabled = false; … … 198 198 this.updateResourceTrackingState(); 199 199 this._updateButton(); 200 this.resize();201 200 }, 202 201 … … 210 209 }, 211 210 211 show: function(parentElement) 212 { 213 WebInspector.View.prototype.show.call(this, parentElement); 214 setTimeout(this.resize(), 0); 215 }, 216 212 217 resize: function() 213 218 { -
trunk/WebCore/inspector/front-end/AuditsPanel.js
r53766 r54591 106 106 for (var categoryCtorID in WebInspector.AuditCategories) { 107 107 var auditCategory = new WebInspector.AuditCategories[categoryCtorID](); 108 this.categoriesById[auditCategory.id] = auditCategory; 108 auditCategory._id = categoryCtorID; 109 this.categoriesById[categoryCtorID] = auditCategory; 109 110 } 110 111 }, … … 186 187 _reloadResources: function(callback) 187 188 { 188 function nullCallback()189 {190 }191 189 this._resourceTrackingCallback = callback; 190 192 191 if (!InspectorBackend.resourceTrackingEnabled()) { 193 192 InspectorBackend.enableResourceTracking(false); 194 this._updateLauncherViewControls( );193 this._updateLauncherViewControls(true); 195 194 } else 196 InjectedScriptAccess.getDefault().evaluate("window.location.reload()", nullCallback);195 InjectedScriptAccess.getDefault().evaluate("window.location.reload()", switchCallback); 197 196 }, 198 197 … … 240 239 241 240 this.showView(); 242 this._updateLauncherViewControls( );241 this._updateLauncherViewControls(InspectorBackend.resourceTrackingEnabled()); 243 242 }, 244 243 … … 255 254 }, 256 255 257 _updateLauncherViewControls: function( )256 _updateLauncherViewControls: function(isTracking) 258 257 { 259 258 if (this._launcherView) 260 this._launcherView.updateResourceTrackingState( );259 this._launcherView.updateResourceTrackingState(isTracking); 261 260 }, 262 261 … … 279 278 280 279 281 WebInspector.AuditCategory = function(id, displayName) 282 { 283 this._id = id; 280 WebInspector.AuditCategory = function(displayName) 281 { 284 282 this._displayName = displayName; 285 283 this._rules = []; … … 289 287 get id() 290 288 { 289 // this._id value is injected at construction time. 291 290 return this._id; 292 291 }, … … 299 298 get ruleCount() 300 299 { 300 this._ensureInitialized(); 301 301 return this._rules.length; 302 302 }, … … 309 309 runRules: function(resources, callback) 310 310 { 311 this._ensureInitialized(); 311 312 for (var i = 0; i < this._rules.length; ++i) 312 313 this._rules[i].run(resources, callback); 314 }, 315 316 _ensureInitialized: function() 317 { 318 if (!this._initialized) { 319 if ("initialize" in this) 320 this.initialize(); 321 this._initialized = true; 322 } 313 323 } 314 324 } … … 355 365 WebInspector.AuditCategoryResult = function(category) 356 366 { 357 this.categoryId = category.id;358 367 this.title = category.displayName; 359 368 this.entries = []; … … 379 388 380 389 WebInspector.AuditRuleResult.Type = { 390 // Does not denote a discovered flaw but rather represents an informational message. 381 391 NA: 0, 392 393 // Denotes a minor impact on the checked metric. 382 394 Hint: 1, 395 396 // Denotes a major impact on the checked metric. 383 397 Violation: 2 384 398 } -
trunk/WebCore/inspector/front-end/WebKit.qrc
r54110 r54591 3 3 <file>inspector.html</file> 4 4 <file>AbstractTimelinePanel.js</file> 5 <file>AuditCategories.js</file> 5 6 <file>AuditLauncherView.js</file> 6 7 <file>AuditResultView.js</file> 8 <file>AuditRules.js</file> 7 9 <file>AuditsPanel.js</file> 8 10 <file>BottomUpProfileDataGridTree.js</file> -
trunk/WebCore/inspector/front-end/audits.css
r52629 r54591 263 263 } 264 264 265 .audit-launcher-view input[type="radio"]:active {265 .audit-launcher-view input[type="radio"]:active:not(:disabled) { 266 266 background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239))); 267 267 } 268 268 269 .audit-launcher-view input[type="radio"]:checked {269 .audit-launcher-view input[type="radio"]:checked:not(:disabled), .audit-launcher-view input[type="radio"]:checked:disabled { 270 270 background: url(Images/radioDot.png) center no-repeat, 271 271 -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223))); -
trunk/WebCore/inspector/front-end/inspector.html
r54110 r54591 92 92 <script type="text/javascript" src="AuditResultView.js"></script> 93 93 <script type="text/javascript" src="AuditLauncherView.js"></script> 94 <script type="text/javascript" src="AuditRules.js"></script> 95 <script type="text/javascript" src="AuditCategories.js"></script> 94 96 <script type="text/javascript" src="ResourceView.js"></script> 95 97 <script type="text/javascript" src="SourceFrame.js"></script> -
trunk/WebCore/inspector/front-end/inspector.js
r54435 r54591 469 469 470 470 this.panelOrder = []; 471 for (var panelName in this.panels) { 472 var panel = this.panels[panelName]; 473 var panelToolbarItem = panel.toolbarItem; 474 this.panelOrder.push(panel); 475 panelToolbarItem.addEventListener("click", this._toolbarItemClicked.bind(this)); 476 if (previousToolbarItem) 477 toolbarElement.insertBefore(panelToolbarItem, previousToolbarItem.nextSibling); 478 else 479 toolbarElement.insertBefore(panelToolbarItem, toolbarElement.firstChild); 480 previousToolbarItem = panelToolbarItem; 481 } 471 for (var panelName in this.panels) 472 previousToolbarItem = WebInspector.addPanelToolbarIcon(toolbarElement, this.panels[panelName], previousToolbarItem); 482 473 483 474 this.Tips = { … … 528 519 529 520 InspectorFrontendHost.loaded(); 521 } 522 523 WebInspector.addPanelToolbarIcon = function(toolbarElement, panel, previousToolbarItem) 524 { 525 var panelToolbarItem = panel.toolbarItem; 526 this.panelOrder.push(panel); 527 panelToolbarItem.addEventListener("click", this._toolbarItemClicked.bind(this)); 528 if (previousToolbarItem) 529 toolbarElement.insertBefore(panelToolbarItem, previousToolbarItem.nextSibling); 530 else 531 toolbarElement.insertBefore(panelToolbarItem, toolbarElement.firstChild); 532 return panelToolbarItem; 530 533 } 531 534 … … 750 753 751 754 if (shouldShowAuditsPanel) { 752 if (!this.panels.audits) 755 if (!this.panels.audits) { 753 756 this.panels.audits = new WebInspector.AuditsPanel(); 757 var toolbarElement = document.getElementById("toolbar"); 758 WebInspector.addPanelToolbarIcon(toolbarElement, this.panels.audits, this.panels.console.toolbarItem); 759 } 754 760 this.currentPanel = this.panels.audits; 755 761 }
Note: See TracChangeset
for help on using the changeset viewer.