Bug 1716714 - Insert text node as the first child r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D118130
This commit is contained in:
Kagami Sascha Rosylight 2021-06-17 10:02:57 +00:00
parent 293cc72753
commit d9d3b791d0

View File

@ -349,7 +349,8 @@ nsresult EditorBase::EnsureEmptyTextFirstChild() {
return NS_ERROR_UNEXPECTED;
}
IgnoredErrorResult ignoredError;
root->InsertChildBefore(newTextNode, nullptr, true, ignoredError);
root->InsertChildBefore(newTextNode, root->GetFirstChild(), true,
ignoredError);
MOZ_ASSERT(!ignoredError.Failed());
}