Skip to content

Commit

Permalink
HTML: test fieldset with shadow DOM and display: contents
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan committed Aug 23, 2018
1 parent 1333462 commit 69e18d0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
@@ -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>
@@ -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>
@@ -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>

0 comments on commit 69e18d0

Please sign in to comment.