From mboxrd@z Thu Jan 1 00:00:00 1970 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 3050F77ACE for ; Sun, 16 Jun 2019 09:25:00 -0700 (PDT) X-No-IP: carhart.net@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from carhart.net (unknown [99.57.137.251]) (Authenticated sender: carhart.net@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id D8CEC37FC2B for ; Sun, 16 Jun 2019 09:24:59 -0700 (PDT) Received: from localhost (kevin@localhost) by carhart.net (8.15.2/8.15.2) with ESMTP id x5GGOwbu036334 for ; Sun, 16 Jun 2019 09:24:58 -0700 Date: Sun, 16 Jun 2019 09:24:58 -0700 (PDT) From: Kevin Carhart To: edbrowse-dev@lists.the-brannons.com Subject: [edbrowse-dev] dataset / offsetWidth Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Thanks for the parallel downloading feature, Karl. I haven't used it yet, but I did track down something interesting today. The site maerskline.com gave an error that it could not address the 'url' property of an object that didn't have it. I tracked this down to: this.url = this.el.dataset.url It turns out that properties in HTML tags that begin with "data-" are supposed to be available for retrieval with the "data-" stripped off. So the original HTML page had a div that said
And now it's expecting to be able to find that under (that div).dataset.url So I thought we could do this in pushAttributes maybe? First I established an empty "dataset" object in domLink. Then in pushAttributes, given the loop over attributes 'a' with values 'v', I wrote this, where substring is just some internet code. I'm just stripping off the first five characters. Karl, do you have something in stringfile.c that can do that? if (strncmp(a[i],"data-",5)==0) { dso = get_property_object(t->jv,"dataset"); substring(a[i],token1,6,strlen(a[i])-(strlen(a[i]-5))); set_property_string(dso, token1,v[i]); } So after this change it finds the dataset.url and proceeds. But there was one more problem. It wants to call ie: ie = function (e) { return e.offsetWidth; }; Where e is an element, this.el. So it expects the broad height and width properties to exist on elements. Does it make any sense for an element to have those? Anyway, could we throw them on c.prototype? c.prototype.clientHeight = 768; c.prototype.clientWidth = 1024; c.prototype.offsetHeight = 768; c.prototype.offsetWidth = 1024; c.prototype.scrollHeight = 768; c.prototype.scrollWidth = 1024; c.prototype.scrollTop = 0; c.prototype.scrollLeft = 0; I used everything on this! breakpoints, snapshotting, uvw trace etc thanks Kevin