Bug 1783402 - part 3: Make result of unsafe getter methods of EditorDOMPointBase templated r=m_kato

Differential Revision: https://phabricator.services.mozilla.com/D153842
This commit is contained in:
Masayuki Nakano
2022-08-09 01:43:24 +00:00
parent eb8aafe328
commit 830bd376e2
22 changed files with 425 additions and 396 deletions

View File

@@ -742,8 +742,8 @@ nsresult HTMLEditor::HTMLWithContextInserter::Run(
if (pointToInsert.IsInTextNode()) {
const SplitNodeResult splitNodeResult =
mHTMLEditor.SplitNodeDeepWithTransaction(
MOZ_KnownLive(*pointToInsert.ContainerAsContent()), pointToInsert,
SplitAtEdges::eAllowToCreateEmptyContainer);
MOZ_KnownLive(*pointToInsert.ContainerAs<nsIContent>()),
pointToInsert, SplitAtEdges::eAllowToCreateEmptyContainer);
if (splitNodeResult.isErr()) {
NS_WARNING("HTMLEditor::SplitNodeDeepWithTransaction() failed");
return splitNodeResult.unwrapErr();
@@ -835,7 +835,7 @@ HTMLEditor::HTMLWithContextInserter::InsertContents(
const RefPtr<const Element> maybeNonEditableBlockElement =
pointToInsert.IsInContentNode()
? HTMLEditUtils::GetInclusiveAncestorElement(
*pointToInsert.ContainerAsContent(),
*pointToInsert.ContainerAs<nsIContent>(),
HTMLEditUtils::ClosestBlockElement)
: nullptr;