Closed Bug 1984312 Opened 10 months ago Closed 10 months ago

"Break on node removal" doesn't break when setting the parent node's innerHTML

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(firefox-esr115 wontfix, firefox-esr128 wontfix, firefox-esr140 wontfix, firefox142 wontfix, firefox143 wontfix, firefox144 fixed)

RESOLVED FIXED
144 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox-esr140 --- wontfix
firefox142 --- wontfix
firefox143 --- wontfix
firefox144 --- fixed

People

(Reporter: hbenl, Assigned: masayuki)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

STR:

Expected:

  • the debugger breaks in the onclick handler of the button

Actual:

  • the debugger doesn't break

I noticed this while investigating Bug 1982549 (and was able to work around it by selecting "Break on subtree modification" on the parent node).

While I'm removing the legacy DOM mutation events, I found this bug.

Assignee: nobody → masayuki
Severity: -- → S3
Status: NEW → ASSIGNED
OS: Unspecified → All
Hardware: Unspecified → All

Probably, regression of bug 1694548.

Keywords: regression
Regressed by: 1694548

Set release status flags based on info from the regressing bug 1694548

"Node Removal" of "Break on..." of DevTools listens to
"devtoolschildremoved" event which is dispatched immediately before
"DOMNodeRemoved" event by nsContentUtils::MaybeFireNodeRemoved().
However, some callers stops calling that if
nsContentUtils::HasMutationListeners() or
nsContentUtils::WantMutationEvents() return false, for example,
nsINode::ReplaceChildren() [1].

Therefore, they should return true if the type is
NS_EVENT_BITS_MUTATION_NODEREMOVED and DevTools is observing the
mutations.

As far as I've checked, there is no test of this feature. I guess it's
impossible due to breaking the running JS. Therefore, this patch does
not contain a new test.

  1. https://searchfox.org/firefox-main/rev/856a307913c2b73765b4e88d32cf15ed05549cae/dom/base/nsINode.cpp#2354-2356
Pushed by masayuki@d-toybox.com: https://github.com/mozilla-firefox/firefox/commit/696347b90f6b https://hg.mozilla.org/integration/autoland/rev/ab5fc5f25147 Make `nsContentUtils::HasMutationListeners()` and `nsContentUtils::WantMutationEvents()` be aware of DevTools r=smaug,dom-core
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: