Created attachment 244311 [details] [REDUCTION] Test Case * SUMMARY Phantom breakpoint appears on empty line after reload of minified file with a breakpoint. * STEPS TO REPRODUCE 1. Inspect attached test case 2. Select resource "foo.min.js" 3. Pretty print the resource 4. Set a breakpoint on line 6 (console.log("test")) 5. Reload the page => in "foo.min.js" there are now 2 breakpoints, 1 is a phantom * NOTES - There appears to be some significance that the minified file has a newline at the end. Removing the newline didn't cause the phantom to appear. - After steps, removing and resetting a breakpoint has further issues. There may be yet another bug here.
<rdar://problem/19421470>
I believe this to be a CodeMirror issue. Filed: https://github.com/codemirror/CodeMirror/issues/3023 However, I have a workaround for us.
Created attachment 244314 [details] [PATCH] Proposed Fix
Comment on attachment 244314 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=244314&action=review > Source/WebInspectorUI/UserInterface/Views/TextEditor.js:115 > + this._codeMirror.removeLineClass(0, "wrap"); _codeMirror.removeLineClass is a weird API. I had to look up what this meant. I thought the class was "wrap", but that is the element. No class removes all classes.
Comment on attachment 244314 [details] [PATCH] Proposed Fix Who is setting the style before content loads? That seems like a bug too. I assume they set the breakpoints again after content loads.
Comment on attachment 244314 [details] [PATCH] Proposed Fix Clearing flags on attachment: 244314 Committed r178153: <http://trac.webkit.org/changeset/178153>
All reviewed patches have been landed. Closing bug.
(In reply to comment #5) > Comment on attachment 244314 [details] > [PATCH] Proposed Fix > > Who is setting the style before content loads? That seems like a bug too. I > assume they set the breakpoints again after content loads. SourceCodeTextEditor in "_contentWillPopulate" pushes its breakpoints down to TextEditor. TextEditor, being none the wiser, attempts to set line styles for those breakpoints despite the editor being empty. That path could bail early. There are also line styles for the current execution line, I did not see how that would get set in relation to loading of content. I assume it would also have this issue. FWIW, CodeMirror fixed the issue upstream.