edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Kevin Carhart <kevin@carhart.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] nasa / prepending "on" to events
Date: Thu, 25 Jan 2018 21:51:04 -0800 (PST)	[thread overview]
Message-ID: <alpine.LRH.2.03.1801252110350.27769@carhart.net> (raw)
In-Reply-To: <20180025235944.eklhad@comcast.net>



You didn't make it up, I think it originated with me and I was wrong.  I 
apologize for getting it wrong.  It may have had to do with the fact that 
we didn't have things like showscripts, the ^> export, and demin yet.  It 
has gotten a lot easier to isolate a situation in order to gather better 
evidence and do mini-experiments where you vary only one thing in order to 
nail down a cause.

>From MDN and other sources, I think the only two situations where "on" is 
present should be:
- on inline handlers in html (not what we're dealing with in startwindow)
- and in attachEvent, where the correct syntax is to pass in "onblah"

I don't think we ever have to convert "blah" to "onblah".
If "onblah" is passed in, the event to respond to is going to be "blah"
If "blah" is passed in, the event to respond to is going to be "blah"

One usage example is in the script vendor.js from nasa.gov, at 4883-4885 
if you run demin:

             return n !== L && 9 === n.nodeType && n.documentElement ? (L = 
n, S = n.documentElement, r = n.defaultView, r && r !== r.top && 
(r.addEventListener ? r.addEventListener('unload', Ae, !1) : r.attachEvent 
&& r.attachEvent('onunload', Ae)), x = !_(n), y.attributes = i(function 
(e) {

attachEvent is being called with 'onunload' but I think the intention is 
that the future event to listen for to would be 'unload'

addEventListener is being called with 'unload' and the event to listen for 
will be 'unload'

I also have a few illustrative lines that are how I got on cloneNode and 
events in the first place over the past few days and also in December. 
It's 5739, 5740 and 5741 if you demin vendor.js.  However, 5739 is still 
a chunk even after demin, because there is a long line with 
comma-separated items.  But here is the relevant portion:

t.attachEvent && (t.attachEvent('onclick', function () {
                 re.noCloneEvent = !1;
             }), t.cloneNode(!0).click()), null == re.deleteExpando) {

attachEvent is being called with 'onclick' to add a handler to t.
And then immediately after this, it runs a line with multiple things 
daisy-chained:

t.cloneNode(!0).click()

So cloneNode runs and the result from this is an element, call it tcn. 
It lives in memory and hasn't been assigned.
Then it runs [that result element].click()

So assuming that this sample extrapolates to something more general, is 
this useful as a way of knowing the kind of phrasing we're supposed to be 
covering?

My assumption is that if t.addEventHandler had been used instead of 
t.attachEvent, it would have said

t.addEventHandler('click' ......

And the second line would have been the same,

t.cloneNode(!0).click()

Thank you Karl.  The way to put a positive spin on this is that the new 
diagnostics makes it possible to write this email and be more specific.

  reply	other threads:[~2018-01-26  5:50 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
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 [this message]
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=alpine.LRH.2.03.1801252110350.27769@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).