Bug 1457689 - Fix documain.domain setting exception type; r=bz

Change exception type to comply with HTML spec, which uses security
error instead of bad document domain.

MozReview-Commit-ID: Iefkeskn9bM

--HG--
extra : rebase_source : 282507d687c8fe19a326df95632694bcc6c5dd29
This commit is contained in:
Kyle Machulis 2018-06-07 11:45:09 -07:00
parent 73c1f3e815
commit a50b3fa9e5
2 changed files with 2 additions and 6 deletions

View File

@ -1019,7 +1019,7 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
}
if (aDomain.IsEmpty()) {
rv.Throw(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN);
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
@ -1036,7 +1036,7 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
nsCOMPtr<nsIURI> newURI = RegistrableDomainSuffixOfInternal(aDomain, uri);
if (!newURI) {
// Error: illegal domain
rv.Throw(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN);
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}

View File

@ -1,4 +0,0 @@
[document_domain_setter.html]
[failed setting of document.domain]
expected: FAIL