From: Kevin Carhart <kevin@carhart.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] return value from removeChild
Date: Thu, 22 Feb 2018 21:47:19 -0800 (PST) [thread overview]
Message-ID: <alpine.LRH.2.03.1802222137570.15866@carhart.net> (raw)
In-Reply-To: <20180122135418.eklhad@comcast.net>
I found some evidence that our removeChild function should return the
removed node to javascript, instead of returning undefined
A prominent library file includes this line:
a.removeChild(b).style.display = 'none';
So it's expecting something to be there.
And MDN talks about removeChild being called in two possible ways, one of
which returns the removed node:
var oldChild = node.removeChild(child);
"The removed child node still exists in memory, but is no longer part of
the DOM. With the first syntax-form shown, you may reuse the removed node
later in your code, via the oldChild object reference."
Could this be done by renaming removeChild to eb$rmcd in jseng-duk.c, and
then in startwindow maybe this?
mw0.removeChild = function(c) {
this.eb$rmcd(c);
return c;
}
The side effects are all nice and stable already, so leave them alone and
just deal with the change in what is returned to JS using a JS wrapper.
If this sounds OK, I'll turn this in.
thanks
Kevin
next prev parent reply other threads:[~2018-02-23 5:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 18:54 [Edbrowse-dev] hover Karl Dahlke
2018-02-23 5:47 ` Kevin Carhart [this message]
2018-02-23 6:05 ` [Edbrowse-dev] return value from removeChild Karl Dahlke
2018-02-23 6:17 ` Kevin Carhart
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=alpine.LRH.2.03.1802222137570.15866@carhart.net \
--to=kevin@carhart.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).