Skip to content

Commit

Permalink
Bug 1556697 [wpt PR 17162] - custom-elements: Add a test for upgrade …
Browse files Browse the repository at this point in the history
…failure due to non-null shado…, a=testonly

Automatic update from web-platform-tests
HTML: test upgrade custom element failure due to disabledFeatures

Specification PR: whatwg/html#4673.
--

wp5At-commits: a3dcc65d854e242e61aeb1c68c26742cd278ea9a
wpt-pr: 17162

UltraBlame original commit: d029a500f958bb1754e910cabdb554615bd43064
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent ce842c1 commit 7d733ec
Showing 1 changed file with 178 additions and 0 deletions.
178 changes: 178 additions & 0 deletions testing/web-platform/tests/custom-elements/upgrading.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,15 @@
<
script
>
setup
(
{
allow_uncaught_exception
:
true
}
)
;
class
PredefinedCustomElement
extends
Expand Down Expand Up @@ -1893,6 +1902,175 @@
}
)
;
test
(
(
)
=
>
{
class
ShadowDisabledElement
extends
HTMLElement
{
static
get
disabledFeatures
(
)
{
return
[
'
shadow
'
]
;
}
}
let
error
=
null
;
window
.
addEventListener
(
'
error
'
e
=
>
{
error
=
e
.
error
;
}
{
once
:
true
}
)
;
let
element
=
document
.
createElement
(
'
shadow
-
disabled
'
)
;
element
.
attachShadow
(
{
mode
:
'
open
'
}
)
;
customElements
.
define
(
'
shadow
-
disabled
'
ShadowDisabledElement
)
;
customElements
.
upgrade
(
element
)
;
assert_false
(
element
instanceof
ShadowDisabledElement
'
Upgrading
should
fail
.
'
)
;
assert_true
(
error
instanceof
DOMException
)
;
assert_equals
(
error
.
name
'
NotSupportedError
'
)
;
}
'
If
definition
\
'
s
disable
shadow
is
true
and
element
\
'
s
shadow
root
is
'
+
'
non
-
null
then
throw
a
"
NotSupportedError
"
DOMException
.
'
)
;
<
/
script
Expand Down

0 comments on commit 7d733ec

Please sign in to comment.