RESOLVED FIXED 127328
Web Inspector: Move the Popover code out of the Breakpoint model object
https://bugs.webkit.org/show_bug.cgi?id=127328
Summary Web Inspector: Move the Popover code out of the Breakpoint model object
Timothy Hatcher
Reported 2014-01-20 18:42:56 PST
The popover and DOM code in Breakpoint.js should move out and into a new class. This is a layering violation. Maybe BreakpointEditingController?
Attachments
[Patch] Proposed Fix (39.83 KB, patch)
2015-08-30 22:45 PDT, Matt Baker
no flags
[Patch] Proposed Fix (41.02 KB, patch)
2015-08-31 14:27 PDT, Matt Baker
no flags
[Patch] Proposed Fix (41.02 KB, patch)
2015-08-31 15:15 PDT, Matt Baker
no flags
Radar WebKit Bug Importer
Comment 1 2014-02-14 09:52:53 PST
Timothy Hatcher
Comment 2 2015-08-28 10:51:15 PDT
The context menu code should move too.
Matt Baker
Comment 3 2015-08-30 22:45:06 PDT
Created attachment 260275 [details] [Patch] Proposed Fix
Timothy Hatcher
Comment 4 2015-08-31 11:13:51 PDT
Comment on attachment 260275 [details] [Patch] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=260275&action=review Better, but I think this needs to be a controller that owns the Popover. > Source/WebInspectorUI/UserInterface/Views/BreakpointPopoverView.js:117 > + let popover = new WebInspector.Popover(); > + let popoverView = new WebInspector.BreakpointPopoverView(breakpoint, popover); > + popover.delegate = popoverView; > + popover.content = popoverView.element; It is a bit odd that BreakpointPopoverView takes the popover and then popover.content and popover.delegate end up pointing to popoverView. That makes BreakpointPopoverView more of a controller. That would likely let you internalize this. > Source/WebInspectorUI/UserInterface/Views/BreakpointPopoverView.js:297 > +WebInspector.BreakpointPopoverView.PopoverClassName = "edit-breakpoint-popover-content"; Any single use class names we have just been inlining them as strings.
Matt Baker
Comment 5 2015-08-31 11:50:08 PDT
(In reply to comment #4) > Comment on attachment 260275 [details] > [Patch] Proposed Fix > > View in context: > https://bugs.webkit.org/attachment.cgi?id=260275&action=review > > Better, but I think this needs to be a controller that owns the Popover. > > > Source/WebInspectorUI/UserInterface/Views/BreakpointPopoverView.js:117 > > + let popover = new WebInspector.Popover(); > > + let popoverView = new WebInspector.BreakpointPopoverView(breakpoint, popover); > > + popover.delegate = popoverView; > > + popover.content = popoverView.element; > > It is a bit odd that BreakpointPopoverView takes the popover and then > popover.content and popover.delegate end up pointing to popoverView. > > That makes BreakpointPopoverView more of a controller. That would likely let > you internalize this. Yeah this is pretty awkward. A controller class is better suited to this.
Matt Baker
Comment 6 2015-08-31 14:27:06 PDT
Created attachment 260317 [details] [Patch] Proposed Fix
Timothy Hatcher
Comment 7 2015-08-31 14:41:17 PDT
Comment on attachment 260317 [details] [Patch] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=260317&action=review Nice! > Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:50 > + this._breakpointPopoverController = new WebInspector.BreakpointPopoverController(); Drop the ().
Matt Baker
Comment 8 2015-08-31 15:15:04 PDT
Created attachment 260322 [details] [Patch] Proposed Fix
WebKit Commit Bot
Comment 9 2015-08-31 15:39:52 PDT
Comment on attachment 260322 [details] [Patch] Proposed Fix Clearing flags on attachment: 260322 Committed r189189: <http://trac.webkit.org/changeset/189189>
WebKit Commit Bot
Comment 10 2015-08-31 15:39:56 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.