Closed Bug 831008 Opened 12 years ago Closed 1 year ago

Disable Mutation Events in chrome/XUL

Categories

(Core :: DOM: Events, defect, P5)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: smaug, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I think we could start trying to get rid of mutation events. It is too early to remove them from content, but perhaps chrome is doable.
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3

Hi Masayuki, can you please investigate if we still have something to do? Thank you.

Flags: needinfo?(masayuki)

Adding code to make EventDispatcher stop dispatching legacy mutation events causes performance regressions.
https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=be77639da8710275f150c5b23a4658baa2bf0784&originalSignature=4586009&newSignature=4586009&framework=13&application=firefox&originalRevision=5d0f7fef10604ef28ec50abf311b24354152ce26&page=1&showOnlyImportant=1

Therefore, I think that what we can do here is that we can just make it check either a chrome document or a default handler is adding an event listener in EventListenerManager.

The legacy DOM mutation events shouldn't be used even in content and must not be
used in chrome.

This patch makes it crash if legacy mutation event listener is:

  • added to a node in a chrome document
  • added to a node in a native anonymous subtree
  • added to the system event group
  • implemented by C++

This causes some crash tests and chrome tests. Therefore, this patch modifies
them to use MutationObserver instead or removes them if it's impossible to
rewrite with MutationObserver.

Note that if I prevent to dispatch mutation events in some/all of the cases,
that causes performance regression in Speedometer3. Therefore, this patch
does not touch EventDispatcher.

Attachment #9340609 - Attachment description: Bug 831008 - Make `EventDispatcher` stop dispatching the legacy DOM mutation events in either chrome documents, native anonymous subtrees or the system event groups r=smaug! → Bug 831008 - Make `EventListenerManager` assert when a legacy DOM mutation event listener is added in either chrome documents, native anonymous subtrees or the system event groups r=smaug!
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/992d6e7accc8 Make `EventListenerManager` assert when a legacy DOM mutation event listener is added in either chrome documents, native anonymous subtrees or the system event groups r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Regressions: 1840567
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: