Wow! The cloneNode function, my version and your version, is really screwed up!
I couldn't see it until I turned the light on.
I added a cloneDebug variable, which if true, prints the cloning process as it 
happens.
Braces are used to indicate the level (depth) of cloning.
Set it true and try it on jsrt, which does a few simple clones, and you'll see 
what I mean.

We were cloning all the propertties in an object, including those inherited 
from prototype.
So we would copy over getElementsByTagName and other stock functions,
and maybe that won't break anything, but it sure is a waste.
I added hasOwnProperty to make sure we're cloning true members.

When copying arrays, we copied childNodes, and the things under childNodes,
but this was already handled as the children of the node, so we were copying it 
twice.
Don't know if that was a waste, or if it really broke things.

Your fixes brought nasa.gov back from one empty line to 23 lines, adding in my 
fixes brings it up to 53 lines.
But I'm still not warm and fuzzy.
We need to set cloneDebug and step through all the nodes that nasa is cloning 
and make sure we're really doing the right thing.
Form.elements for instance, that's a specific array with specific DOM meaning, 
those children that are input elements,
is that being cloned correctly?
I think so but not sure.

The nasa page has bullet items at the bottom, like Contact NASA, that are just 
text but are probably suppose to be links,
so not sure what is wrong there.

I changed == to === whenever typeof is involved,
but not sure we should do it globally, I'd have to check each one and see if we 
do or do not want type conversion.

Karl Dahlke
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to