and this is why XHTML... On Friday, August 21, 2015, Domenic Denicola <[email protected]> wrote:
> From: es-discuss [mailto:[email protected] <javascript:;>] > On Behalf Of James Burke > > > > In the spirit of the extensible web, defining these lower level APIs and > more > > of the loader would make it possible to use custom elements to help > > prototype a <module> tag. The custom element mechanism can be used in a > > similar way to how JS transpilers are used for the existing module > syntax. > > No, custom elements cannot prototype the module tag, because custom > elements will always be parsed as unknown elements. So e.g. > > ```html > <custom-module> > const stuff = "<p>Stuff</p>"; > </custom-module> > ``` > > will be parsed as > > ``` > custom-module > |- text node: const stuff = " > |- p > |---- text node: Stuff > | - text node: "; > ``` > > and of course it gets much worse if you use any elements that do something > visual or interesting, like `<img>` or `<custom-module>` or `<script>`. > > This is why we need to use an existing parsed-as-is element (namely > `<script>`, although I guess we could maybe make `<style>` work in a > pinch), and why custom elements won't work. > > _______________________________________________ > es-discuss mailing list > [email protected] <javascript:;> > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

