Bug 1943179 - Add [[nodiscard]] to ContentIterator methods that return nsresult. r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D235361
This commit is contained in:
Jan-Niklas Jaeschke
2025-01-28 15:54:36 +00:00
parent 4e47d7a16d
commit d85b643e72
3 changed files with 41 additions and 25 deletions

View File

@@ -3539,7 +3539,11 @@ already_AddRefed<Element> HTMLEditor::GetSelectedElement(const nsAtom* aTagName,
}
PostContentIterator postOrderIter;
postOrderIter.Init(firstRange);
nsresult rv = postOrderIter.Init(firstRange);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return nullptr;
}
RefPtr<Element> lastElementInRange;
for (nsINode* lastNodeInRange = nullptr; !postOrderIter.IsDone();