mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1591417: part 2) Rename HasMutationEventListeners
to MaybeHasMutationEventListeners
. r=masayuki
After removing all mutation event listeners, the corresponding method still returns `true`, so the new name is more accurate. Differential Revision: https://phabricator.services.mozilla.com/D52342 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e5f7410403
commit
c4342625ea
@ -211,7 +211,9 @@ class EditorBase : public nsIEditor,
|
||||
nsPIDOMWindowInner* GetInnerWindow() const {
|
||||
return mDocument ? mDocument->GetInnerWindow() : nullptr;
|
||||
}
|
||||
bool HasMutationEventListeners(
|
||||
// @param aMutationEventType One or multiple of NS_EVENT_BITS_MUTATION_*.
|
||||
// @return true, iff at least one of NS_EVENT_BITS_MUTATION_* is set.
|
||||
bool MaybeHasMutationEventListeners(
|
||||
uint32_t aMutationEventType = 0xFFFFFFFF) const {
|
||||
if (!mIsHTMLEditorClass) {
|
||||
// DOM mutation event listeners cannot catch the changes of
|
||||
|
@ -3930,7 +3930,7 @@ MoveNodeResult HTMLEditor::MoveOneHardLineContents(
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
|
||||
"DeleteNodeWithTransaction() failed, but ignored");
|
||||
result.MarkAsHandled();
|
||||
if (HasMutationEventListeners()) {
|
||||
if (MaybeHasMutationEventListeners()) {
|
||||
// Mutation event listener may make `offset` value invalid with
|
||||
// removing some previous children while we call
|
||||
// `DeleteNodeWithTransaction()` so that we should adjust it here.
|
||||
@ -3997,7 +3997,7 @@ MoveNodeResult HTMLEditor::MoveNodeOrChildren(
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return MoveNodeResult(rv);
|
||||
}
|
||||
if (HasMutationEventListeners()) {
|
||||
if (MaybeHasMutationEventListeners()) {
|
||||
// Mutation event listener may make `offset` value invalid with
|
||||
// removing some previous children while we call
|
||||
// `DeleteNodeWithTransaction()` so that we should adjust it here.
|
||||
|
@ -3235,9 +3235,10 @@ nsresult HTMLEditor::DeleteParentBlocksWithTransactionIfEmpty(
|
||||
|
||||
// If we have mutation event listeners, the next point is now outside of
|
||||
// editing host or editing hos has been changed.
|
||||
if (HasMutationEventListeners(NS_EVENT_BITS_MUTATION_NODEREMOVED |
|
||||
NS_EVENT_BITS_MUTATION_NODEREMOVEDFROMDOCUMENT |
|
||||
NS_EVENT_BITS_MUTATION_SUBTREEMODIFIED)) {
|
||||
if (MaybeHasMutationEventListeners(
|
||||
NS_EVENT_BITS_MUTATION_NODEREMOVED |
|
||||
NS_EVENT_BITS_MUTATION_NODEREMOVEDFROMDOCUMENT |
|
||||
NS_EVENT_BITS_MUTATION_SUBTREEMODIFIED)) {
|
||||
Element* editingHost = GetActiveEditingHost();
|
||||
if (NS_WARN_IF(!editingHost) ||
|
||||
NS_WARN_IF(editingHost != wsObj.GetEditingHost())) {
|
||||
|
Loading…
Reference in New Issue
Block a user