W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: Custom element lifecycle callbacks

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Fri, 09 Jan 2015 06:29:18 -0500
Message-ID: <54AFBB8E.3000705@mit.edu>
To: Anne van Kesteren <annevk@annevk.nl>
CC: WebApps WG <public-webapps@w3.org>
On 1/9/15 4:28 AM, Anne van Kesteren wrote:
> On Thu, Jan 8, 2015 at 5:54 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>>    var input = document.createElement("input");
>>    input.value = "file:///etc/passwd";
>>    var newInput = input.cloneNode();
>>    newInput.type = "file";
>>
> Note that in the above example cloning callbacks would happen after
> the cloneNode() call but still before type is being set. So that might
> be okay?

Ok, what about this testcase:

   var parent = document.createElement("x-my-element");
   var input = document.createElement("input");
   parent.appendChild(input);
   input.value = "file:///etc/passwd";
   parent.cloneNode(true);

and then in the cloning callback for x-my-element, assuming "newNode" is 
the clone:

   newNode.firstChild.type = "file";

That seems to me like it would do the type set before the cloning 
callback for the input runs, right?

-Boris
Received on Friday, 9 January 2015 11:29:49 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC