<?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>18533</bug_id>
          
          <creation_ts>2012-08-10 22:57:09 +0000</creation_ts>
          <short_desc>[Custom]: When to fire upgrade events</short_desc>
          <delta_ts>2012-08-28 20:08:42 +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="Dimitri Glazkov">dglazkov</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>dominicc</cc>
    
    <cc>sorvell</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72065</commentid>
    <comment_count>0</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-10 22:57:09 +0000</bug_when>
    <thetext>When an element definition is upgraded, should we fire an event for:

a) each specific instance upgrade -- seems like too much
b) when upgrade of all elements to a specific definition is complete
c) when all upgrades of all known definitions are complete?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72068</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-10 23:23:35 +0000</bug_when>
    <thetext>From sorvell@:

What about doing it like the - o so cool - mutation observers?

You get a single event containing a list of upgraded component definitions. Then perhaps if we end up supporting lazy loading component definitions, you&apos;d get the same event with the new list of upgraded components.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72094</commentid>
    <comment_count>2</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-08-13 03:31:02 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; When an element definition is upgraded, should we fire an event for:
&gt; 
&gt; a) each specific instance upgrade -- seems like too much

In theory the component itself could provide hooks in its constructor to provide a callback, or dispatch a custom event on itself.

&gt; b) when upgrade of all elements to a specific definition is complete

I can’t really think of the use case for this. When would you want to do this?

&gt; c) when all upgrades of all known definitions are complete?

This would be useful because at that point you can detect errors, if any elements you expected to be upgraded have not been upgraded. Does it make sense to expose a nodelist of elements needing upgrade?

(In reply to comment #1)
&gt; From sorvell@:
&gt; 
&gt; What about doing it like the - o so cool - mutation observers?
&gt; 
&gt; You get a single event containing a list of upgraded component definitions.
&gt; Then perhaps if we end up supporting lazy loading component definitions, you&apos;d
&gt; get the same event with the new list of upgraded components.

I think the crucial datum in the proposed event is relating the old element with the upgraded replacement. So I think one of the mutations (removal or insertion) would need an extra property indicating the replacement/replaced element.

I think a new kind of mutation isn’t desirable because it would be nice if something using Mutation Observers to look for any kind of change doesn’t need to map an &quot;upgrade&quot; mutation to a removal and insertion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72903</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-28 19:51:53 +0000</bug_when>
    <thetext>(In reply to comment #2)

&gt; &gt; b) when upgrade of all elements to a specific definition is complete
&gt; 
&gt; I can’t really think of the use case for this. When would you want to do this?

To know when you can use an element of this type.

&gt; 
&gt; &gt; c) when all upgrades of all known definitions are complete?
&gt; 
&gt; This would be useful because at that point you can detect errors, if any
&gt; elements you expected to be upgraded have not been upgraded. Does it make sense
&gt; to expose a nodelist of elements needing upgrade?

To detect errors, hook b to track each definition, then look in c to ensure all are good. Right?

&gt; 
&gt; (In reply to comment #1)
&gt; &gt; From sorvell@:
&gt; &gt; 
&gt; &gt; What about doing it like the - o so cool - mutation observers?
&gt; &gt; 
&gt; &gt; You get a single event containing a list of upgraded component definitions.
&gt; &gt; Then perhaps if we end up supporting lazy loading component definitions, you&apos;d
&gt; &gt; get the same event with the new list of upgraded components.
&gt; 
&gt; I think the crucial datum in the proposed event is relating the old element
&gt; with the upgraded replacement. So I think one of the mutations (removal or
&gt; insertion) would need an extra property indicating the replacement/replaced
&gt; element.
&gt; 
&gt; I think a new kind of mutation isn’t desirable because it would be nice if
&gt; something using Mutation Observers to look for any kind of change doesn’t need
&gt; to map an &quot;upgrade&quot; mutation to a removal and insertion.

it sounds like you&apos;re saying &quot;is&quot; desirable, not &quot;isn&apos;t&quot;. Can you explain this a bit more?

For now, I am just wiring two simple events for b and c. We can revisit when we have actual stuff to play with in Mozilla and WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72906</commentid>
    <comment_count>4</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-28 20:08:42 +0000</bug_when>
    <thetext>Filed bug 18721 to track c. B is already spec&apos;d as elementupgrade event.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>