diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 4511842d7905..5f7be03e652e 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -159,9 +159,9 @@ CustomElementCallback::CustomElementCallback( // CustomElementConstructor already_AddRefed CustomElementConstructor::Construct( - const char* aExecutionReason, ErrorResult& aRv) { - CallSetup s(this, aRv, aExecutionReason, - CallbackFunction::eRethrowExceptions); + ErrorResult& aRv, const char* aExecutionReason, + ExceptionHandling aExceptionHandling) { + CallSetup s(this, aRv, aExecutionReason, aExceptionHandling); JSContext* cx = s.GetContext(); if (!cx) { @@ -1068,8 +1068,8 @@ static void DoUpgrade(Element* aElement, CustomElementConstructor* aConstructor, ErrorResult& aRv) { // Rethrow the exception since it might actually throw the exception from the // upgrade steps back out to the caller of document.createElement. - RefPtr constructResult = - aConstructor->Construct("Custom Element Upgrade", aRv); + RefPtr constructResult = aConstructor->Construct( + aRv, "Custom Element Upgrade", CallbackFunction::eRethrowExceptions); if (aRv.Failed()) { return; } diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h index a95ba2f258ea..1b25aadf56bd 100644 --- a/dom/base/CustomElementRegistry.h +++ b/dom/base/CustomElementRegistry.h @@ -87,8 +87,9 @@ class CustomElementConstructor final : public CallbackFunction { MOZ_ASSERT(JS::IsConstructor(mCallback)); } - already_AddRefed Construct(const char* aExecutionReason, - ErrorResult& aRv); + already_AddRefed Construct( + ErrorResult& aRv, const char* aExecutionReason = nullptr, + ExceptionHandling aExceptionHandling = eReportExceptions); }; // Each custom element has an associated callback queue and an element is diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 65ad938e9bf3..3c96cb45bc88 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -9457,8 +9457,8 @@ static void DoCustomElementCreate(Element** aElement, Document* aDoc, NodeInfo* aNodeInfo, CustomElementConstructor* aConstructor, ErrorResult& aRv) { - RefPtr element = - aConstructor->Construct("Custom Element Create", aRv); + RefPtr element = aConstructor->Construct( + aRv, "Custom Element Create", CallbackFunction::eRethrowExceptions); if (aRv.Failed()) { return; }