From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (mailfrom) identity=mailfrom; client-ip=8.23.224.62; helo=out.smtp-auth.no-ip.com; envelope-from=kevin@carhart.net; receiver= Received: from out.smtp-auth.no-ip.com (smtp-auth.no-ip.com [8.23.224.62]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 08EED77AFE for ; Sat, 19 Aug 2017 17:37:19 -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 99D5026D; Sat, 19 Aug 2017 17:37:35 -0700 (PDT) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id v7K0bYe0013269; Sat, 19 Aug 2017 17:37:34 -0700 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id v7K0bYRo013263; Sat, 19 Aug 2017 17:37:34 -0700 Date: Sat, 19 Aug 2017 17:37:33 -0700 (PDT) From: Kevin Carhart To: Karl Dahlke cc: Edbrowse-dev@lists.the-brannons.com In-Reply-To: <20170719200021.eklhad@comcast.net> Message-ID: References: <20170719113834.eklhad@comcast.net> <20170719200021.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] acid[0] 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: Sun, 20 Aug 2017 00:37:20 -0000 On Sat, 19 Aug 2017, Karl Dahlke wrote: > Not sure what querySelectorAll is all about; can't we just call document.getElementsByTagName()? It's a thing of its own. A lot of sites' JS uses this. For instance, in the nasa.gov code file vendor.js, e.querySelectorAll("[msallowcapture^='']") e.querySelectorAll("[selected]") e.querySelectorAll(":checked") a=r.querySelector("#morph-"+n) e.querySelectorAll("[id~="+q+"-]") e.querySelectorAll("a#"+q+"+*") The brackets, the hash and the colon have hardcoded meanings. And the syntax used here, I believe is the same selector syntax you find in CSS blocks. So at the least, there's also the period and the at symbol: .hidden { visibility: hidden; } @font-face { font-family: "AcidAhemTest"; src: url(font.ttf); } > So if an object says p.snork has bgcolor=white > then we get the array > a = document.getElementsByTagName("p"); > Loop over array and if obj.class == "snork" then obj.style.bgcolor = white. > Or if the descriptor is on #instructions rather than a class of nodes, we use getElementById to find the node and then set its values. > So I think we already have the middle third, and the last third seems reasonably easy to write. I don't rule out that this can be done. It depends if you want to dig in to the selectors language-within-a-language or use a component to hopefully avoid having to. If it's fun, that's good. If it's completely undesirable to learn a new mini syntax, maybe the outside component can do it for us. I think even if you wanted to do a certain thing within the implementation that called getElements, there would need to be a wrapper called querySel etc which is going to receive an argument beginning with a symbol. We can any kind of node math we want under the hood in order to select the results. It's definitely possible that you will know how to do it, so that it would turn out to be less work than bringing in the outside code. I don't know which of those is less work. Kevin