lewisje / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

Problems tracking whether elements attached to document or not #536

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1  Create document fragment, remove it, add elements, add event listeners

What is the expected output? What do you see instead?
There are errors saying the elements cannot be found on the flash side.
Javascript thinks the element is attached but it is not.

The root cause is that there are a number of problems with the way we track 
whether elements are attached to a document. For example, there are two 
variables, _attached and _passThrough that mean the same thing but are subtly 
different and not updated consistently, and sometimes the existence of 
this._handler is used to decide whether the element is attached to the 
document.  Whether the flash is loaded or not is actually irrelevant to whether 
the elements are attached and so that causes problems. Also, there is a glitch 
with document fragments remaining attached after removal.

The proper way to handle this is to pick one flag (_attached), set it to false 
by default, and only set it to true when appended, or otherwise added to the 
document or retrieved from another node which is attached. When the element is 
initially created, we copy the flag from whatever relative (parent, child, 
sibling, etc) of the node we used to retrieve the node. If it is attached, the 
node is attached.

Original issue reported on code.google.com by grick23@gmail.com on 6 Aug 2010 at 5:48

GoogleCodeExporter commented 8 years ago
Fixed in r1214.

Original comment by grick23@gmail.com on 6 Aug 2010 at 5:51