summaryrefslogtreecommitdiffstats
path: root/layout/style/crashtests/1017798-1.html
diff options
context:
space:
mode:
Diffstat (limited to 'layout/style/crashtests/1017798-1.html')
-rw-r--r--layout/style/crashtests/1017798-1.html28
1 files changed, 14 insertions, 14 deletions
diff --git a/layout/style/crashtests/1017798-1.html b/layout/style/crashtests/1017798-1.html
index 097217d18..0460c8756 100644
--- a/layout/style/crashtests/1017798-1.html
+++ b/layout/style/crashtests/1017798-1.html
@@ -50,27 +50,27 @@ gaia_switch/examples/index.html from the Gaia repository.
window.GaiaSwitch = (function(win) {
// Extend from the HTMLElement prototype
- var proto = Object.create(HTMLElement.prototype);
+ class GaiaSwitch extends HTMLElement {
+ connectedCallback() {
+ var shadow = this.createShadowRoot();
+ this._template = template.content.cloneNode(true);
+ this._input = this._template.querySelector('input[type="checkbox"]');
+
+ var checked = this.getAttribute('checked');
+ if (checked !== null) {
+ this._input.checked = true;
+ }
- proto.createdCallback = function() {
- var shadow = this.createShadowRoot();
- this._template = template.content.cloneNode(true);
- this._input = this._template.querySelector('input[type="checkbox"]');
+ shadow.appendChild(this._template);
- var checked = this.getAttribute('checked');
- if (checked !== null) {
- this._input.checked = true;
+ ComponentUtils.style.call(this, '');
}
-
- shadow.appendChild(this._template);
-
- ComponentUtils.style.call(this, '');
};
/**
* Proxy the checked property to the input element.
*/
- Object.defineProperty( proto, 'checked', {
+ Object.defineProperty( GaiaSwitch.prototype, 'checked', {
get: function() {
return this._input.checked;
},
@@ -82,7 +82,7 @@ window.GaiaSwitch = (function(win) {
/**
* Proxy the name property to the input element.
*/
- Object.defineProperty( proto, 'name', {
+ Object.defineProperty( GaiaSwitch.prototype, 'name', {
get: function() {
return this.getAttribute('name');
},