Bug 135517 - Web Inspector: breakpoint resolved state should not depend on all breakpoints being enabled
Summary: Web Inspector: breakpoint resolved state should not depend on all breakpoints...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brian Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-08-01 12:09 PDT by Brian Burg
Modified: 2014-08-06 23:23 PDT (History)
4 users (show)

See Also:


Attachments
Patch (15.72 KB, patch)
2014-08-06 17:05 PDT, Brian Burg
joepeck: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2014-08-01 12:09:47 PDT
The breakpoint model consults WebInspector.debuggerManager.breakpointsEnabled, which prevents this invariant from being true.

Breakpoint.resolved should not be used as a crutch for styling breakpoint widgets.
Comment 1 Radar WebKit Bug Importer 2014-08-01 12:10:36 PDT
<rdar://problem/17887540>
Comment 2 Brian Burg 2014-08-06 12:55:51 PDT
Even with fixing breakpoint.resolved digging into DebuggerManager, this is stil not true.

There are several places where we set breakpoint.resolved = true|false temporarily, but don't detach or reattach a sourceCode to the location.
Comment 3 Brian Burg 2014-08-06 17:05:48 PDT
Created attachment 236153 [details]
Patch
Comment 4 Joseph Pecoraro 2014-08-06 17:26:33 PDT
Comment on attachment 236153 [details]
Patch

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

r=me assuming those lines just need to be swapped. If not, then this probably needs another patch.

> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:310
> +            breakpoint.sourceCodeLocation.sourceCode = sourceCodeLocation.sourceCode;
> +            var sourceCodeLocation = this._sourceCodeLocationFromPayload(location);

Err, something seems aloof here. Did the lines get swapped or is "sourceCodeLocation" coming from somewhere else in line 309 making line 310 unnecessary?

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:389
> +        for (breakpoint of breakpoints)

Needs "var breakpoint" or you'll leak a global.
Comment 5 Brian Burg 2014-08-06 17:32:18 PDT
Comment on attachment 236153 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:310
>> +            var sourceCodeLocation = this._sourceCodeLocationFromPayload(location);
> 
> Err, something seems aloof here. Did the lines get swapped or is "sourceCodeLocation" coming from somewhere else in line 309 making line 310 unnecessary?

oops, you are right. It used to be hoisted outside the if.

>> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:389
>> +        for (breakpoint of breakpoints)
> 
> Needs "var breakpoint" or you'll leak a global.

I <3 JavaScript. Maybe.
Comment 6 Brian Burg 2014-08-06 23:23:30 PDT
Committed r172204: <http://trac.webkit.org/changeset/172204>