mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1460509 - part 5: Make TextEditRules::CreateTrailingBRIfNeeded() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: CNTgECam862 --HG-- extra : rebase_source : 633d729868f9cb6a287c45f98497e45a08ef2c95
This commit is contained in:
parent
349bf14f6b
commit
849d638e49
@ -1412,6 +1412,9 @@ TextEditRules::CreateTrailingBRIfNeeded()
|
||||
lastChild->AsElement()->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
|
||||
NS_LITERAL_STRING("_moz"),
|
||||
true);
|
||||
if (NS_WARN_IF(!CanHandleEditAction())) {
|
||||
return NS_ERROR_EDITOR_DESTROYED;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ protected:
|
||||
/**
|
||||
* Creates a trailing break in the text doc if there is not one already.
|
||||
*/
|
||||
nsresult CreateTrailingBRIfNeeded();
|
||||
MOZ_MUST_USE nsresult CreateTrailingBRIfNeeded();
|
||||
|
||||
/**
|
||||
* Creates a bogus <br> node if the root element has no editable content.
|
||||
|
Loading…
Reference in New Issue
Block a user