Web Inspector: REGRESSION: breakpoint context menu appears twice in DOM tree
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Sep 2018 18:41:58 +0000 (18:41 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Sep 2018 18:41:58 +0000 (18:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189308

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DOMBreakpointTreeController.js:
(WI.DOMBreakpointTreeController.appendBreakpointContextMenuItems):
Set a symbol on the `contextMenu` to ensure that the same items are not added twice.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236033 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DOMBreakpointTreeController.js

index c1eaf99..37c3181 100644 (file)
@@ -1,3 +1,14 @@
+2018-09-15  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: REGRESSION: breakpoint context menu appears twice in DOM tree
+        https://bugs.webkit.org/show_bug.cgi?id=189308
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Controllers/DOMBreakpointTreeController.js:
+        (WI.DOMBreakpointTreeController.appendBreakpointContextMenuItems):
+        Set a symbol on the `contextMenu` to ensure that the same items are not added twice.
+
 2018-09-14  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Source View doesn't scroll to show line when breakpoint is hit inside of <script> in HTML resource
index 9e8aba7..0af27d4 100644 (file)
@@ -46,6 +46,11 @@ WI.DOMBreakpointTreeController = class DOMBreakpointsTreeController extends WI.O
     {
         console.assert(WI.domDebuggerManager.supported);
 
+        if (contextMenu.__domBreakpointItemsAdded)
+            return;
+
+        contextMenu.__domBreakpointItemsAdded = true;
+
         let subMenu = contextMenu.appendSubMenuItem(WI.UIString("Break on…"));
 
         let breakpoints = WI.domDebuggerManager.domBreakpointsForNode(domNode);