W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

[Bug 28546] New: document.registerElement should take a template as an argument

From: <bugzilla@jessica.w3.org>
Date: Wed, 22 Apr 2015 23:53:24 +0000
To: public-webapps@w3.org
Message-ID: <bug-28546-2927@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28546

            Bug ID: 28546
           Summary: document.registerElement should take a template as an
                    argument
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Component Model
          Assignee: dglazkov@chromium.org
          Reporter: rniwa@webkit.org
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org

https://lists.w3.org/Archives/Public/public-webapps/2013OctDec/0794.html

Given that many important/natural use cases of custom elements involve shadow
DOM, can we add a flag to auto-create shadow DOM for custom elements?

In particular, can we add "template" as the third argument to document.register
so that when a custom element is "instantiated", the specified template is
automatically closed and inserted into a shadow DOM of the custom element.

e.g. using ES6 class syntax:

<template id=myButtonTemplate>
<button>Hi!</button>
</template>
<script>
class MyButton extends HTMLElement {
...
}
document.registerElement('my-button', MyButton, myButtonTemplate);
</script>

Given that the shadow DOM specification is relatively stable if we constrain
ourselves to only custom elements (i.e. ignoring all builtin elements), adding
this mechanism will allow us to move the custom elements and shadow DOM
specifications forward without risking to expose the general API for attaching
shadow DOM to the Web.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 22 April 2015 23:53:26 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC