Closed Bug 1581213 Opened 5 years ago Closed 2 years ago

DOM Mutation Breakpoints: Disabling Mutation Breakpoint in the Debugger doesn't show checked context menu in inspector

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox108 fixed)

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: davidwalsh, Assigned: luke.swiderski, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: good-second-bug)

Attachments

(1 file)

STR:

  1. Create a DMB in the inspector via the context menu
  2. Go to the debugger, disable the DMB
  3. Go back to the inspector, right-click the node, go to "Break on..."

ER: The context menu item is still checked
AR: No context menu item is checked

Setting the same DMB type again enables the DMB.

Ideally the item would still be checked.

Adding this functionality would also allow us to show disabled state in the inspector.

I can still reproduce the problem marking as good second bug.

Honza

Whiteboard: good-second-bug

I’ve been investigating this bug. The function _getDOMBreakpointSubmenu(), line 506 in the file markup-context-menu.js uses “this.selection.nodeFront.mutationBreakpoints” to see if subtree, attribute, and removal are true or false. To fix this bug, it seems that it should also know if the breakpoints are enabled or not. I am stuck trying to figure out how to select the ‘enabled’ status properly from this file. I’ve been doing experiments and I can see that the “enabled” status is accessible. Writing statements in the console like “this.toolbox.store.getState();” returns an array of all the breakpoints, in which I see can the enabled status of each. Is there a simple way to select the enabled status for just the ‘node’ selected, similar to “this.selection.nodeFront.mutationBreakpoints?”

Luke, thank you for the analysis! You are going in the right direction.
Note that you can use BrowserToolbox to debug the DevTools UI Itelf
https://firefox-source-docs.mozilla.org/devtools-user/browser_toolbox/index.html

I think that you are looking for this function
https://searchfox.org/mozilla-central/rev/70cf6863bd85af2a3188ec1fe5209a3ec1b2de86/devtools/server/actors/inspector/walker.js#1952
(you can use the Browser Toolbox and set a breakpoint there)

Bomsy, where the this.selection.nodeFront.mutationBreakpoints is populated? Is it built by getMutationBreakpoint?

Here is the code where the object is used to build the context menu for the MarkupView (the Inspector panel)
https://searchfox.org/mozilla-central/rev/70cf6863bd85af2a3188ec1fe5209a3ec1b2de86/devtools/client/inspector/markup/markup-context-menu.js#508

Flags: needinfo?(hmanilla)

Add functionality to let inspector markup-context-menu remained checked when a
dom mutation breakpoint is disabled in the debugger.
Add disabled icon in inspector when a dom mutation breakpoint is disabled.
Add mochitests.

Assignee: nobody → luke.swiderski
Status: NEW → ASSIGNED
Severity: normal → S3
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5d4a11ac9d5d
Disabling dom mutation breakpoints in the debugger doesn't show checked context menu in the inspector r=jdescottes
Regressions: 1797644
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Regressions: 1863398
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: