Skip to content

Commit 9eccd03

Browse files
committed
Bug 1950326 [wpt PR 50925] - DOM: createElement and createElementNS with scoped registries, a=testonly
Automatic update from web-platform-tests DOM: createElement and createElementNS with scoped registries For whatwg/dom#1341. -- wpt-commits: a52f97983743aae5fdd5172c9938b47743dc7146 wpt-pr: 50925 UltraBlame original commit: 78ef3074b0082c9e95d840a8010b34661973a847
1 parent ecf4531 commit 9eccd03

File tree

2 files changed

+1059
-10
lines changed

2 files changed

+1059
-10
lines changed

testing/web-platform/tests/custom-elements/revamped-scoped-registry/Document-createElement.tentative.html

+189-10
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@
104104
<
105105
script
106106
>
107+
/
108+
/
109+
Keep
110+
this
111+
~
112+
synchronized
113+
with
114+
Document
115+
-
116+
createElementNS
117+
"
118+
use
119+
strict
120+
"
121+
;
107122
const
108123
scopedRegistry
109124
=
@@ -257,6 +272,9 @@
257272
table
258273
:
259274
HTMLTableElement
275+
unknown
276+
:
277+
HTMLUnknownElement
260278
}
261279
;
262280
for
@@ -266,8 +284,10 @@
266284
in
267285
elements
268286
)
269-
assert_true
270-
(
287+
{
288+
const
289+
scopedElement
290+
=
271291
document
272292
.
273293
createElement
@@ -279,6 +299,10 @@
279299
scopedRegistry
280300
}
281301
)
302+
;
303+
assert_true
304+
(
305+
scopedElement
282306
instanceof
283307
elements
284308
[
@@ -287,15 +311,17 @@
287311
localName
288312
)
289313
;
290-
for
314+
assert_equals
291315
(
292-
const
293-
localName
294-
in
295-
elements
316+
scopedElement
317+
.
318+
customElements
319+
scopedRegistry
296320
)
297-
assert_true
298-
(
321+
;
322+
const
323+
globalExplicitElement
324+
=
299325
document
300326
.
301327
createElement
@@ -309,6 +335,41 @@
309335
customElements
310336
}
311337
)
338+
;
339+
assert_true
340+
(
341+
globalExplicitElement
342+
instanceof
343+
elements
344+
[
345+
localName
346+
]
347+
localName
348+
)
349+
;
350+
assert_equals
351+
(
352+
globalExplicitElement
353+
.
354+
customElements
355+
window
356+
.
357+
customElements
358+
)
359+
;
360+
const
361+
globalImplicitElement
362+
=
363+
document
364+
.
365+
createElement
366+
(
367+
localName
368+
)
369+
;
370+
assert_true
371+
(
372+
globalImplicitElement
312373
instanceof
313374
elements
314375
[
@@ -317,6 +378,17 @@
317378
localName
318379
)
319380
;
381+
assert_equals
382+
(
383+
globalImplicitElement
384+
.
385+
customElements
386+
window
387+
.
388+
customElements
389+
)
390+
;
391+
}
320392
}
321393
'
322394
createElement
@@ -325,7 +397,7 @@
325397
a
326398
builtin
327399
element
328-
regardles
400+
regardless
329401
of
330402
a
331403
custom
@@ -579,6 +651,113 @@
579651
'
580652
)
581653
;
654+
test
655+
(
656+
(
657+
)
658+
=
659+
>
660+
{
661+
const
662+
doc
663+
=
664+
new
665+
Document
666+
(
667+
)
668+
;
669+
const
670+
scopedElement
671+
=
672+
doc
673+
.
674+
createElement
675+
(
676+
"
677+
time
678+
"
679+
{
680+
customElements
681+
:
682+
scopedRegistry
683+
}
684+
)
685+
;
686+
assert_equals
687+
(
688+
scopedElement
689+
.
690+
namespaceURI
691+
null
692+
)
693+
;
694+
assert_equals
695+
(
696+
scopedElement
697+
.
698+
customElements
699+
scopedRegistry
700+
)
701+
;
702+
const
703+
abElement
704+
=
705+
doc
706+
.
707+
createElement
708+
(
709+
"
710+
a
711+
-
712+
b
713+
"
714+
{
715+
customElements
716+
:
717+
scopedRegistry
718+
}
719+
)
720+
;
721+
assert_equals
722+
(
723+
abElement
724+
.
725+
namespaceURI
726+
null
727+
)
728+
;
729+
assert_equals
730+
(
731+
abElement
732+
.
733+
customElements
734+
scopedRegistry
735+
)
736+
;
737+
assert_false
738+
(
739+
abElement
740+
instanceof
741+
ScopedABElement
742+
)
743+
;
744+
}
745+
'
746+
createElement
747+
on
748+
a
749+
non
750+
-
751+
HTML
752+
document
753+
should
754+
still
755+
handle
756+
registries
757+
correctly
758+
'
759+
)
760+
;
582761
<
583762
/
584763
script

0 commit comments

Comments
 (0)