Skip to content

Commit

Permalink
Bug 1415761 - Catch the exception and rethrow it after invoking custo…
Browse files Browse the repository at this point in the history
…m elements reactions; r=bz

The spec was unclear on how CEReactions interact with thrown exceptions; see whatwg/html#3217.
The spec is now being clarified in whatwg/html#3235.

MozReview-Commit-ID: 521HprTRS7k

UltraBlame original commit: df3695afb47e0598e3fb1425a7e2a0d16adf35ee
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent 1b13735 commit 956b486
Show file tree
Hide file tree
Showing 6 changed files with 471 additions and 1 deletion.
75 changes: 74 additions & 1 deletion dom/base/CustomElementRegistry.h
Expand Up @@ -2661,18 +2661,65 @@ final
{
public
:
explicit
/
/
JSContext
is
allowed
to
be
a
nullptr
if
we
are
guaranteeing
that
we
'
re
/
/
not
doing
something
that
might
throw
but
not
finish
reporting
a
JS
/
/
exception
during
the
lifetime
of
the
AutoCEReaction
.
AutoCEReaction
(
CustomElementReactionsStack
*
aReactionsStack
JSContext
*
aCx
)
:
mReactionsStack
(
aReactionsStack
)
mCx
(
aCx
)
{
mReactionsStack
-
Expand All @@ -2687,6 +2734,28 @@ AutoCEReaction
(
)
{
Maybe
<
JS
:
:
AutoSaveExceptionState
>
ases
;
if
(
mCx
)
{
ases
.
emplace
(
mCx
)
;
}
mReactionsStack
-
>
Expand All @@ -2703,6 +2772,10 @@ CustomElementReactionsStack
>
mReactionsStack
;
JSContext
*
mCx
;
}
;
}
Expand Down
1 change: 1 addition & 0 deletions dom/base/nsDocument.cpp
Expand Up @@ -36933,6 +36933,7 @@ GetDocGroup
CustomElementReactionsStack
(
)
aCx
)
;
/
Expand Down
1 change: 1 addition & 0 deletions dom/bindings/Codegen.py
Expand Up @@ -61473,6 +61473,7 @@
emplace
(
reactionsStack
cx
)
;

Expand Down
1 change: 1 addition & 0 deletions parser/html/nsHtml5TreeOperation.cpp
Expand Up @@ -2509,6 +2509,7 @@ GetDocGroup
CustomElementReactionsStack
(
)
nullptr
)
;
nsCOMPtr
Expand Down
56 changes: 56 additions & 0 deletions testing/web-platform/meta/MANIFEST.json
Expand Up @@ -1955791,6 +1955791,40 @@ custom
-
elements
/
reactions
/
with
-
exceptions
.
html
"
:
[
[
"
/
custom
-
elements
/
reactions
/
with
-
exceptions
.
html
"
{
}
]
]
"
custom
-
elements
/
upgrading
.
html
Expand Down Expand Up @@ -3628005,6 +3628039,28 @@ custom
-
elements
/
reactions
/
with
-
exceptions
.
html
"
:
[
"
b72ee82a3d98c61683e62c4834f54269898e12d5
"
"
testharness
"
]
"
custom
-
elements
/
resources
/
custom
Expand Down

0 comments on commit 956b486

Please sign in to comment.