NEW 148484
Web Inspector: Resources tab shouldn't show HTML resource types when inspecting JSContext
https://bugs.webkit.org/show_bug.cgi?id=148484
Summary Web Inspector: Resources tab shouldn't show HTML resource types when inspecti...
Blaze Burg
Reported 2015-08-26 11:12:02 PDT
I think we can simply hide the Resource Type selector from the sidebar if inspecting a JSContext.
Attachments
Screenshot of the useless UI (158.23 KB, image/png)
2015-08-26 11:12 PDT, Blaze Burg
no flags
Proposed Fix (2.88 KB, patch)
2015-08-26 11:51 PDT, Blaze Burg
joepeck: review-
joepeck: commit-queue-
Blaze Burg
Comment 1 2015-08-26 11:12:32 PDT
Created attachment 259963 [details] Screenshot of the useless UI
Radar WebKit Bug Importer
Comment 2 2015-08-26 11:12:46 PDT
Timothy Hatcher
Comment 3 2015-08-26 11:34:55 PDT
It could be repurposed to filter by script type (anonymous, named, etc.)
Blaze Burg
Comment 4 2015-08-26 11:51:25 PDT
Created attachment 259967 [details] Proposed Fix
Blaze Burg
Comment 5 2015-08-26 11:58:14 PDT
(In reply to comment #3) > It could be repurposed to filter by script type (anonymous, named, etc.) Filed: https://bugs.webkit.org/show_bug.cgi?id=148487
Joseph Pecoraro
Comment 6 2015-08-26 12:20:55 PDT
Comment on attachment 259967 [details] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=259967&action=review > Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:44 > + let shouldDisplayResourceTypes = WebInspector.debuggableType === WebInspector.DebuggableType.Web; An augmented JavaScript debuggable could show non-Script resources if there is a NetworkAgent/PageAgent. So we may want to tweak this.
Blaze Burg
Comment 7 2015-08-26 14:02:40 PDT
(In reply to comment #6) > Comment on attachment 259967 [details] > Proposed Fix > > View in context: > https://bugs.webkit.org/attachment.cgi?id=259967&action=review > > > Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:44 > > + let shouldDisplayResourceTypes = WebInspector.debuggableType === WebInspector.DebuggableType.Web; > > An augmented JavaScript debuggable could show non-Script resources if there > is a NetworkAgent/PageAgent. So we may want to tweak this. I wish there was a 1:1 between (debuggable type+protocol version) and its capabilities. Maybe we should have something more fine-grained? I want to use feature tests like ".supportsResource(type)". There might be similar things going on in other parts of the inspector where we show irrelevant UI, such as legacy versions.
Joseph Pecoraro
Comment 8 2015-08-26 16:08:59 PDT
Comment on attachment 259967 [details] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=259967&action=review >>> Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:44 >>> + let shouldDisplayResourceTypes = WebInspector.debuggableType === WebInspector.DebuggableType.Web; >> >> An augmented JavaScript debuggable could show non-Script resources if there is a NetworkAgent/PageAgent. So we may want to tweak this. > > I wish there was a 1:1 between (debuggable type+protocol version) and its capabilities. Maybe we should have something more fine-grained? I want to use feature tests like ".supportsResource(type)". > > There might be similar things going on in other parts of the inspector where we show irrelevant UI, such as legacy versions. r- at the moment because of this case, let me know if you want help testing this edge case. Augmented JSContext can have any set of capabilities and we need to feature-check the Agents to then see their capabilities. A "supportsResource(type)" might be overkill because currently each backend supports the same set of resource types (see the Page.ResourceType enum). Basically here we can check, if window.PageAgent, then all resource types are possible from the backend. There likely are some irrelevant pieces, but I've tested it a bunch in the past, we should be pretty solid right now.
Devin Rousso
Comment 9 2015-09-08 16:00:00 PDT
Comment on attachment 259967 [details] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=259967&action=review > Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:54 > + let shouldGroupNonExclusiveItems = shouldDisplayResourceTypes; Is this variable only for the sake of clarity, or is there some other reason you are creating another variable that duplicates the value of shouldDisplayResourceTypes?
Blaze Burg
Comment 10 2015-09-08 16:08:47 PDT
Comment on attachment 259967 [details] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=259967&action=review >> Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:54 >> + let shouldGroupNonExclusiveItems = shouldDisplayResourceTypes; > > Is this variable only for the sake of clarity, or is there some other reason you are creating another variable that duplicates the value of shouldDisplayResourceTypes? It is part of my crusade against bool positional parameters. I am having more luck in our C++ code, since we can do enum classes there.
Note You need to log in before you can comment on or make changes to this bug.