Changeset 55999 in webkit
- Timestamp:
- Mar 15, 2010 9:22:24 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55996 r55999 1 2010-03-15 Alexander Pavlov <apavlov@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: Implement a progress indicator in the Audits panel 6 when resources are reloading 7 https://bugs.webkit.org/show_bug.cgi?id=35971 8 9 * English.lproj/localizedStrings.js: 10 * GNUmakefile.am: 11 * WebCore.gypi: 12 * inspector/front-end/AuditLauncherView.js: 13 (WebInspector.AuditLauncherView.prototype.updateResourceTrackingState): 14 (WebInspector.AuditLauncherView.prototype.get totalResources): 15 (WebInspector.AuditLauncherView.prototype.set totalResources): 16 (WebInspector.AuditLauncherView.prototype.get loadedResources): 17 (WebInspector.AuditLauncherView.prototype.set loadedResources): 18 (WebInspector.AuditLauncherView.prototype._resetResourceCount): 19 (WebInspector.AuditLauncherView.prototype.resourceStarted): 20 (WebInspector.AuditLauncherView.prototype.resourceFinished): 21 (WebInspector.AuditLauncherView.prototype.reset): 22 (WebInspector.AuditLauncherView.prototype._setAuditRunning): 23 (WebInspector.AuditLauncherView.prototype._launchButtonClicked): 24 (WebInspector.AuditLauncherView.prototype._createCategoryElement): 25 (WebInspector.AuditLauncherView.prototype._createLauncherUI): 26 (WebInspector.AuditLauncherView.prototype._updateResourceProgress): 27 (WebInspector.AuditLauncherView.prototype._updateButton): 28 * inspector/front-end/AuditsPanel.js: 29 (WebInspector.AuditsPanel.prototype.resourceStarted): 30 (WebInspector.AuditsPanel.prototype.resourceFinished): 31 (WebInspector.AuditsPanel.prototype.reset): 32 * inspector/front-end/Images/spinner.gif: Added. 33 * inspector/front-end/WebKit.qrc: 34 * inspector/front-end/audits.css: 35 (.audit-launcher-view .resource-progress > img): 36 * inspector/front-end/inspector.js: 37 (WebInspector.updateResource): 38 1 39 2010-03-15 Philippe Normand <pnormand@igalia.com> 2 40 -
trunk/WebCore/GNUmakefile.am
r55980 r55999 3747 3747 webinspectorimagesdir = ${datadir}/webkit-1.0/webinspector/Images 3748 3748 dist_webinspectorimages_DATA = \ 3749 $(shell ls $(WebCore)/inspector/front-end/Images/*.gif) \ 3749 3750 $(shell ls $(WebCore)/inspector/front-end/Images/*.png) 3750 3751 -
trunk/WebCore/WebCore.gypi
r55980 r55999 3943 3943 'inspector/front-end/Images/segmentSelectedEnd.png', 3944 3944 'inspector/front-end/Images/sessionStorage.png', 3945 'inspector/front-end/Images/spinner.gif', 3945 3946 'inspector/front-end/Images/splitviewDimple.png', 3946 3947 'inspector/front-end/Images/splitviewDividerBackground.png', -
trunk/WebCore/inspector/front-end/AuditLauncherView.js
r55799 r55999 43 43 this.element.appendChild(this._contentElement); 44 44 45 this._resetResourceCount(); 46 45 47 function categorySortFunction(a, b) 46 48 { … … 68 70 if (!this._auditPresentStateLabelElement) 69 71 return; 72 73 this._resetResourceCount(); 74 70 75 if (isTracking) { 71 76 this._auditPresentStateLabelElement.nodeValue = WebInspector.UIString("Audit Present State"); … … 80 85 }, 81 86 87 get totalResources() 88 { 89 return this._totalResources; 90 }, 91 92 set totalResources(x) 93 { 94 if (this._totalResources === x) 95 return; 96 this._totalResources = x; 97 this._updateResourceProgress(); 98 }, 99 100 get loadedResources() 101 { 102 return this._loadedResources; 103 }, 104 105 set loadedResources(x) 106 { 107 if (this._loadedResources === x) 108 return; 109 this._loadedResources = x; 110 this._updateResourceProgress(); 111 }, 112 113 _resetResourceCount: function() 114 { 115 this.loadedResources = 0; 116 117 // We never receive a resourceStarted notification for the main resource 118 // (see InspectorController.willSendRequest()) 119 this.totalResources = 1; 120 }, 121 122 resourceStarted: function(resource) 123 { 124 ++this.totalResources; 125 }, 126 127 resourceFinished: function(resource) 128 { 129 ++this.loadedResources; 130 }, 131 132 reset: function() 133 { 134 this._resetResourceCount(); 135 }, 136 82 137 _setAuditRunning: function(auditRunning) 83 138 { … … 86 141 this._auditRunning = auditRunning; 87 142 this._updateButton(); 143 this._updateResourceProgress(); 88 144 }, 89 145 … … 96 152 catIds.push(id); 97 153 } 98 function profilingFinishedCallback()99 {100 this._setAuditRunning(false);101 }102 154 this._setAuditRunning(true); 103 this._runnerCallback(catIds, this._auditPresentStateElement.checked, profilingFinishedCallback.bind(this));155 this._runnerCallback(catIds, this._auditPresentStateElement.checked, this._setAuditRunning.bind(this, false)); 104 156 }, 105 157 … … 122 174 _createCategoryElement: function(title, id) 123 175 { 124 var element;125 176 var labelElement = document.createElement("label"); 126 177 labelElement.id = this._categoryIdPrefix + id; 127 178 128 element = document.createElement("input");179 var element = document.createElement("input"); 129 180 element.type = "checkbox"; 130 181 labelElement.appendChild(element); … … 189 240 190 241 this._launchButton = document.createElement("button"); 191 this._launchButton.setAttribute("type", "button"); 242 this._launchButton.type = "button"; 243 this._launchButton.textContent = WebInspector.UIString("Run"); 192 244 this._launchButton.addEventListener("click", this._launchButtonClicked.bind(this), false); 193 245 this._buttonContainerElement.appendChild(this._launchButton); 194 246 247 this._resourceProgressContainer = document.createElement("span"); 248 this._resourceProgressContainer.className = "resource-progress"; 249 var resourceProgressImage = document.createElement("img"); 250 this._resourceProgressContainer.appendChild(resourceProgressImage); 251 this._resourceProgressTextElement = document.createElement("span"); 252 this._resourceProgressContainer.appendChild(this._resourceProgressTextElement); 253 this._buttonContainerElement.appendChild(this._resourceProgressContainer); 254 195 255 this._contentElement.appendChild(this._buttonContainerElement); 196 256 … … 200 260 }, 201 261 262 _updateResourceProgress: function() 263 { 264 if (!this._resourceProgressContainer) 265 return; 266 267 if (!this._auditRunning) 268 this._resourceProgressContainer.addStyleClass("hidden"); 269 else { 270 this._resourceProgressContainer.removeStyleClass("hidden"); 271 this._resourceProgressTextElement.textContent = WebInspector.UIString("Loading (%d of %d)", this.loadedResources, this.totalResources); 272 } 273 }, 274 202 275 _updateButton: function() 203 276 { 204 277 this._launchButton.disabled = !this._currentCategoriesCount || this._auditRunning; 205 if (this._auditRunning)206 this._launchButton.textContent = WebInspector.UIString("Running...");207 else208 this._launchButton.textContent = WebInspector.UIString("Run");209 278 } 210 279 } -
trunk/WebCore/inspector/front-end/AuditsPanel.js
r55727 r55999 99 99 }, 100 100 101 resourceStarted: function(resource) 102 { 103 this._launcherView.resourceStarted(resource); 104 }, 105 106 resourceFinished: function(resource) 107 { 108 this._launcherView.resourceFinished(resource); 109 }, 110 101 111 _constructCategories: function() 102 112 { … … 241 251 }, 242 252 253 reset: function() 254 { 255 this._launcherView.reset(); 256 }, 257 243 258 attach: function() 244 259 { -
trunk/WebCore/inspector/front-end/WebKit.qrc
r55790 r55999 190 190 <file>Images/segmentSelectedEnd.png</file> 191 191 <file>Images/sessionStorage.png</file> 192 <file>Images/spinner.gif</file> 192 193 <file>Images/splitviewDimple.png</file> 193 194 <file>Images/splitviewDividerBackground.png</file> -
trunk/WebCore/inspector/front-end/audits.css
r55727 r55999 174 174 } 175 175 176 .audit-launcher-view .resource-progress > img { 177 content: url(Images/spinner.gif); 178 vertical-align: text-top; 179 margin: 0 4px 0 8px; 180 } 181 176 182 .audit-result-view { 177 183 overflow: auto; -
trunk/WebCore/inspector/front-end/inspector.js
r55799 r55999 1077 1077 if (this.panels.resources) 1078 1078 this.panels.resources.addResource(resource); 1079 if (this.panels.audits) 1080 this.panels.audits.resourceStarted(resource); 1079 1081 } 1080 1082 … … 1121 1123 resource.failed = payload.failed; 1122 1124 resource.finished = payload.finished; 1125 if (this.panels.audits) 1126 this.panels.audits.resourceFinished(resource); 1123 1127 } 1124 1128
Note: See TracChangeset
for help on using the changeset viewer.