[Bug 20397] [Custom]: Consider changing elementupgrade to a mutation observer

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

Dominic Cooney <dominicc@chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dominicc@chromium.org

--- Comment #10 from Dominic Cooney <dominicc@chromium.org> ---
I think you need to minimize the time between when the new element is inserted
into the DOM but the custom element’s code has not run.

Specifically, if that window is non-zero, JavaScript has to be prepared to
handle custom elements in *three* states: not upgraded, "half upgraded" (after
the DOM modification but before the notification), and upgraded. Handling a
third state will be tedious and confusing.

For this reason I think an upgrade event is better than a MutationObserver,
because we have more control over the timing of the upgrade event and can fire
it "immediately".

Such an event goes against the rationale for deprecating mutation events in
favor of MutationObservers in the first place–that the nesting of such events
is confusing, etc.

I believe that argument does not apply in this case, because the UA can control
when it fires upgrade events so that they are never nested.

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

Received on Monday, 17 December 2012 01:02:26 UTC