Web Inspector: Large background image fails to load in inspector
authorburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Feb 2015 18:42:21 +0000 (18:42 +0000)
committerburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Feb 2015 18:42:21 +0000 (18:42 +0000)
commitc1e774a28e22d05aab93a68f2e662fc48181222c
tree7e9cf97b2ab4612a8db2c6aa63e6ada3cf496d24
parentd6c83cf76a9da92a10301cc0d76346ed77e0d279
Web Inspector: Large background image fails to load in inspector
https://bugs.webkit.org/show_bug.cgi?id=141405

Reviewed by Timothy Hatcher.

Convert base64-encoded resource data to binary data using Uint8Array and Blobs.
Use object URLs for blobs instead of data URLs when setting image 'src' attribute
and in @font-face urls. This conversion happens when the backend indicates that
resource content is base64-encoded.

Update image and font clients of resource-fetching functionality so that they use
object URLs correctly. Add some plumbing so that Blobs can be constructed with
the correct mime-type.

* UserInterface/Base/Utilities.js:
(decodeBase64ToBlob): Added.
* UserInterface/Models/CSSStyleSheet.js:
(WebInspector.CSSStyleSheet.prototype.get mimeType): Added.
* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.createObjectURL): Added.
(WebInspector.Resource.prototype.getImageSize.imageDidLoad):
(WebInspector.Resource.prototype.getImageSize):
(WebInspector.Resource.prototype.get contentURL): Deleted.
* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.get mimeType): Added.
* UserInterface/Models/SourceCode.js:
(WebInspector.SourceCode.prototype.get mimeType): Added.
(WebInspector.SourceCode.prototype._processContent):
(WebInspector.SourceCode.prototype.get contentIsBase64Encoded): Deleted.
* UserInterface/Models/SourceCodeRevision.js:
(WebInspector.SourceCodeRevision):
(WebInspector.SourceCodeRevision.prototype.copy):
(WebInspector.SourceCodeRevision.prototype.get contentIsBase64Encoded): Deleted.
(WebInspector.SourceCodeRevision.prototype.set contentIsBase64Encoded): Deleted.
* UserInterface/Views/FontResourceContentView.js:
(WebInspector.FontResourceContentView.prototype.hidden):
(WebInspector.FontResourceContentView.prototype.closed):
* UserInterface/Views/ImageResourceContentView.js:
(WebInspector.ImageResourceContentView.prototype.contentAvailable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Utilities.js
Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js
Source/WebInspectorUI/UserInterface/Models/Resource.js
Source/WebInspectorUI/UserInterface/Models/Script.js
Source/WebInspectorUI/UserInterface/Models/SourceCode.js
Source/WebInspectorUI/UserInterface/Models/SourceCodeRevision.js
Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js
Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.js