mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1657270 - part 5: Guarantee that AutoEmptyBlockAncestorDeleter
did nothing if it returns "not handled" or an error at the caller r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85999
This commit is contained in:
parent
76b257fb0f
commit
0b7819addd
@ -2460,8 +2460,9 @@ EditActionResult HTMLEditor::HandleDeleteSelectionInternal(
|
||||
}
|
||||
|
||||
if (startPoint.GetContainerAsContent()) {
|
||||
AutoEditorDOMPointChildInvalidator lockOffset(startPoint);
|
||||
|
||||
#ifdef DEBUG
|
||||
nsMutationGuard debugMutation;
|
||||
#endif // #ifdef DEBUG
|
||||
AutoEmptyBlockAncestorDeleter deleter;
|
||||
if (deleter.ScanEmptyBlockInclusiveAncestor(
|
||||
*this, MOZ_KnownLive(*startPoint.GetContainerAsContent()),
|
||||
@ -2473,6 +2474,9 @@ EditActionResult HTMLEditor::HandleDeleteSelectionInternal(
|
||||
return result;
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(!debugMutation.Mutated(0),
|
||||
"AutoEmptyBlockAncestorDeleter shouldn't modify the DOM tree "
|
||||
"if it returns not handled nor error");
|
||||
}
|
||||
|
||||
// Test for distance between caret and text that will be deleted
|
||||
|
Loading…
Reference in New Issue
Block a user