|
1 | | -import loadingAttributePolyfill from '../dist/loading-attribute-polyfill.module.js'; |
2 | | - |
3 | 1 | // Test for dynamically inserted images and iframes |
4 | 2 | let addDynamicContent = (event) => { |
5 | 3 | let divElement = document.createElement('div'), |
@@ -35,26 +33,6 @@ document |
35 | 33 | .querySelector('button.add-dynamic-content') |
36 | 34 | .addEventListener('click', addDynamicContent); |
37 | 35 |
|
38 | | -// See https://html.spec.whatwg.org/multipage/indices.html#element-interfaces |
39 | | -// for the list of other DOM interfaces. |
40 | | -class LoadingImages extends HTMLImageElement { |
41 | | - constructor() { |
42 | | - super(); // Always call super() first in the constructor. |
43 | | - // Call for preparing the sample image element included the latest |
44 | | - loadingAttributePolyfill.prepareElement(this); |
45 | | - } |
46 | | -} |
47 | | - |
48 | | -customElements.define('loading-image', LoadingImages, { extends: 'img' }); |
49 | | - |
50 | | -// See https://html.spec.whatwg.org/multipage/indices.html#element-interfaces |
51 | | -// for the list of other DOM interfaces. |
52 | | -class LoadingIframes extends HTMLIFrameElement { |
53 | | - constructor() { |
54 | | - super(); // Always call super() first in the constructor. |
55 | | - // Call for preparing the sample iframe element included the latest |
56 | | - loadingAttributePolyfill.prepareElement(this); |
57 | | - } |
58 | | -} |
59 | | - |
60 | | -customElements.define('loading-iframe', LoadingIframes, { extends: 'iframe' }); |
| 36 | +// Importing the two files which show how to register these elements as custom elements builtin extends |
| 37 | +import 'loading-attribute-polyfill.custom-builtin-extend.image.js'; |
| 38 | +import 'loading-attribute-polyfill.custom-builtin-extend.iframe.js'; |
0 commit comments