edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] defaultView / cloning onevent$$array
Date: Thu, 25 Jan 2018 09:07:05 -0500	[thread overview]
Message-ID: <20180025090705.eklhad@comcast.net> (raw)
In-Reply-To: <alpine.LRH.2.03.1801250222330.9464@carhart.net>

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

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

  reply	other threads:[~2018-01-25 14:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 20:08 [Edbrowse-dev] Error Object Karl Dahlke
2018-01-19 20:51 ` Dominique Martinet
2018-01-25 10:48 ` [Edbrowse-dev] defaultView / cloning onevent$$array Kevin Carhart
2018-01-25 14:07   ` Karl Dahlke [this message]
2018-01-25 23:07     ` Kevin Carhart
2018-01-26  2:58       ` Karl Dahlke
2018-01-26  3:50         ` [Edbrowse-dev] nasa / prepending "on" to events Kevin Carhart
2018-01-26  4:59           ` Karl Dahlke
2018-01-26  5:51             ` Kevin Carhart
2018-01-26  6:43               ` Karl Dahlke
2018-01-26  8:10                 ` Kevin Carhart
2018-01-26  8:21                   ` Kevin Carhart
2018-01-26  9:08                     ` Karl Dahlke
2018-01-26 10:38                       ` Kevin Carhart
2018-01-26 14:32                         ` Karl Dahlke
2018-01-26 19:13                           ` Geoff McLane
2018-01-26 19:28                             ` Karl Dahlke
2018-01-27  3:52                           ` Kevin Carhart
2018-01-27 18:52                             ` Geoff McLane
2018-01-27 21:10                               ` Karl Dahlke
2018-01-28  3:12                               ` Karl Dahlke
2018-01-28 19:19                                 ` Geoff McLane
2018-01-28 21:35                                   ` Karl Dahlke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180025090705.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).