RESOLVED FIXED38635
Web Inspector: Do not show content tab for resources not supporting content preview.
https://bugs.webkit.org/show_bug.cgi?id=38635
Summary Web Inspector: Do not show content tab for resources not supporting content p...
Pavel Feldman
Reported 2010-05-06 02:33:31 PDT
Patch to follow.
Attachments
[PATCH] Proposed change. (5.19 KB, patch)
2010-05-06 02:40 PDT, Pavel Feldman
no flags
[PATCH] Same with binary diff for removed localized string. (5.31 KB, patch)
2010-05-06 02:50 PDT, Pavel Feldman
timothy: review+
commit-queue: commit-queue-
Pavel Feldman
Comment 1 2010-05-06 02:40:38 PDT
Created attachment 55220 [details] [PATCH] Proposed change.
Pavel Feldman
Comment 2 2010-05-06 02:50:15 PDT
Created attachment 55221 [details] [PATCH] Same with binary diff for removed localized string.
Timothy Hatcher
Comment 3 2010-05-06 07:45:23 PDT
Comment on attachment 55221 [details] [PATCH] Same with binary diff for removed localized string. So what views/resource types will no have a content tab now?
Pavel Feldman
Comment 4 2010-05-06 07:55:19 PDT
(In reply to comment #3) > (From update of attachment 55221 [details]) > So what views/resource types will no have a content tab now? Resources that had ResourceView as a renderer (and resulted in "No content available" at all times) will have no content tab. No other changes here.
WebKit Commit Bot
Comment 5 2010-05-06 09:01:27 PDT
Comment on attachment 55221 [details] [PATCH] Same with binary diff for removed localized string. Rejecting patch 55221 from commit-queue. Failed to run "[u'/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/svn-apply', u'--reviewer', u'Timothy Hatcher', u'--force']" exit_code: 255 Parsed 6 diffs from patch file(s). patching file WebCore/ChangeLog Hunk #1 succeeded at 1 with fuzz 3. only literal type is supported now at /Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/svn-apply line 254. Full output: http://webkit-commit-queue.appspot.com/results/2161024
Pavel Feldman
Comment 6 2010-05-06 09:31:03 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/English.lproj/localizedStrings.js M WebCore/inspector/front-end/FontView.js M WebCore/inspector/front-end/ImageView.js M WebCore/inspector/front-end/ResourceView.js M WebCore/inspector/front-end/SourceView.js Committed r58884
Joseph Pecoraro
Comment 7 2010-05-06 09:38:29 PDT
> WebInspector.FontView.prototype = { > + hasContentTab: function() > + { > + return true; > + }, > + Why a function and not just a boolean? hasContentTab: true, Then those that don't include the boolean would still work (undefined ~~ false). > @@ -118,6 +119,8 @@ WebInspector.ResourceView = function(resource) > this._refreshRequestHeaders(); > this._refreshResponseHeaders(); > this._refreshHTTPInformation(); > + if (!this.hasContentTab()) > + this.contentTabElement.addStyleClass("hidden"); > this._selectTab(); How does this affect tab preferences? If you want to see the content, and you click (1) resource with preview, (2) resource without preview, (3) resource with preview? > + hasContentTab: function() > + { > + // Ancestors should override this method and define this.contentTabSelected for content rendering. > + return false; > + }, I think "Ancestors" is the wrong direction. "Children" or "Sub-something" might be better.
Timothy Hatcher
Comment 8 2010-05-06 09:39:55 PDT
Subclasses.
Pavel Feldman
Comment 9 2010-05-06 09:43:25 PDT
(In reply to comment #7) > > WebInspector.FontView.prototype = { > > + hasContentTab: function() > > + { > > + return true; > > + }, > > + > > Why a function and not just a boolean? Well, I want it to be immutable. > How does this affect tab preferences? If you want to see the content, and you > click (1) resource with preview, (2) resource without preview, (3) resource > with preview? > I think it'll reset preferences to Headers in that case. Now sure which way is more predictable though. > > I think "Ancestors" is the wrong direction. "Children" or "Sub-something" might > be better. I surely meant derived classes.
Joseph Pecoraro
Comment 10 2010-05-06 10:01:50 PDT
> > Why a function and not just a boolean? > > Well, I want it to be immutable. Bad argument. Making this a function doesn't protect against this. Both are easily mutable. > WebInspector.FontView.prototype.hasContentTab = function() { return false; } > I think it'll reset preferences to Headers in that case. Now sure which way is > more predictable though. I certainly wouldn't like that! I think I'd prefer seeing "No Content" instead.
Pavel Feldman
Comment 11 2010-05-06 10:25:43 PDT
> > > I think it'll reset preferences to Headers in that case. Now sure which way is > > more predictable though. > > I certainly wouldn't like that! I think I'd prefer seeing "No Content" instead. "No Content" is bad because "Content" tab is being default even for entries with no content. I was demoing inspector's redirects functionality and it was very silly of resources tab to default to "Content" for "Moved permanently" resources having no content. At the same time, preserving "Content" as last selected while traversing through content-less entries should be feasible.
Note You need to log in before you can comment on or make changes to this bug.