From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out.smtp-auth.no-ip.com (smtp-auth.no-ip.com [8.23.224.61]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 3AFB57914F for ; Tue, 6 Oct 2015 16:47:25 -0700 (PDT) X-No-IP: carhart.net@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from carhart.net (unknown [99.52.200.227]) (Authenticated sender: carhart.net@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 22C2F4018A7; Tue, 6 Oct 2015 16:51:02 -0700 (PDT) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id t96Np1VB022003; Tue, 6 Oct 2015 16:51:01 -0700 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id t96Np1Hk021975; Tue, 6 Oct 2015 16:51:01 -0700 Date: Tue, 6 Oct 2015 16:51:01 -0700 (PDT) From: Kevin Carhart To: Karl Dahlke cc: Edbrowse-dev@lists.the-brannons.com In-Reply-To: <20150906134334.eklhad@comcast.net> Message-ID: References: <20150906134334.eklhad@comcast.net> User-Agent: Alpine 2.03 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [Edbrowse-dev] setAttribute X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 23:47:25 -0000 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. >
> 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 > Edbrowse-dev@lists.the-brannons.com > http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev > -------- Kevin Carhart * 415 225 5306 * The Ten Ninety Nihilists