W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2015

Re: Custom Elements: "createdCallback" & cloning

From: Olli Pettay <olli@pettay.fi>
Date: Mon, 13 Jul 2015 12:42:12 +0300
Cc: WebApps WG <public-webapps@w3.org>
Message-ID: <55A387F4.5050308@pettay.fi>
On 07/13/2015 09:22 AM, Anne van Kesteren wrote:
> On Sun, Jul 12, 2015 at 9:32 PM, Olli Pettay <olli@pettay.fi> wrote:
>> Well, this printing case would just clone the final flattened tree without
>> the original document knowing any cloning happened.
>> (scripts aren't suppose to run in Gecko's static clone documents, which
>> print preview on linux and Windows and printing use)
>> If one needs a special DOM tree for printing, beforeprint event should be
>> used to modify the DOM.
> Sure, but you'd lose some stuff, e.g. <canvas>, and presumably custom
> elements if they require copying some state, due to the cloning.
> (Unless it's doing more than just cloning.)

Clone-for-printing takes a snapshot of canvas and animated images etc.

And what state from a custom element would be needed in static clone document?
If the state is there in original document, and the state is somehow affecting layout, it should be
copied (well, not :focus/:active and such).

Anyhow, I see clone-for-printing very much an implementation detail, and wouldn't be too worried about it here.
There is enough to worry with plain normal element.cloneNode(true); or selection/range handling.

Received on Monday, 13 July 2015 09:42:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:57 UTC