WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
Bug 90518
Web Inspector: Add OtherText resourceType and text/plain tokenizer
https://bugs.webkit.org/show_bug.cgi?id=90518
Summary
Web Inspector: Add OtherText resourceType and text/plain tokenizer
Taiju Tsuiki
Reported
2012-07-03 23:57:36 PDT
Inspector in ToT has tokenizer for HTML, CSS and JS now, and TextEditorHighlighter uses HTML tokenizer as default. But, I'd like to show a preview for other text file as plain text. IMO, a possible solution is adding OtherText as another ResourceType and using SourceTokenizer as tokenizer for "text/plain".
Attachments
Patch
(8.33 KB, patch)
2012-07-03 23:59 PDT
,
Taiju Tsuiki
no flags
Details
Formatted Diff
Diff
Patch
(8.30 KB, patch)
2012-07-04 00:06 PDT
,
Taiju Tsuiki
vsevik
: review-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Taiju Tsuiki
Comment 1
2012-07-03 23:59:14 PDT
Created
attachment 150721
[details]
Patch
Taiju Tsuiki
Comment 2
2012-07-04 00:06:05 PDT
Created
attachment 150722
[details]
Patch
Vsevolod Vlasov
Comment 3
2012-07-05 13:46:41 PDT
Comment on
attachment 150722
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=150722&action=review
> Source/WebCore/ChangeLog:3 > + Web Inspector: Add OtherText resource type and text/plain tokenizer
I don't think we should add another resource type for this. Resource type are essentially duplicating CachedResource types and we don't want to extend this list. You should use Other instead. Backend could decide whether file has text content or not based on the mime type. Binary content should be served to frontend base64 encoded. (We already have some text detecting heuristics in NetworkResourcesData:
http://code.google.com/p/chromium/source/search?q=file%3Ainspector+%22.mimetype+%3D+%22&origq=file%3Ainspector+%22.mimetype+%3D+%22&btnG=Search+Trunk
) Frontend can then show content as text if it is not base64 encoded.
Pavel Feldman
Comment 4
2012-07-05 21:32:23 PDT
As per
comment #3
.
Taiju Tsuiki
Comment 5
2012-07-09 02:06:26 PDT
Comment on
attachment 150722
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=150722&action=review
>> Source/WebCore/ChangeLog:3 >> + Web Inspector: Add OtherText resource type and text/plain tokenizer > > I don't think we should add another resource type for this. Resource type are essentially duplicating CachedResource types and we don't want to extend this list. > You should use Other instead. > Backend could decide whether file has text content or not based on the mime type. Binary content should be served to frontend base64 encoded. > (We already have some text detecting heuristics in NetworkResourcesData:
http://code.google.com/p/chromium/source/search?q=file%3Ainspector+%22.mimetype+%3D+%22&origq=file%3Ainspector+%22.mimetype+%3D+%22&btnG=Search+Trunk
) > Frontend can then show content as text if it is not base64 encoded.
I see. OK, I'll go other way than adding OtherText. As back-end side of NetworkResourcesData does, DOMImplementation::is{Text,XML}MIMEType seems to work for detecting text file.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug