Bug 1542932 align CustomElementConstructor::Construct() parameters with WebIDL bindings conventions r=bzbarsky

Depends on D26865

Differential Revision: https://phabricator.services.mozilla.com/D26866

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-04-10 15:25:15 +00:00
Родитель 26e9ce40c3
Коммит 99521124d0
3 изменённых файлов: 10 добавлений и 9 удалений

Просмотреть файл

@ -159,9 +159,9 @@ CustomElementCallback::CustomElementCallback(
// CustomElementConstructor
already_AddRefed<Element> 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<Element> constructResult =
aConstructor->Construct("Custom Element Upgrade", aRv);
RefPtr<Element> constructResult = aConstructor->Construct(
aRv, "Custom Element Upgrade", CallbackFunction::eRethrowExceptions);
if (aRv.Failed()) {
return;
}

Просмотреть файл

@ -87,8 +87,9 @@ class CustomElementConstructor final : public CallbackFunction {
MOZ_ASSERT(JS::IsConstructor(mCallback));
}
already_AddRefed<Element> Construct(const char* aExecutionReason,
ErrorResult& aRv);
already_AddRefed<Element> Construct(
ErrorResult& aRv, const char* aExecutionReason = nullptr,
ExceptionHandling aExceptionHandling = eReportExceptions);
};
// Each custom element has an associated callback queue and an element is

Просмотреть файл

@ -9457,8 +9457,8 @@ static void DoCustomElementCreate(Element** aElement, Document* aDoc,
NodeInfo* aNodeInfo,
CustomElementConstructor* aConstructor,
ErrorResult& aRv) {
RefPtr<Element> element =
aConstructor->Construct("Custom Element Create", aRv);
RefPtr<Element> element = aConstructor->Construct(
aRv, "Custom Element Create", CallbackFunction::eRethrowExceptions);
if (aRv.Failed()) {
return;
}