Is cloneNode guaranteed to run synchronously?
Reported by
lennart....@gmail.com,
Dec 18 2017
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36 Steps to reproduce the problem: 1. I copy a DOM tree with elt.cloneNode(true) 2. I upload of the cloned node to a database. (After some manipulation.) What is the expected behavior? I need to know if cloneNode is ready. What went wrong? I do not know when cloneNode is ready. I am asking for some documentation about if it is synchronous or not. If it is async I would be glad for an example of how to handle that. Did this work before? N/A Chrome version: 63.0.3239.108 Channel: stable OS Version: 10.0 Flash Version: This is a request for documentation. See also this question on StackOverflow: https://stackoverflow.com/questions/47860142/is-elt-clonenodetrue-synchronous
,
Dec 18 2017
,
Dec 18 2017
Hm, this is a request for documentation. What would a test file look like? 🤔 All i need is something like "The cloned node copy is completely ready when element.cloneNode(true) returns." Or something else that tells me what the rules are.
,
Dec 18 2017
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 18 2017
,
Dec 19 2017
,
Dec 20 2017
This is the document (spec) that describes how cloneNode() should behave: https://dom.spec.whatwg.org/#dom-node-clonenode https://dom.spec.whatwg.org/#concept-node-clone To answer your question, when you obtain the returned value (which is a cloned node), the clone operation should be complete, and synchronous. Do you have any test case that demonstrates Blink's implementation exposes any asynchronity, please file a new bug with a test case.
,
Dec 20 2017
Thanks, that saves me a lot of trouble. :-) I'm a bit surprised that you refer to whatwg, but I am pleased not having to read the W3C spec. Since you refer to whatwg I tried to search for documentation about innerHTML and async/sync there. I just wanted to compare documentation since I have noticed innerHTML is async (sometimes). I would be glad for comments about that too.
,
Sep 19
I am really sorry to reopen this issue, but it still not clear to me: Where does the spec define it as synchronous? I have read it, yet I could not find it crystal clear in this regard. The case I am interested in is for an ImageElement node. When cloneNode returns, should the new object be loaded and fully functional? e.g., possible to draw in a canvas. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by vamshi.k...@techmahindra.com
, Dec 18 2017Labels: Needs-Triage-M63 Triaged-ET Needs-Feedback