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 (smtp-auth.no-ip.com [8.23.224.60]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 0800A77893 for ; Fri, 23 Feb 2018 02:09:02 -0800 (PST) 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 47E2634B for ; Fri, 23 Feb 2018 02:10:07 -0800 (PST) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id w1NAA4C5032339 for ; Fri, 23 Feb 2018 02:10:04 -0800 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id w1NAA2TS032213 for ; Fri, 23 Feb 2018 02:10:03 -0800 Date: Fri, 23 Feb 2018 02:10:01 -0800 (PST) From: Kevin Carhart To: Edbrowse-dev@lists.the-brannons.com In-Reply-To: <20180123023656.eklhad@comcast.net> Message-ID: References: <20180123023656.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] id not unique X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.25 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 10:09:03 -0000 edbrowse is on fire, seriously. At this point in the story of the inventor who discovers antigravity or cold fusion, someone pays them a visit in an unmarked car. What ensues is either not very pleasant, or they are offered a million dollars. (Or both.) On Fri, 23 Feb 2018, Karl Dahlke wrote: > I'm pretty sure I read, in multiple places, that the id=foo attribute was suppose to be unique across the document. >
> In support of this notion, there is the function document.getElementById("foo") which returns that node. > It's not elementsById, like getElementsByTagName and the others, this one is singular, > the only one that is singular in the group, because there is one node per id. > However ... here we go ... > www.ibm.com has many overloads, which show up with db3. > There are 4

headings. > edbrowse currently returns the last one via getElementById("ibm-section-h2"), > while document["ibm-section-h2"] points to the first one. > Inconsistent, yes, but I didn't thing this was suppose to happen at all so I didn't plan for it. > More fallout: when I was trying to process all the css descriptors, and building hash tables etc, > I optimized #foo to grab the one and only node returned by getElemenById(). That's wrong. > That code isn't being used right now, so querySelectorAll("#ibm-section-h2") returns all 4 nodes, which is correct. > If I move forward and process at least some of the css at document load time, I need to bear this in mind. > Not really saying theres a bug or problem here, just thinking out loud. > > Karl Dahlke > _______________________________________________ > Edbrowse-dev mailing list > Edbrowse-dev@lists.the-brannons.com > http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev > ---