New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 795620 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Is cloneNode guaranteed to run synchronously?

Reported by lennart....@gmail.com, Dec 18 2017

Issue description

UserAgent: 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
 
Cc: vamshi.k...@techmahindra.com
Labels: Needs-Triage-M63 Triaged-ET Needs-Feedback
"Thanks for filing the issue!

@Reporter: Could you please share a sample test file with consistent reproducible steps which helps us to triage the issue in a better way from TE end."

Comment 2 by s...@chromium.org, Dec 18 2017

Components: -Services>Sync
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.
Project Member

Comment 4 by sheriffbot@chromium.org, Dec 18 2017

Labels: -Needs-Feedback
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
Labels: Documentation
Components: Blink>DOM

Comment 7 by kochi@chromium.org, Dec 20 2017

Status: WontFix (was: Unconfirmed)
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.
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.
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