<?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>18731</bug_id>
          
          <creation_ts>2012-08-29 00:42:12 +0000</creation_ts>
          <short_desc>[Custom]: custom element instantiation does not provide for an initialization method (aka lifecycle.created)</short_desc>
          <delta_ts>2012-08-30 21:32:25 +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>DUPLICATE</resolution>
          <dup_id>18747</dup_id>
          
          <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>18720</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Steve Orvell">sorvell</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>sjmiles</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72956</commentid>
    <comment_count>0</comment_count>
    <who name="Steve Orvell">sorvell</who>
    <bug_when>2012-08-29 00:42:12 +0000</bug_when>
    <thetext>A custom element should be able to do work on its shadow root. The Web Components explainer defines a lifecycle object partly for this purpose (http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html#lifecycle-methods). The lifecycle&apos;s created method is called with a reference to the shadow root.

The lifecycle object should likely be included in this spec, and calling the created method should be included in the custom element constructor generation algorithm, where element shadow root is made.

Note that the created method must be called for each shadow root made for the element (see https://www.w3.org/Bugs/Public/show_bug.cgi?id=18729 about how an element can have multiple shadow roots).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72957</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Miles">sjmiles</who>
    <bug_when>2012-08-29 00:47:56 +0000</bug_when>
    <thetext>At least, it seems a custom element needs an entry point to do set up work. Registrar does not get to supply a constructor, so we need some alternate initializer.

Like Steve says, ultimately this extends to wanting a &apos;lifecycle&apos; object, as in the WC Explainer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73029</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-29 23:04:30 +0000</bug_when>
    <thetext>Can I just hang &quot;created&quot; it off the Options object? Should the whole lifecycle object be a separate item in the Options?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73030</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Miles">sjmiles</who>
    <bug_when>2012-08-29 23:11:02 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Can I just hang &quot;created&quot; it off the Options object? Should the whole lifecycle
&gt; object be a separate item in the Options?

I&apos;m inclined to make it a separate object, but my perspective could be questionable. That is to say, I have an interest in keeping alignment with the declarative solution.

Also, the care and feeding of lifecycle is maybe another discussion. Specifically with regard to supporting &apos;protected&apos; API. One solution for that is to chain &apos;lifecycle&apos; to the extendee&apos;s &apos;lifecycle&apos;, making that object the home for &apos;protected&apos; methods. Another solution is to have some kind of private key on lifecycle.

In either case, I want to have an object to mess with.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73090</commentid>
    <comment_count>4</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-30 21:32:25 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 18747 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>