<?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>21641</bug_id>
          
          <creation_ts>2013-04-09 18:58:43 +0000</creation_ts>
          <short_desc>[Custom]: Consider firing insertedCallback when Custom Element is upgraded when already inserted in dom.</short_desc>
          <delta_ts>2013-04-30 21:34:36 +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>FIXED</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>18720</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Steve Orvell">sorvell</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>bugs</cc>
    
    <cc>dominicc</cc>
    
    <cc>sjmiles</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85817</commentid>
    <comment_count>0</comment_count>
    <who name="Steve Orvell">sorvell</who>
    <bug_when>2013-04-09 18:58:43 +0000</bug_when>
    <thetext>I believe there is now agreement that the spec should include inserted/removedCallbacks that are fired when a custom element is inserted/removed from dom.

We may want to fire the insertedCallback when a custom element is upgraded when already in dom.

Assume, for example, a developer wants to add event listeners when a custom element is inserted. If we do not call inserted on upgrade, the developer is forced to write boilerplate code in readyCallback that checks if the element is already in dom and calls the same code as the insertedCallback would.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85818</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Miles">sjmiles</who>
    <bug_when>2013-04-09 19:08:32 +0000</bug_when>
    <thetext>I agree we need this for the reasons given.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85823</commentid>
    <comment_count>2</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-04-09 19:19:09 +0000</bug_when>
    <thetext>Why do we need a special notification when element is inserted/removed from DOM?
We have MutationObserver for that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85842</commentid>
    <comment_count>3</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2013-04-10 06:20:41 +0000</bug_when>
    <thetext>I support this change. This simplifies the state machine which controls whether I should start doing actions (animation, retrieving stuff, event listening, etc.) and stop doing actions.

Olli: It seems unfortunate to for custom element authors to use MutationObservers for this. All created custom elements will need to register mutation observers over the entire document to see whether one of their elements is inserted anywhere.

It seems much more efficient for implementations and simpler for authors if the UA provides these callbacks. I *think* it is fine for the callbacks to be timed to the microtask like a MutationObserver to avoid the pathologies of MutationEvents.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85858</commentid>
    <comment_count>4</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-04-10 10:43:01 +0000</bug_when>
    <thetext>Ok, I guess I need to see actual proposal how this would work before commenting more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87050</commentid>
    <comment_count>5</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-04-30 21:34:36 +0000</bug_when>
    <thetext>https://dvcs.w3.org/hg/webcomponents/rev/cd964833d307</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>