RESOLVED DUPLICATE of bug 161417151865
Web Inspector: debugger popover should have syntax highlighting when showing a function's source
https://bugs.webkit.org/show_bug.cgi?id=151865
Summary Web Inspector: debugger popover should have syntax highlighting when showing ...
Blaze Burg
Reported 2015-12-04 09:59:35 PST
Created attachment 266633 [details] [Screenshot] unstyled function text It looks like we are just inserting a bunch of function source text into the DOM. It should be a readonly CodeMirror instance with syntax highlighting.
Attachments
[Screenshot] unstyled function text (416.17 KB, image/png)
2015-12-04 09:59 PST, Blaze Burg
no flags
[Patch] Proposed Fix (4.44 KB, patch)
2015-12-10 16:31 PST, Matt Baker
timothy: review-
[Image] New function popover UI (234.15 KB, image/png)
2015-12-10 16:35 PST, Matt Baker
no flags
Radar WebKit Bug Importer
Comment 1 2015-12-04 09:59:45 PST
Matt Baker
Comment 2 2015-12-10 16:31:55 PST
Created attachment 267136 [details] [Patch] Proposed Fix
Matt Baker
Comment 3 2015-12-10 16:35:04 PST
Created attachment 267137 [details] [Image] New function popover UI
Timothy Hatcher
Comment 4 2015-12-10 16:46:37 PST
Comment on attachment 267136 [details] [Patch] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=267136&action=review Looks good! The indent of the function body being different from the title bothers me. You should also fix the escape key not working once you click in the function. > Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css:165 > + padding-top: 4px; This helps, but these popovers need more work in this area. > Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:1468 > + readOnly: "nocursor", Interesting, I didn't know this was an option! It must be new. We had to add this to the style sidebar to hide the cursor, when it seems we could use this now. .css-style-text-editor.read-only > .CodeMirror .CodeMirror-cursor { display: none; } > Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:1488 > + // CodeMirror needs a refresh after the popover displays, to layout, otherwise it doesn't appear. > + setTimeout(() => {codeMirror.refresh();}, 0); I think we should have spaces inside the { }. It would also be best if the Popover class had a hook or event to do this work instead of using a timeout. > Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:1493 > + // Once CodeMirror renders it's DOM tree, the popover frame size needs to be updated. > + codeMirror.on("update", () => { > + this._popover.update(); > + }); Does this lead to a visible resize after it shows?
Timothy Hatcher
Comment 5 2015-12-10 16:49:08 PST
Comment on attachment 267136 [details] [Patch] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=267136&action=review >> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:1468 >> + readOnly: "nocursor", > > Interesting, I didn't know this was an option! It must be new. We had to add this to the style sidebar to hide the cursor, when it seems we could use this now. > > .css-style-text-editor.read-only > .CodeMirror .CodeMirror-cursor { > display: none; > } Though, hiding the cursor in the way we did for the style sidebar still allows text selection and Command-A, which we want. We want to make sure those work here too. If readOnly: "nocursor" disables those features, we might want to take the CSS approach to hide the cursor instead and do readOnly: true here.
Matt Baker
Comment 6 2015-12-10 17:13:42 PST
(In reply to comment #5) > Comment on attachment 267136 [details] > [Patch] Proposed Fix > > View in context: > https://bugs.webkit.org/attachment.cgi?id=267136&action=review > > >> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:1468 > >> + readOnly: "nocursor", > > > > Interesting, I didn't know this was an option! It must be new. We had to add this to the style sidebar to hide the cursor, when it seems we could use this now. > > > > .css-style-text-editor.read-only > .CodeMirror .CodeMirror-cursor { > > display: none; > > } > > Though, hiding the cursor in the way we did for the style sidebar still > allows text selection and Command-A, which we want. We want to make sure > those work here too. If readOnly: "nocursor" disables those features, we > might want to take the CSS approach to hide the cursor instead and do > readOnly: true here. Text selection and Command-A work as long as CodeMirror has the focus. We can auto-focus it once the ESC to dismiss issue is resolved.
Devin Rousso
Comment 7 2016-09-05 20:48:01 PDT
This was fixed in r205223. *** This bug has been marked as a duplicate of bug 161417 ***
Note You need to log in before you can comment on or make changes to this bug.