[webkit-reviews] review granted: [Bug 190354] Web Inspector: CSP request payload on medium.com is unreadable, should be pretty-printed : [Attachment 351985] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 10 15:03:23 PDT 2018


Joseph Pecoraro <joepeck at webkit.org> has granted Devin Rousso
<drousso at apple.com>'s request for review:
Bug 190354: Web Inspector: CSP request payload on medium.com is unreadable,
should be pretty-printed
https://bugs.webkit.org/show_bug.cgi?id=190354

Attachment 351985: Patch

https://bugs.webkit.org/attachment.cgi?id=351985&action=review




--- Comment #12 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 351985
  --> https://bugs.webkit.org/attachment.cgi?id=351985
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=351985&action=review

We could try to write a test for this. We don't have any TextEditor tests right
now. I'm not sure how tangled of a mess that will be considering this is View
code. But I could imagine just creating a TextEditor, populating it, and
watching for the event + mime type change.

> Source/WebInspectorUI/UserInterface/Views/TextEditor.js:144
> +		   if (this._codeMirror.getMode().name === "null")

Lets give this a comment. Maybe something like:

    // Attempt to determine a better mode / mime type for this content
    // to enable syntax highlighting and formatting features.

> Source/WebInspectorUI/UserInterface/Views/TextEditor.js:903
> +	       this.mimeType = "application/javascript";

Because this is asynchronous, I don't think we will auto-format content that is
lazily detected as JavaScript/JSON. We may want to consider that here, since we
know that _attemptToDetermineMIMEType is done on initial content load, we could
attempt to auto format here.


More information about the webkit-reviews mailing list