Commit 5482eece authored by Hixie's avatar Hixie

Docs: Update radio.sky to use the specced API for shadow roots

Review URL: https://codereview.chromium.org/692563003
parent 3f008050
...@@ -14,7 +14,7 @@ SKY MODULE - radio button and radio button group ...@@ -14,7 +14,7 @@ SKY MODULE - radio button and radio button group
module.exports.RadioElement = sky.registerElement('radio', class extends Element { module.exports.RadioElement = sky.registerElement('radio', class extends Element {
constructor () { constructor () {
this.addEventListener('click', (event) => this.checked = true); this.addEventListener('click', (event) => this.checked = true);
this.createShadowTree().appendChild(module.document.findId('radio-shadow').content.cloneNode(true)); this.addShadowRoot(new sky.ShadowRoot(module.document.findId('radio-shadow').content.cloneNode(true)));
} }
get checked () { get checked () {
return this.hasAttribute('checked'); return this.hasAttribute('checked');
...@@ -48,7 +48,7 @@ SKY MODULE - radio button and radio button group ...@@ -48,7 +48,7 @@ SKY MODULE - radio button and radio button group
<script> <script>
module.exports.RadioGroupElement = sky.registerElement('radiogroup', class extends Element { module.exports.RadioGroupElement = sky.registerElement('radiogroup', class extends Element {
constructor () { constructor () {
this.createShadowTree().appendChild(module.document.findId('radiogroup-shadow').cloneNode(true)); this.addShadowRoot(new sky.ShadowRoot(module.document.findId('radiogroup-shadow').content.cloneNode(true)));
} }
get value () { get value () {
let children = this.getChildNodes(); let children = this.getChildNodes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment