Hmmmm.
I was wondering "what is the difference between
the two techniques anyhow?"
When I go and check around for an answer to the question
"what is the difference between the two techniques anyhow?"
It seems like people are saying that dot notation is
actually preferred and is a superset of
setAttribute. So what if
our setAttribute implementation just did blah.prop = value
under the hood? Would that also obviate the side
effects question because now it would get back to
edbrowse just like any assignment would?
On Tue, 6 Oct 2015, Karl Dahlke wrote:
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
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev
--------
Kevin Carhart * 415 225 5306 * The Ten Ninety Nihilists
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev