Bug 1685421 - Part 2: Stop using NS_ERROR_DOM_HIERARCHY_REQUEST_ERR in nsINode; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D113344
This commit is contained in:
Edgar Chen
2021-06-02 13:43:39 +00:00
parent 8b357eac5b
commit 492d02e96b
40 changed files with 338 additions and 230 deletions

View File

@@ -179,17 +179,16 @@ void HTMLSelectElement::GetAutocompleteInfo(AutocompleteInfo& aInfo) {
attributeVal, aInfo, mAutocompleteInfoState, true);
}
nsresult HTMLSelectElement::InsertChildBefore(nsIContent* aKid,
nsIContent* aBeforeThis,
bool aNotify) {
void HTMLSelectElement::InsertChildBefore(nsIContent* aKid,
nsIContent* aBeforeThis, bool aNotify,
ErrorResult& aRv) {
int32_t index = aBeforeThis ? ComputeIndexOf(aBeforeThis) : GetChildCount();
SafeOptionListMutation safeMutation(this, this, aKid, index, aNotify);
nsresult rv = nsGenericHTMLFormElementWithState::InsertChildBefore(
aKid, aBeforeThis, aNotify);
if (NS_FAILED(rv)) {
nsGenericHTMLFormElementWithState::InsertChildBefore(aKid, aBeforeThis,
aNotify, aRv);
if (aRv.Failed()) {
safeMutation.MutationFailed();
}
return rv;
}
void HTMLSelectElement::RemoveChildNode(nsIContent* aKid, bool aNotify) {