WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
189308
Web Inspector: REGRESSION: breakpoint context menu appears twice in DOM tree
https://bugs.webkit.org/show_bug.cgi?id=189308
Summary
Web Inspector: REGRESSION: breakpoint context menu appears twice in DOM tree
Devin Rousso
Reported
2018-09-05 10:05:10 PDT
Created
attachment 348933
[details]
[Image] Screenshot of Issue .
Attachments
[Image] Screenshot of Issue
(47.21 KB, image/png)
2018-09-05 10:05 PDT
,
Devin Rousso
no flags
Details
Patch
(2.93 KB, patch)
2018-09-05 10:07 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Patch
(2.07 KB, patch)
2018-09-13 23:56 PDT
,
Devin Rousso
joepeck
: review+
Details
Formatted Diff
Diff
Patch
(1.61 KB, patch)
2018-09-15 11:04 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Devin Rousso
Comment 1
2018-09-05 10:07:35 PDT
Created
attachment 348934
[details]
Patch
Blaze Burg
Comment 2
2018-09-05 11:45:48 PDT
Comment on
attachment 348934
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=348934&action=review
> Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js:262 > + excludeBreakpointItems: treeElement.statusImageElement.contains(event.target),
Can you explain this logic a little bit? Or, the regression...
Devin Rousso
Comment 3
2018-09-05 11:55:29 PDT
Comment on
attachment 348934
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=348934&action=review
>> Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js:262 >> + excludeBreakpointItems: treeElement.statusImageElement.contains(event.target), > > Can you explain this logic a little bit? Or, the regression...
If you contextmenu on the breakpoint icon that's shown in the DOM tree, a few different items get added to the contextmenu: ``` Break on... > ---------- Disable Breakpoints Delete Breakpoints ``` The `WI.DOMTreeOutline`, however, also tries to add some contextmenu items, since it also always wants to provide a way to set breakpoints on a DOM node. As such, an additional item gets added: ``` Break on... > ---------- Disable Breakpoints Delete Breakpoints ---------- Break on... > ``` Notice that the second "Break on... >" gets added by the `WI.DOMTreeOutline`. This patch just detects if the contextmenu came from the breakpoint icon in the DOM tree, and if so, prevents the `WI.DOMTreeOutline` from adding it's own breakpoint items.
Joseph Pecoraro
Comment 4
2018-09-11 17:33:21 PDT
Comment on
attachment 348934
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=348934&action=review
>>> Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js:262 >>> + excludeBreakpointItems: treeElement.statusImageElement.contains(event.target), >> >> Can you explain this logic a little bit? Or, the regression... > > If you contextmenu on the breakpoint icon that's shown in the DOM tree, a few different items get added to the contextmenu: > > ``` > Break on... > > ---------- > Disable Breakpoints > Delete Breakpoints > ``` > > The `WI.DOMTreeOutline`, however, also tries to add some contextmenu items, since it also always wants to provide a way to set breakpoints on a DOM node. As such, an additional item gets added: > > ``` > Break on... > > ---------- > Disable Breakpoints > Delete Breakpoints > ---------- > Break on... > > ``` > > Notice that the second "Break on... >" gets added by the `WI.DOMTreeOutline`. This patch just detects if the contextmenu came from the breakpoint icon in the DOM tree, and if so, prevents the `WI.DOMTreeOutline` from adding it's own breakpoint items.
Seems this could be done in another way. We could put a symbol / flag on the ContextMenu to say whether or not we've added breakpoint items: appendBreakpointItems(contextMenu, ...) { if (contextMenu.__hasBreakpointItems) return; contextMenu.__hasBreakpointItems = true; ... } Then no matter how many times this gets called, we only add breakpoint items once.
Devin Rousso
Comment 5
2018-09-13 23:56:17 PDT
Created
attachment 349741
[details]
Patch
Joseph Pecoraro
Comment 6
2018-09-14 14:44:39 PDT
Comment on
attachment 349741
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=349741&action=review
r=me
> Source/WebInspectorUI/UserInterface/Controllers/DOMBreakpointTreeController.js:52 > + if (contextMenu[WI.DOMBreakpointTreeController._contextMenuItemsAddedSymbol]) > + return; > + > + contextMenu[WI.DOMBreakpointTreeController._contextMenuItemsAddedSymbol] = true;
I still prefer the double underscore approach. It's just cheaper (a symbol doesn't need to exist at all times) and simpler in my opinion (no need to jump around code and its easy to read).
Devin Rousso
Comment 7
2018-09-15 11:04:06 PDT
Created
attachment 349859
[details]
Patch
WebKit Commit Bot
Comment 8
2018-09-15 11:42:06 PDT
Comment on
attachment 349859
[details]
Patch Clearing flags on attachment: 349859 Committed
r236033
: <
https://trac.webkit.org/changeset/236033
>
WebKit Commit Bot
Comment 9
2018-09-15 11:42:07 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10
2018-09-15 11:43:26 PDT
<
rdar://problem/44490747
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug