[Bug 23814] New: [Explainer]: Scoped evaluation of Script tag for custom elements and decorator events

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23814

            Bug ID: 23814
           Summary: [Explainer]: Scoped evaluation of Script tag for
                    custom elements and decorator events
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Component Model
          Assignee: dglazkov@chromium.org
          Reporter: jonathan@jooped.co.uk
        QA Contact: public-webapps-bugzilla@w3.org
            Blocks: 14949

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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 13 November 2013 13:30:09 UTC