forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Add a basic test for Declarative Shadow DOM
(cherry picked from commit 7ce350b8c069c13540c50631413b2150bab967d4)
- Loading branch information
1 parent
83d0599
commit f1dcf56
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Tests/LibWeb/Text/expected/ShadowDOM/declarative-basic.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
open closed open open open [object ShadowRoot] | ||
0 | ||
null | ||
0 | ||
[object ShadowRoot] | ||
1 | ||
null | ||
0 | ||
[object ShadowRoot] | ||
0 | ||
|
||
|
||
|
||
<template shadowrootmode="open">open</template> | ||
|
||
|
||
<template shadowrootmode="open" shadowrootserializable="">open</template> | ||
|
||
|
||
|
||
|
||
|
||
<template shadowrootmode="open" shadowrootserializable="">open</template> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<div id="basicOpen"> | ||
<template shadowrootmode="open">open</template> | ||
</div> | ||
<div id="basicClosed"> | ||
<template shadowrootmode="closed">closed</template> | ||
</div> | ||
<div id="redundant"> | ||
<template shadowrootmode="open">open</template> | ||
<template shadowrootmode="open">also open</template> | ||
</div> | ||
<div id="basicOpenClonable"> | ||
<template shadowrootmode="open" shadowrootclonable>open</template> | ||
</div> | ||
<div id="basicOpenSerializable"> | ||
<template shadowrootmode="open" shadowrootserializable>open</template> | ||
</div> | ||
<script src="../include.js"></script> | ||
<script> | ||
test(() => { | ||
println(basicOpen.shadowRoot); | ||
println(basicOpen.childElementCount); | ||
|
||
println(basicClosed.shadowRoot); | ||
println(basicClosed.childElementCount); | ||
|
||
println(redundant.shadowRoot); | ||
println(redundant.childElementCount); | ||
|
||
let clonedUnclonable = basicOpen.cloneNode(); | ||
println(clonedUnclonable.shadowRoot); | ||
println(clonedUnclonable.childElementCount); | ||
|
||
let clonedClonable = basicOpenClonable.cloneNode(); | ||
println(clonedClonable.shadowRoot); | ||
println(clonedClonable.childElementCount); | ||
|
||
println(basicOpen.getHTML({ serializableShadowRoots: true})); | ||
println(basicOpen.getHTML({ shadowRoots: [ basicOpen.shadowRoot ]})); | ||
println(basicOpenSerializable.getHTML({ serializableShadowRoots: true})); | ||
println(basicOpenSerializable.getHTML({ serializableShadowRoots: false})); | ||
println(basicOpenSerializable.getHTML({ shadowRoots: [ basicOpenSerializable.shadowRoot ]})); | ||
}); | ||
</script> |