From 6deb3233842cf4d1dbb72c5f23fce5fd38f6a667 Mon Sep 17 00:00:00 2001 From: sadick254 Date: Wed, 28 Jul 2021 18:55:15 +0300 Subject: [PATCH] Use customElement for the specs document.register element will be deprecated on chrome bundled with electron 11. This makes it impossible to upgrade --- spec/text-editor-component-spec.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index 0bfa5b45d..960f6d52d 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -18,15 +18,15 @@ const SAMPLE_TEXT = fs.readFileSync( 'utf8' ); -document.registerElement('text-editor-component-test-element', { - prototype: Object.create(HTMLElement.prototype, { - attachedCallback: { - value: function() { - this.didAttach(); - } - } - }) -}); +class DummyElement extends HTMLElement { + connectedCallback() { + this.didAttach(); + } +} + +window.customElements.define('text-editor-component-test-element', DummyElement) + +document.createElement('text-editor-component-test-element') const editors = []; let verticalScrollbarWidth, horizontalScrollbarHeight;