Created attachment 297755 [details] [SCREENSHOT] STEPS TO REPRODUCE: 1. Drag an image into a tab 2. Open Web Inspector 3. Go to resources tab 4. Click on main resource => Shows a source code text editor, not the image
<rdar://problem/29805723>
Created attachment 306591 [details] Patch
Comment on attachment 306591 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=306591&action=review > Source/WebCore/inspector/InspectorNetworkAgent.cpp:383 > + if (type != newType && (type != InspectorPageAgent::OtherResource && newType != InspectorPageAgent::DocumentResource) && newType != InspectorPageAgent::XHRResource && newType != InspectorPageAgent::OtherResource) This feels wrong. I'm not sure what type transitions are allowed here. Will investigate.
Comment on attachment 306591 [details] Patch Does this fix the double resource in the sidebar?
(In reply to Timothy Hatcher from comment #4) > Comment on attachment 306591 [details] > Patch > > Does this fix the double resource in the sidebar? The change to FrameResourceManager.js:683 prevents a child from being added that duplicates the parent frame main resource.
Comment on attachment 306591 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=306591&action=review I'm going to r- because this patch probably no longer applies. >> Source/WebCore/inspector/InspectorNetworkAgent.cpp:383 >> + if (type != newType && (type != InspectorPageAgent::OtherResource && newType != InspectorPageAgent::DocumentResource) && newType != InspectorPageAgent::XHRResource && newType != InspectorPageAgent::OtherResource) > > This feels wrong. I'm not sure what type transitions are allowed here. Will investigate. I agree, this is confusing. It needs some kind of justification / explanation. Perhaps writings the condition differently would make it clearer? I think there are other places in the code that say "If this is a MainResource assume its a DocumentResource". Maybe that is the ultimate problem that should be addressed?