Web Inspector: preview content view for MIME type application/json should be a collap...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2017 05:00:00 +0000 (05:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2017 05:00:00 +0000 (05:00 +0000)
commit52ea355cc4f761886c9012c82bbef3ac8b7a185a
treed39cfdfd53d49dcfe1178fde49acdf258a2bf8f1
parent53d04ba510203fa7ba482111468c286a926743d4
Web Inspector: preview content view for MIME type application/json should be a collapsible tree outline
https://bugs.webkit.org/show_bug.cgi?id=158938
<rdar://problem/26891128>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-20
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New files and strings.

* UserInterface/Views/JSONResourceContentView.css: Added.
(.content-view.resource.json):
(.content-view.resource.json .object-tree .prototype-property):
Some padding and scrolling for the JSON content view.

* UserInterface/Views/JSONResourceContentView.js: Added.
(WI.JSONResourceContentView):
(WI.JSONResourceContentView.customContentViewDisplayName):
(WI.JSONResourceContentView.prototype.contentAvailable):
(WI.JSONResourceContentView.prototype.closed):
JSON view evaluates the JSON content on the page and shows an ObjectTree
for the resulting object.

* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView):
(WI.ResourceClusterContentView.prototype.get customResponseContentView):
(WI.ResourceClusterContentView.prototype.get selectionPathComponents):
(WI.ResourceClusterContentView.prototype.restoreFromCookie):
(WI.ResourceClusterContentView.prototype.showResponse):
(WI.ResourceClusterContentView.prototype._canShowRequestContentView):
(WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._pathComponentForContentView):
(WI.ResourceClusterContentView.prototype._identifierForContentView):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._resourceTypeDidChange):
(WI.ResourceClusterContentView.prototype._resourceLoadingDidFinish):
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._customContentViewConstructorForResource):
Allow a custom content view to be used for a resource based on the response.
Currently the only custom content view is the JSON content view.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223806 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.css [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js