Closed Bug 1642270 Opened 1 month ago Closed 1 month ago

Make `EditorBase::MaybeHasMutationEventListeners()` always return `true` on debug builds


(Core :: DOM: Editor, enhancement, P2)




Tracking Status
firefox79 --- fixed


(Reporter: masayuki, Assigned: masayuki)



(1 file)

For the performance reason, editor check DOM tree after changing DOM tree only when there are some mutation event listeners. That means that editor behavior shouldn't change only by whether there are mutation event listeners or not. So, we should test the complicated cases in debug build.

According to the telemetry data, almost all web apps in the word do not use
mutation event listeners, but if they are used, editor needs to check
whether modifying node is modified by web apps. The checking cost may not
cheap in some cases. Therefore, we check whether the window has at least one
mutation event listeners or not before non-cheap checking.

However, like actual web apps, most our mochitests and WPT do not add
mutation event listeners. Therefore, such additional checking code is not
tested even though they should work as exactly same as the case when
there are mutation event listeners but they don't touch the DOM.

This patch makes it always return only in debug build for checking the
complicated path.

Pushed by
Make `EditorBase::MaybeHasMutationEventListeners()` always return `true` in debug build for testing complicated path r=m_kato
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.