Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML: test fieldset with shadow DOM and display: contents
See whatwg/html#3331
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...rendering/non-replaced-elements/the-fieldset-element-0/fieldset-div-display-contents.html
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,12 @@ | ||
<!DOCTYPE html> | ||
<title>fieldset and div with display: contents</title> | ||
<link rel=fieldset-foo-ref.html> | ||
<style> | ||
div { display: contents; } | ||
</style> | ||
<p>There should be a normal fieldset below with the legend "Foo".</p> | ||
<fieldset> | ||
<div> | ||
<legend>Foo</legend> | ||
</div> | ||
</fieldset> |
6 changes: 6 additions & 0 deletions
6
html/rendering/non-replaced-elements/the-fieldset-element-0/fieldset-foo-ref.html
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,6 @@ | ||
<!DOCTYPE html> | ||
<title>Reference with a fieldset and legend "Foo"</title> | ||
<p>There should be a normal fieldset below with the legend "Foo".</p> | ||
<fieldset> | ||
<legend>Foo</legend> | ||
</fieldset> |
28 changes: 28 additions & 0 deletions
28
html/rendering/non-replaced-elements/the-fieldset-element-0/fieldset-shadow-dom.html
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,28 @@ | ||
<!DOCTYPE html> | ||
<title>fieldset and shadow DOM</title> | ||
<link rel=fieldset-foo-ref.html> | ||
<p>There should be a normal fieldset below with the legend "Foo".</p> | ||
<template id="my-fieldset"> | ||
<fieldset><slot name="my-text"></slot></fieldset> | ||
</template> | ||
|
||
<my-fieldset> | ||
<legend slot="my-text">Foo</legend> | ||
</my-fieldset> | ||
|
||
<script> | ||
customElements.define('my-fieldset', | ||
class extends HTMLElement { | ||
constructor() { | ||
super(); | ||
|
||
const template = document.getElementById('my-fieldset'); | ||
const templateContent = template.content; | ||
|
||
this.attachShadow({mode: 'open'}).appendChild( | ||
templateContent.cloneNode(true) | ||
); | ||
} | ||
} | ||
); | ||
</script> |