Changeset 31909 in webkit
- Timestamp:
- Apr 15, 2008 10:24:09 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31908 r31909 1 2008-04-15 Timothy Hatcher <timothy@apple.com> 2 3 Fixes the regression where error and warning bubbles would not be added 4 to the source view of a resource. 5 6 https://bugs.webkit.org/show_bug.cgi?id=18495 7 8 Reviewed by Adam Roben. 9 10 * css/view-source.css: 11 (.webkit-html-message-bubble): Add a min-height to make sure the border-radius 12 has enough room to apply. 13 * page/inspector/Console.js: 14 (WebInspector.Console.prototype.addMessage): Removed code that added messages 15 to resource panels and incremented error and warning counts on resources. 16 Now just call ResourcesPanel.addMessageToResource after assigning the resource 17 to the console message. 18 (WebInspector.Console.prototype.clearMessages): Removed code that cleared error 19 and warning counts from resources an call ResourcesPanel.clearMessages. 20 * page/inspector/ResourcesPanel.js: 21 (WebInspector.ResourcesPanel.prototype.addMessageToResource): Call addMessage 22 on the resource's view, if it is implemented. 23 (WebInspector.ResourcesPanel.prototype.clearMessages): Call clearMessages 24 on all the resource views for the ones that implement it. 25 (WebInspector.ResourcesPanel.prototype.refreshResource): Call _resourceView 26 to make the resource's view if needed. Use a local view variable. 27 (WebInspector.ResourcesPanel.prototype._resourceView): Added helper function 28 to create a resource view if needed. 29 * page/inspector/SourceView.js: 30 (WebInspector.SourceView.prototype.setupSourceFrameIfNeeded): Delete the 31 _frameNeedsSetup property at the beginning to prevent recursion. Get the 32 length of the messages array when assigning the local length variable. 33 (WebInspector.SourceView.prototype.addMessage): Renamed from addMessageToSource. 34 (WebInspector.SourceView.prototype.clearMessages): Added. Clear all the message 35 bubbles that might be sprinkled in the source. Also clears the messages array. 36 (WebInspector.SourceView.prototype._addMessageToSource): Create the image 37 element in the Inspector's document so we can use relative image URLs. Then 38 adopt the image element into the frame's document. 39 1 40 2008-04-15 Brady Eidson <beidson@apple.com> 2 41 -
trunk/WebCore/css/view-source.css
r31639 r31909 124 124 -webkit-border-radius: 9px; 125 125 -webkit-border-fit: lines; 126 min-height: 13px; 126 127 font-size: 9px; 127 128 font-family: Lucida Grande; -
trunk/WebCore/page/inspector/Console.js
r31889 r31909 136 136 addMessage: function(msg) 137 137 { 138 /*139 FIXME: Re-implement addMessageToSource in SourceView and ResourcesPanel.140 138 if (msg.url in WebInspector.resourceURLMap) { 141 139 msg.resource = WebInspector.resourceURLMap[msg.url]; 142 switch (msg.level) { 143 case WebInspector.ConsoleMessage.MessageLevel.Warning: 144 ++msg.resource.warnings; 145 if (msg.resource.panel.addMessageToSource) 146 msg.resource.panel.addMessageToSource(msg); 147 break; 148 case WebInspector.ConsoleMessage.MessageLevel.Error: 149 ++msg.resource.errors; 150 if (msg.resource.panel.addMessageToSource) 151 msg.resource.panel.addMessageToSource(msg); 152 break; 153 } 154 } 155 */ 140 WebInspector.panels.resources.addMessageToResource(msg.resource, msg); 141 } 156 142 157 143 this.messages.push(msg); … … 164 150 clearMessages: function() 165 151 { 166 for (var i = 0; i < this.messages.length; ++i) { 167 var resource = this.messages[i].resource; 168 if (!resource) 169 continue; 170 resource.errors = 0; 171 resource.warnings = 0; 172 } 152 WebInspector.panels.resources.clearMessages(); 173 153 174 154 this.messages = []; -
trunk/WebCore/page/inspector/ResourcesPanel.js
r31885 r31909 261 261 }, 262 262 263 addMessageToResource: function(resource, msg) 264 { 265 if (!resource) 266 return; 267 268 var view = this._resourceView(resource); 269 if (view.addMessage) 270 view.addMessage(msg); 271 }, 272 273 clearMessages: function() 274 { 275 var resourcesLength = this._resources.length; 276 for (var i = 0; i < resourcesLength; ++i) { 277 var resource = this._resources[i]; 278 var view = resource._resourcesView; 279 if (!view || !view.clearMessages) 280 continue; 281 view.clearMessages(); 282 } 283 }, 284 263 285 refreshResource: function(resource, skipBoundaryUpdate, skipSort, immediate) 264 286 { … … 309 331 this.visibleResource._resourcesView.hide(); 310 332 311 if (!resource._resourcesView) 312 resource._resourcesView = this._createResourceView(resource); 313 resource._resourcesView.show(); 314 315 if (line && resource._resourcesView.showLine) 316 resource._resourcesView.showLine(line); 333 var view = this._resourceView(resource); 334 view.show(); 335 336 if (line && view.showLine) 337 view.showLine(line); 317 338 318 339 if (resource._resourcesTreeElement) { … … 849 870 }, 850 871 872 _resourceView: function(resource) 873 { 874 if (!resource) 875 return null; 876 if (!resource._resourcesView) 877 resource._resourcesView = this._createResourceView(resource); 878 return resource._resourcesView; 879 }, 880 851 881 _createResourceView: function(resource) 852 882 { -
trunk/WebCore/page/inspector/SourceView.js
r31885 r31909 52 52 { 53 53 if (this._frameNeedsSetup) { 54 delete this._frameNeedsSetup; 55 54 56 this.attach(); 55 57 … … 57 59 WebInspector.addMainEventListeners(this.frameElement.contentDocument); 58 60 59 var length = this.messages ;61 var length = this.messages.length; 60 62 for (var i = 0; i < length; ++i) 61 63 this._addMessageToSource(this.messages[i]); 62 63 delete this._frameNeedsSetup;64 64 } 65 65 }, … … 91 91 }, 92 92 93 addMessage ToSource: function(msg)93 addMessage: function(msg) 94 94 { 95 95 this.messages.push(msg); 96 96 if (!this._frameNeedsSetup) 97 97 this._addMessageToSource(msg); 98 }, 99 100 clearMessages: function() 101 { 102 this.messages = []; 103 104 if (this._frameNeedsSetup) 105 return; 106 107 var bubbles = this.frameElement.contentDocument.querySelectorAll(".webkit-html-message-bubble"); 108 if (!bubbles) 109 return; 110 111 for (var i = 0; i < bubbles.length; ++i) { 112 var bubble = bubbles[i]; 113 bubble.parentNode.removeChild(bubble); 114 } 98 115 }, 99 116 … … 130 147 errorDiv.appendChild(lineDiv); 131 148 132 var image = doc.createElement("img"); 149 // Create the image element in the Inspector's document so we can use relative image URLs. 150 var image = document.createElement("img"); 133 151 image.src = imageURL; 134 152 image.className = "webkit-html-message-icon"; 153 154 // Adopt the image element since it wasn't created in doc. 155 image = doc.adoptNode(image); 135 156 lineDiv.appendChild(image); 136 157
Note: See TracChangeset
for help on using the changeset viewer.