Bug 27503

Summary: Inspector: Should Syntax Highlight JSON
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: OS X 10.5   
Attachments:
Description Flags
patch
none
Test Page
none
Added 'application/javascript' timothy: review+

Joseph Pecoraro
Reported 2009-07-21 08:51:06 PDT
JSON syntax is a subset of Javascript and it would be nice if this were syntax highlighted in the SourceView.
Attachments
patch (1.40 KB, patch)
2009-07-21 09:05 PDT, Joseph Pecoraro
no flags
Test Page (38 bytes, text/plain)
2009-07-21 09:17 PDT, Joseph Pecoraro
no flags
Added 'application/javascript' (1.47 KB, patch)
2009-07-21 09:28 PDT, Joseph Pecoraro
timothy: review+
Joseph Pecoraro
Comment 1 2009-07-21 09:05:52 PDT
Created attachment 33179 [details] patch Most JSON is from an XHR and thus its resource.type is "WebInspector.Resource.Type.XHR". This patch therefore tries to also highlight resources that have a mime type of 'application/json' and even further if the resource ends in the common extension names ".js" or ".json".
Joseph Pecoraro
Comment 2 2009-07-21 09:17:48 PDT
Created attachment 33180 [details] Test Page Test Case attached: 1. Test an XHR returned with mime type 'application/json' 2. Test as XHR returned with extensions '.js' or '.json' ignoring query parameters Everything works property with the patch. They are all black/white text in the current release.
Joseph Pecoraro
Comment 3 2009-07-21 09:28:40 PDT
Created attachment 33182 [details] Added 'application/javascript' Added 'application/javascript'. Added to the test page.
Adam Barth
Comment 4 2009-07-24 00:51:48 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/inspector/front-end/SourceView.js Committed r46331 M WebCore/ChangeLog M WebCore/inspector/front-end/SourceView.js r46331 = 0b1049da038878886441c4299cc970f791be68d2 (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/46331
Note You need to log in before you can comment on or make changes to this bug.