RESOLVED FIXED 58886
Web Inspector: Render non-document HTML resources as HTML
https://bugs.webkit.org/show_bug.cgi?id=58886
Summary Web Inspector: Render non-document HTML resources as HTML
Vsevolod Vlasov
Reported 2011-04-19 06:01:31 PDT
Render non-document HTML resources as HTML
Attachments
Patch (7.28 KB, patch)
2011-04-19 06:29 PDT, Vsevolod Vlasov
no flags
Fixed quotes (7.28 KB, patch)
2011-04-19 06:34 PDT, Vsevolod Vlasov
no flags
Patch with fixes (7.75 KB, patch)
2011-04-19 07:42 PDT, Vsevolod Vlasov
no flags
Patch with fixes (13.41 KB, patch)
2011-04-20 09:40 PDT, Vsevolod Vlasov
no flags
Patch (with fixes) (17.37 KB, patch)
2011-05-26 08:39 PDT, Vsevolod Vlasov
no flags
Vsevolod Vlasov
Comment 1 2011-04-19 06:29:45 PDT
Vsevolod Vlasov
Comment 2 2011-04-19 06:34:45 PDT
Created attachment 90190 [details] Fixed quotes
Alexander Pavlov (apavlov)
Comment 3 2011-04-19 06:42:16 PDT
Comment on attachment 90190 [details] Fixed quotes View in context: https://bugs.webkit.org/attachment.cgi?id=90190&action=review > Source/WebCore/inspector/front-end/ResourceHTMLView.js:1 > +/* Please add it into WebCore.vcproj as well (and checking if all of our JS files are there is a good idea). > Source/WebCore/inspector/front-end/ResourceHTMLView.js:57 > + iframe.sandbox=""; // Forbid to run JavaScript and set unique origin Comments are full sentences in WebKit (end in a period).
Vsevolod Vlasov
Comment 4 2011-04-19 07:42:04 PDT
Created attachment 90201 [details] Patch with fixes Done these. I'll add missing files in .vcproj in separate bug
Adam Barth
Comment 5 2011-04-19 10:22:04 PDT
Comment on attachment 90201 [details] Patch with fixes View in context: https://bugs.webkit.org/attachment.cgi?id=90201&action=review > Source/WebCore/inspector/front-end/NetworkItemView.js:58 > + if (resource.type !== WebInspector.Resource.Type.Document && resource.content && resource.mimeType == "text/html") { Has mimeType already been canonicalized (e.g., converted to lower case)? What about application/xml+html ? > Source/WebCore/inspector/front-end/ResourceHTMLView.js:57 > + iframe.sandbox=""; // Forbid to run JavaScript and set unique origin. You should use setAttribute rather than the DOM reflection of the attribute.
Vsevolod Vlasov
Comment 6 2011-04-20 09:39:55 PDT
> > Source/WebCore/inspector/front-end/NetworkItemView.js:58 > > + if (resource.type !== WebInspector.Resource.Type.Document && resource.content && resource.mimeType == "text/html") { > > Has mimeType already been canonicalized (e.g., converted to lower case)? What about application/xml+html ? I removed this check. We decided that we should render HTML only for resources with error status code. > > Source/WebCore/inspector/front-end/ResourceHTMLView.js:57 > > + iframe.sandbox=""; // Forbid to run JavaScript and set unique origin. > > You should use setAttribute rather than the DOM reflection of the attribute. Done
Vsevolod Vlasov
Comment 7 2011-04-20 09:40:49 PDT
Created attachment 90351 [details] Patch with fixes
Pavel Feldman
Comment 8 2011-04-20 10:16:06 PDT
Comment on attachment 90351 [details] Patch with fixes View in context: https://bugs.webkit.org/attachment.cgi?id=90351&action=review > Source/WebCore/inspector/front-end/NetworkItemView.js:48 > + var responseView = new WebInspector.ResourceSourceFrame(resource); You could reuse existing SourceFrame in case previewView is instance of ResourceSourceFrame. In fact, you should adjust resourceViewForResource to cache only SourceFrame views. > Source/WebCore/inspector/front-end/Resource.js:795 > + if (data == null) pending callbacks should be notified upon missing content. > Source/WebCore/inspector/front-end/ResourceHTMLView.js:52 > + this.element.textContent = ""; this.element.removeChildren() > Source/WebCore/inspector/front-end/ResourceView.js:49 > + return new WebInspector.ResourceHTMLView(resource); Reuse SourceFrame-based views when possible as per comment above. > Source/WebCore/inspector/front-end/ResourceView.js:80 > + if (WebInspector.ResourceJSONView.parseJSON(resource.content)) This seems to be a bit too expensive. Testing for the prototype would be sufficient.
Vsevolod Vlasov
Comment 9 2011-05-26 08:38:04 PDT
(In reply to comment #8) > (From update of attachment 90351 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=90351&action=review > > > Source/WebCore/inspector/front-end/NetworkItemView.js:48 > > + var responseView = new WebInspector.ResourceSourceFrame(resource); > > You could reuse existing SourceFrame in case previewView is instance of ResourceSourceFrame. In fact, you should adjust resourceViewForResource to cache only SourceFrame views. We ar enot caching SourceFrames anymore, but I reuse SourceFrame for the response and rpeview view the same resource. > > Source/WebCore/inspector/front-end/Resource.js:795 > > + if (data == null) > > pending callbacks should be notified upon missing content. Removed that. > > Source/WebCore/inspector/front-end/ResourceHTMLView.js:52 > > + this.element.textContent = ""; > > this.element.removeChildren() Done. > > Source/WebCore/inspector/front-end/ResourceView.js:49 > > + return new WebInspector.ResourceHTMLView(resource); > > Reuse SourceFrame-based views when possible as per comment above. Reusing SourceFrame between preview and response view now. > > Source/WebCore/inspector/front-end/ResourceView.js:80 > > + if (WebInspector.ResourceJSONView.parseJSON(resource.content)) > > This seems to be a bit too expensive. Testing for the prototype would be sufficient. This method was removed, so this is not needed anymore.
Vsevolod Vlasov
Comment 10 2011-05-26 08:39:52 PDT
Created attachment 94979 [details] Patch (with fixes)
Pavel Feldman
Comment 11 2011-05-31 22:07:57 PDT
Comment on attachment 94979 [details] Patch (with fixes) View in context: https://bugs.webkit.org/attachment.cgi?id=94979&action=review > Source/WebCore/inspector/front-end/Settings.js:71 > + this.installApplicationSetting("resourceViewTab", "preview"); Where will user be navigated in case he has "content" in his settings?
Vsevolod Vlasov
Comment 12 2011-06-01 06:02:22 PDT
(In reply to comment #11) > (From update of attachment 94979 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=94979&action=review > > > Source/WebCore/inspector/front-end/Settings.js:71 > > + this.installApplicationSetting("resourceViewTab", "preview"); > > Where will user be navigated in case he has "content" in his settings? To headers tab that is the default one. http://codesearch.google.com/codesearch/p?hl=en#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/inspector/front-end/NetworkItemView.js&q=resourceViewTab&exact_package=chromium&l=83
WebKit Review Bot
Comment 13 2011-06-08 07:58:44 PDT
Comment on attachment 94979 [details] Patch (with fixes) Clearing flags on attachment: 94979 Committed r88348: <http://trac.webkit.org/changeset/88348>
WebKit Review Bot
Comment 14 2011-06-08 07:58:49 PDT
All reviewed patches have been landed. Closing bug.
Yury Semikhatsky
Comment 15 2011-06-10 02:05:13 PDT
*** Bug 53067 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.