<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23814</bug_id>
          
          <creation_ts>2013-11-13 13:30:04 +0000</creation_ts>
          <short_desc>[Explainer]: Scoped evaluation of Script tag for custom elements and decorator events</short_desc>
          <delta_ts>2014-01-20 01:57:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>14949</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Kingston">jonathan</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>dominicc</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96234</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Kingston">jonathan</who>
    <bug_when>2013-11-13 13:30:04 +0000</bug_when>
    <thetext>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:
&lt;element name=&quot;tick-tock-clock&quot;&gt;
  &lt;script&gt;
    ({
      tick: function () {
        …
      }
    });
  &lt;/script&gt;
&lt;/element&gt;

The document also explains that the following will declare decorator events:
&lt;decorator id=&quot;details-open&quot;&gt;
    &lt;script&gt;
        function clicked(event) {
            event.target.removeAttribute(&apos;open&apos;);
        }
        [{selector: &apos;#summary&apos;, type: &apos;click&apos;, handler: clicked}];
    &lt;/script&gt;


The issue is that &lt;script&gt; tags currently don&apos;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:
&lt;element name=&quot;tick-tock-clock&quot;&gt;
  &lt;script&gt;
    Element.methods({
      tick: function () {
        …
      }
    });
  &lt;/script&gt;
&lt;/element&gt;

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 &apos;script interface&apos; specification for example for future tag interfaces.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98754</commentid>
    <comment_count>1</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2014-01-20 01:57:48 +0000</bug_when>
    <thetext>Thanks for the bug report. The &lt;element&gt; element has been removed from the spec, and no vendor is working to specify decorators now, so I am marking this as &quot;wontfix&quot;. I&apos;m working to update the Explainer to remove those sections now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>