Bug 1612007. Add convenience methods for throwing various spec-defined DOMExceptions on ErrorResult. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D61202
This commit is contained in:
Boris Zbarsky
2020-01-29 09:09:11 +00:00
parent bc957e4f5a
commit a306daca09
3 changed files with 62 additions and 3 deletions

View File

@@ -83,8 +83,7 @@ already_AddRefed<DOMIntersectionObserver> DOMIntersectionObserver::Constructor(
observer->mRoot = aOptions.mRoot;
if (!observer->SetRootMargin(aOptions.mRootMargin)) {
aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
"rootMargin must be specified in pixels or percent.");
aRv.ThrowSyntaxError("rootMargin must be specified in pixels or percent.");
return nullptr;
}