From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (mailfrom) identity=mailfrom; client-ip=8.23.224.60; helo=out.smtp-auth.no-ip.com; envelope-from=kevin@carhart.net; receiver= Received: from out.smtp-auth.no-ip.com (out.smtp-auth.no-ip.com [8.23.224.60]) by hurricane.the-brannons.com (Postfix) with ESMTPS id E2B9B77DE5 for ; Mon, 14 Aug 2017 17:48:51 -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 38EE7305; Mon, 14 Aug 2017 17:48:57 -0700 (PDT) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id v7F0msnT017620; Mon, 14 Aug 2017 17:48:54 -0700 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id v7F0mrCU017614; Mon, 14 Aug 2017 17:48:54 -0700 Date: Mon, 14 Aug 2017 17:48:53 -0700 (PDT) From: Kevin Carhart To: Karl Dahlke cc: Edbrowse-dev@lists.the-brannons.com In-Reply-To: <20170714023552.eklhad@comcast.net> Message-ID: References: <20170713214236.kevin@carhart.net > <20170714023552.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] defaultView and getComputedStyle patch X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.24 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2017 00:48:52 -0000 I think I've read mixed messages on what needs to be there, and that's why I ended up with something redundant. It's confusing at the source. I think last year I had the getComputedStyle returning a CSSStyleDeclaration object, not just one of its properties. I changed it yesterday because this usage: document.defaultView.getComputedStyle(penultimate, '').whiteSpace Suggests to me that the return value from getComputedStyle needs to be solely the CSSStyleDeclaration.style. I was getting an error from the test #0 code yesterday when I returned the object, because I am off by one hop. .whiteSpace exists, but it is located at CSSStyleDeclaration.style.whiteSpace. I ended up with a muddle because I don't know which to do. The documentation for window.getComputedStyle says "The returned style is a live CSSStyleDeclaration object, which updates itself automatically when the element's style is changed." Automatic updating is what the test is about I think. But do we have to code something extra to make it work that way? So here is a way of turning this into a specific question. Is there a common thing in OOP where, if you just address the object on its own, it is the same as calling a particular method that has been designated as the default? I don't remember the name for this but I feel like it exists. And the thing that would resolve what to do would be if this expression: .getComputedStyle(penultimate, '').whiteSpace Would actually reroute you under the hood to: .getComputedStyle(penultimate, '').getPropertyValue(whiteSpace) That's what I want to do - designate getPropertyValue to be the method that runs if nothing has been specified. Is this a getter? Is this a familiar idiom to anyone? thanks Kevin On Mon, 14 Aug 2017, Karl Dahlke wrote: > I went ahead and pushed this patch because it does no harm and moves you forward, but it still confuses me. > Your getComputedStyle function at line 759 is equivalent to > > function getComputedStyle(e, p) { return e.style; } > > The obj variable is local and goes away when the function returns. > So why not write it my way it's a whole lot easier to understand. Unless I'm missing something. > > 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