This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21825 - [Custom]: Specify or comment on node adoption--does element initialization happen?
Summary: [Custom]: Specify or comment on node adoption--does element initialization ha...
Status: RESOLVED DUPLICATE of bug 20488
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14968
  Show dependency treegraph
 
Reported: 2013-04-25 08:38 UTC by Dominic Cooney
Modified: 2013-06-19 17:02 UTC (History)
0 users

See Also:


Attachments

Description Dominic Cooney 2013-04-25 08:38:30 UTC
The spec speaks to createElement, createElementNS, and tree construction during parsing. But DOM operations such as cloneNode, appendChild, adoptNode, etc. also create elements. Custom Elements should specify when lifecycle callbacks run in these cases.

If they don't run (assumed, given the status quo) some commentary about which DOM operations *won't* trigger lifecycle events would be useful to guide implementations and authors.
Comment 1 Dimitri Glazkov 2013-05-21 21:28:02 UTC
I am probably reading this wrong, but don't we only create new elements in cloneNode? I don't think appendChild or adoptNode do that.
Comment 2 Dominic Cooney 2013-06-07 04:34:51 UTC
(In reply to comment #1)
> I am probably reading this wrong, but don't we only create new elements in
> cloneNode? I don't think appendChild or adoptNode do that.

Ah... in legacy DOM appendChild may fall back to adoptNode if the node is in a different document, and adoptNode may fall back to doing importNode depending on implementations, and importNode creates an element.

In DOM4 it looks like that adoptNode->importNode fallback does not exist. Great. But we need to handle cloneNode and importNode. In fact, DOM4 has a concept for "clone"

<http://dom.spec.whatwg.org/#concept-node-clone>
Comment 3 Dimitri Glazkov 2013-06-19 17:02:48 UTC
Okay, then this is all bug 20488.

*** This bug has been marked as a duplicate of bug 20488 ***