edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] setAttribute
@ 2015-10-06 17:43 Karl Dahlke
  2015-10-06 23:51 ` Kevin Carhart
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2015-10-06 17:43 UTC (permalink / raw)
  To: Edbrowse-dev

Question - does the setAttribute() method need to have any side effects?
If not, then it need not be native.

Here's how I see it.
If all js all the time uses setAttribute to change js dom variables
that edbrowse would need to know about,
then yes it has to have a side effect, to pass the variable assignment
back to edbrowse.
But if ever js ever sets foo=bar directly,
and still this is something edbrowse needs to know about,
then edbrowse just has to check at run time,
and it's always checking, and since it is checking there is no need for
a setAttribute side effect.

Perhaps an example would clear up this mess.
When you submit a form you jump to the action attribute in the form tag.
	<form action=this.that.com>
All good but if js changes the action to somewhere else
	form.action="peanutbutter.com";
then that is where submit is suppose to go.
This must have happened somewhere, some time, because I programmed for this.
At time of submit, if js is active
I retrieve the action variable from js and go there,
if js is not active then I use the url in the html tag.
It's even exercised in jsrt.
I'm not relying on setAttribute to tell me that action has changed,
I check for it at time of submit.
I think in this case, or in some cases,
I just have to check the js variables at run time.

As I mentioned above, if I have to check variables at run time
then I'm going to check them,
and there's no real advantage of getting a heads up from setAttribute.

Well these are just the thoughts running around my head today.

Karl Dahlke

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-07  2:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06 17:43 [Edbrowse-dev] setAttribute Karl Dahlke
2015-10-06 23:51 ` Kevin Carhart
2015-10-07  0:10   ` Karl Dahlke
2015-10-07  2:26     ` Chris Brannon

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).