Changeset 247747 in webkit
- Timestamp:
- Jul 23, 2019 2:50:59 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r247715 r247747 1 2019-07-23 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: Display "Resource has no content" for about:blank iframes instead of an error 4 https://bugs.webkit.org/show_bug.cgi?id=198029 5 6 Reviewed by Devin Rousso. 7 8 Display "about:blank" in the middle of the content view when selecting "about:blank" resources. 9 Previoulsly, we showed a misleading "An error occurred trying to load the resource" error 10 message. 11 12 * UserInterface/Models/CSSStyleSheet.js: 13 (WI.CSSStyleSheet.prototype.requestContentFromBackend): 14 * UserInterface/Models/Resource.js: 15 (WI.Resource.prototype.requestContentFromBackend): 16 * UserInterface/Models/Script.js: 17 (WI.Script.prototype.requestContentFromBackend): 18 * UserInterface/Models/SourceCode.js: 19 (WI.SourceCode.generateSpecialContentForURL): 20 (WI.SourceCode.prototype._processContent): 21 (WI.SourceCode): 22 * UserInterface/Views/ResourceContentView.js: 23 (WI.ResourceContentView.prototype._contentAvailable): 24 25 * UserInterface/Views/SourceCodeTextEditor.js: 26 (WI.SourceCodeTextEditor.prototype._contentAvailable): 27 (WI.SourceCodeTextEditor.prototype._showMessage): 28 * UserInterface/Views/TextResourceContentView.js: 29 (WI.TextResourceContentView.prototype._contentDidPopulate): 30 Display empty text editor when it has no content instead of "Resource has no content" message. 31 1 32 2019-07-22 Devin Rousso <drousso@apple.com> 2 33 -
trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js
r220119 r247747 191 191 requestContentFromBackend() 192 192 { 193 let specialContentPromise = WI.SourceCode.generateSpecialContentForURL(this._url); 194 if (specialContentPromise) 195 return specialContentPromise; 196 193 197 if (!this._id) { 194 198 // There is no identifier to request content with. Reject the promise to cause the -
trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js
r245827 r247747 820 820 requestContentFromBackend() 821 821 { 822 let specialContentPromise = WI.SourceCode.generateSpecialContentForURL(this._url); 823 if (specialContentPromise) 824 return specialContentPromise; 825 822 826 // If we have the requestIdentifier we can get the actual response for this specific resource. 823 827 // Otherwise the content will be cached resource data, which might not exist anymore. -
trunk/Source/WebInspectorUI/UserInterface/Models/Script.js
r244398 r247747 186 186 requestContentFromBackend() 187 187 { 188 let specialContentPromise = WI.SourceCode.generateSpecialContentForURL(this._url); 189 if (specialContentPromise) 190 return specialContentPromise; 191 188 192 if (!this._id) { 189 193 // There is no identifier to request content with. Return false to cause the -
trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js
r223856 r247747 38 38 } 39 39 40 // Static 41 42 static generateSpecialContentForURL(url) 43 { 44 if (url === "about:blank") { 45 return Promise.resolve({ 46 content: "", 47 message: WI.unlocalizedString("about:blank") 48 }); 49 } 50 return null; 51 } 52 40 53 // Public 41 54 … … 198 211 let content = rawContent; 199 212 let error = parameters.error; 213 let message = parameters.message; 200 214 if (parameters.base64Encoded) 201 215 content = content ? decodeBase64ToBlob(content, this.mimeType) : ""; … … 213 227 return Promise.resolve({ 214 228 error, 229 message, 215 230 sourceCode: this, 216 231 content, -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js
r236766 r247747 136 136 } 137 137 138 if (parameters.message) { 139 this.showMessage(parameters.message); 140 return; 141 } 142 138 143 // Content is ready to show, call the public method now. 139 144 console.assert(!this._hasContent()); -
trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
r247639 r247747 528 528 return; 529 529 530 if (parameters.message) { 531 this._showMessage(parameters.message); 532 return; 533 } 534 530 535 var sourceCode = parameters.sourceCode; 531 536 var content = sourceCode.content; … … 549 554 550 555 this.repeatReveal = false; 556 } 557 558 _showMessage(message) 559 { 560 this.element.removeChildren(); 561 this.element.appendChild(WI.createMessageTextView(message)); 551 562 } 552 563 -
trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js
r246419 r247747 215 215 this._codeCoverageButtonNavigationItem.enabled = this._textEditor.canShowCoverageHints(); 216 216 this._codeCoverageButtonNavigationItem.activated = WI.settings.enableControlFlowProfiler.value; 217 218 if (!this._textEditor.string)219 this.showGenericNoContentMessage();220 217 } 221 218
Note: See TracChangeset
for help on using the changeset viewer.