This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This bug is regarding an issue in the new evaluation of script tags in the DOM in the draft: http://w3c.github.io/webcomponents/explainer/ The document explains that the following code will add methods to a custom element: <element name="tick-tock-clock"> <script> ({ tick: function () { … } }); </script> </element> The document also explains that the following will declare decorator events: <decorator id="details-open"> <script> function clicked(event) { event.target.removeAttribute('open'); } [{selector: '#summary', type: 'click', handler: clicked}]; </script> The issue is that <script> tags currently don't evaluate the last statement of the code block. Either the issue is that this feature should be removed for something that is currently capable for example by exposing a new Element object: <element name="tick-tock-clock"> <script> Element.methods({ tick: function () { … } }); </script> </element> The alternative is that the custom element specification and the future decorator specification needs to explain how this functionality will operate. I would suggest also a separate specification to explain how this would work in the general case also, so future specifications can use the 'script interface' specification for example for future tag interfaces.
Thanks for the bug report. The <element> element has been removed from the spec, and no vendor is working to specify decorators now, so I am marking this as "wontfix". I'm working to update the Explainer to remove those sections now.