Commit 01f3d8fa authored by Hixie's avatar Hixie

Specs: define registerElement() more carefully; add an 'end tag

parsed' callback; pass the element's module to the constructor when
constructing a custom element (these are rather experimental changes
and we may want to go a different way on this stuff)

Review URL: https://codereview.chromium.org/701873004
parent 44ac3530
...@@ -16,9 +16,9 @@ SKY MODULE - radio button and radio button group ...@@ -16,9 +16,9 @@ SKY MODULE - radio button and radio button group
module.exports.RadioElement = module.registerElement({ module.exports.RadioElement = module.registerElement({
tagName: 'radio', tagName: 'radio',
shadow: true, shadow: true,
prototype: class extends Element { prototype: (class extends Element {
constructor () { constructor (module) {
super(); super(module);
this.addEventListener('click', (event) => this.checked = true); this.addEventListener('click', (event) => this.checked = true);
this.shadowRoot.appendChild(module.document.findId('radio-shadow').content.cloneNode(true)); this.shadowRoot.appendChild(module.document.findId('radio-shadow').content.cloneNode(true));
} }
...@@ -42,7 +42,7 @@ SKY MODULE - radio button and radio button group ...@@ -42,7 +42,7 @@ SKY MODULE - radio button and radio button group
if (this.parentNode instanceof module.exports.RadioGroupElement) if (this.parentNode instanceof module.exports.RadioGroupElement)
this.parentNode.setChecked(this); this.parentNode.setChecked(this);
} }
}, }).prototype,
}); });
</script> </script>
...@@ -56,9 +56,9 @@ SKY MODULE - radio button and radio button group ...@@ -56,9 +56,9 @@ SKY MODULE - radio button and radio button group
module.exports.RadioGroupElement = module.registerElement({ module.exports.RadioGroupElement = module.registerElement({
tagName: 'radiogroup', tagName: 'radiogroup',
shadow: true, shadow: true,
prototype: class extends Element { prototype: (class extends Element {
constructor () { constructor (module) {
super(); super(module);
this.shadowRoot.appendChild(module.document.findId('radiogroup-shadow').content.cloneNode(true)); this.shadowRoot.appendChild(module.document.findId('radiogroup-shadow').content.cloneNode(true));
} }
get value () { get value () {
...@@ -85,6 +85,6 @@ SKY MODULE - radio button and radio button group ...@@ -85,6 +85,6 @@ SKY MODULE - radio button and radio button group
if (child != radio) if (child != radio)
child.checked = false; child.checked = false;
} }
}, }).prototype,
}); });
</script> </script>
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