Bug 140276

Summary: Web Inspector: Phantom breakpoint appears on empty line after reload of minified file with a breakpoint
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, msaboff, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[REDUCTION] Test Case
none
[PATCH] Proposed Fix none

Joseph Pecoraro
Reported 2015-01-08 18:00:41 PST
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.
Attachments
[REDUCTION] Test Case (2.00 KB, application/zip)
2015-01-08 18:00 PST, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (1.75 KB, patch)
2015-01-08 19:06 PST, Joseph Pecoraro
no flags
Radar WebKit Bug Importer
Comment 1 2015-01-08 18:01:40 PST
Joseph Pecoraro
Comment 2 2015-01-08 19:05:03 PST
I believe this to be a CodeMirror issue. Filed: https://github.com/codemirror/CodeMirror/issues/3023 However, I have a workaround for us.
Joseph Pecoraro
Comment 3 2015-01-08 19:06:12 PST
Created attachment 244314 [details] [PATCH] Proposed Fix
Timothy Hatcher
Comment 4 2015-01-08 19:45:49 PST
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.
Timothy Hatcher
Comment 5 2015-01-08 19:48:11 PST
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.
WebKit Commit Bot
Comment 6 2015-01-08 20:25:31 PST
Comment on attachment 244314 [details] [PATCH] Proposed Fix Clearing flags on attachment: 244314 Committed r178153: <http://trac.webkit.org/changeset/178153>
WebKit Commit Bot
Comment 7 2015-01-08 20:25:35 PST
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 8 2015-01-09 12:31:28 PST
(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.
Note You need to log in before you can comment on or make changes to this bug.