From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-ch2-10v.sys.comcast.net (resqmta-ch2-10v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:42]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 95B6477E8A for ; Mon, 28 Sep 2015 20:16:47 -0700 (PDT) Received: from resomta-ch2-02v.sys.comcast.net ([69.252.207.98]) by resqmta-ch2-10v.sys.comcast.net with comcast id NrKy1r00427uzMh01rL6MQ; Tue, 29 Sep 2015 03:20:06 +0000 Received: from eklhad ([IPv6:2601:405:4002:b0a:21e:4fff:fec2:a0f1]) by resomta-ch2-02v.sys.comcast.net with comcast id NrL61r00e0GArqr01rL6dT; Tue, 29 Sep 2015 03:20:06 +0000 To: Edbrowse-dev@lists.the-brannons.com From: Karl Dahlke Reply-to: Karl Dahlke User-Agent: edbrowse/3.5.4.2+ Date: Mon, 28 Sep 2015 23:20:06 -0400 Message-ID: <20150828232006.eklhad@comcast.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1443496806; bh=BC0FgdRXps/9FlzVRCuXFIDsbqJ6FUOG9TXKprVgr1M=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=ZLh147wTEpYh0rcrmAka8b3pweJ/f/HKLIMKDlH8fCDlAFPu8oOTr+nwKOJ6pYmfW 0NOD7xMvfKhyHmDpFkO17wjGBnI5Ur0zGrtDejXNeTz4EK1HhZdvxJi01U5ffNcLPM UmViWyYwXzFC8qBERmlV5SxAbg24lg8xDBWLGVzKttbg28Men5J7Aa1FHC5t5RaJWA PVdU7Nwea9yu+TRKwKPRDxUERBKkjabdMC93MNAAnrrtGMUOXxej0Wa0EL3IXImGdA Rj3iDnMptgShitjywPJF/sqI3fZTufhWF34NBDZbtiLHflwTTKFt6/7OIqK5dqHPvX 4B4gFBbF4MOfw== Subject: [Edbrowse-dev] document.write atomic 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, 29 Sep 2015 03:16:47 -0000 This is mostly aimed at Kevin, our resident expert in html and js in the wild, but I thought I'd post it here for all to consider. A pivotal question influencing design is this. Is document.write immediate and atomic? I asked before and Kevin thought it was. That as soon as I see document.write(string) I am to parse that html and create the implied js objects etc etc. And yet, I'm pretty sure I've seen websites, I know I've written websites, wherein the write is not atomic, and should not be parsed in isolation. Example: document.write("

"); document.write("click on this baby"); document.write(""); I'm pretty sure I've seen things like that, what do others say? Parsing each string as an individual html document would not work. The first string would degenerate to , and the second would just be text not enclosed in a hyperlink, and the third would be a close tag without an open tag and discarded. That won't work. If document.writes are as above, then my current design is correct and should not change. Build the writes up in a buffer and then parse the write buffer after the script returns. This is completely separate from the innerHTML strategy, foo.innerHTML = string; The string is the whole html in its entirety, is to be parsed at this time, and the js objects immediately available by the next line of javascript. I just don't think document.write works that way, but I have to suspend all coding until I have a confident answer to this question. Karl Dahlke From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) by hurricane.the-brannons.com (Postfix) with ESMTPS id B010E77AF8 for ; Tue, 29 Sep 2015 00:11:16 -0700 (PDT) Received: by wicfx3 with SMTP id fx3so135999398wic.1 for ; Tue, 29 Sep 2015 00:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=W8mbcFXMW+36NIiYbIFLNyGR1xUASUAMjT+YzTVpMrM=; b=UsTdQR2JpQeMGlD/+KcuJCnmVqN26SbcjMnxl5S1N3xu8txfh4etvXoOpsfPo8WkY6 /UFsGVYAlptoTHT6HunlCwQZF5l/n2/K6HaO0svzGHEB8Yc57I8mSoBy1tX175xe8Cu7 d4e/jvaDy7aox9wsICRdTXo72Wm2bETsp7zbEiClGQHldgMlOYuR5usPkEFkuSb9Tv6c fTEjGnOA0sQdgYJ9sVxcMHQDExnfidLUc1o4il89je84YUXgtGC6KZ7GgnOxWFMClM87 ZiYR01sNuczmoXMeFIaCeStxSd8nproSR2HsLRDlPn1smJykpOHSsyv4H0oamo22tGAR QJKA== X-Received: by 10.180.88.4 with SMTP id bc4mr25318580wib.68.1443510875099; Tue, 29 Sep 2015 00:14:35 -0700 (PDT) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by smtp.gmail.com with ESMTPSA id fs2sm22235806wib.12.2015.09.29.00.14.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 00:14:34 -0700 (PDT) Date: Tue, 29 Sep 2015 08:14:32 +0100 From: Adam Thompson To: Karl Dahlke Cc: Edbrowse-dev@lists.the-brannons.com Message-ID: <20150929071432.GT2254@toaster.adamthompson.me.uk> References: <20150828232006.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xPLL5cPndR2UZ7Mw" Content-Disposition: inline In-Reply-To: <20150828232006.eklhad@comcast.net> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [Edbrowse-dev] document.write atomic 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, 29 Sep 2015 07:11:17 -0000 --xPLL5cPndR2UZ7Mw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 28, 2015 at 11:20:06PM -0400, Karl Dahlke wrote: > This is mostly aimed at Kevin, our resident expert in html and js in the = wild, > but I thought I'd post it here for all to consider. Yeah Kevin should have the final say on this since he's seen more of the internals of running websites. > A pivotal question influencing design is this. > Is document.write immediate and atomic? > I asked before and Kevin thought it was. > That as soon as I see document.write(string) I am to parse that html > and create the implied js objects etc etc. > And yet, I'm pretty sure I've seen websites, > I know I've written websites, wherein the write is not atomic, > and should not be parsed in isolation. > Example: >=20 > document.write("

"); > document.write("click on this baby"); > document.write(""); >=20 > I'm pretty sure I've seen things like that, what do others say? I looked this up and the closest "answer" I could find was the examples and explanation here: =46rom this it looks like html is shoved into the document prior to parsing= then the document is reparsed in the loading case. In the post-loading case it looks as if we need to replace everything in the document with the document.write output. Same goes for document.writeln I g= uess. Cheers, Adam. --xPLL5cPndR2UZ7Mw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWCjpYAAoJELZ22lNQBzHOxAAIAJJG5PAWGRxZDIw43T1F5m5m k5PBX4PByQl+WlHXy7s/8OZsRIgdCmg55SZG1jKqluxMKR7m/84NGG9VWaTT5Awm 4e8HKKrBcfh7EE4h6Ndf8He50q2bHllgRWdYIqZO83g4EsXSdQ0Xw7Qv4uulk6bG /r805IvYoZ2g6BDdOiO5z6+KOl6yjegE+O/IeHu0HnztstwHc+xAFNSEdzChtm4/ lpiwvQYE0CSjWnNkirB91AtkUNQ2q6B9xGbBZNI94PALlOtAdFZoVj5xfbI+bmKz rJT7U2uGydOYF3ftQRRSQ5qHz6XdmmofSNuQd1dM0vtLCdnltwwvkMvIk1A4/R4= =n+7/ -----END PGP SIGNATURE----- --xPLL5cPndR2UZ7Mw-- 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 3494C789FB for ; Tue, 29 Sep 2015 02:48: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 3A977400489; Tue, 29 Sep 2015 02:51:39 -0700 (PDT) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id t8T9paNZ014667; Tue, 29 Sep 2015 02:51:38 -0700 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id t8T9pa8x014663; Tue, 29 Sep 2015 02:51:36 -0700 Date: Tue, 29 Sep 2015 02:51:36 -0700 (PDT) From: Kevin Carhart To: Karl Dahlke cc: Edbrowse-dev@lists.the-brannons.com In-Reply-To: <20150828232006.eklhad@comcast.net> Message-ID: References: <20150828232006.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] document.write atomic 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, 29 Sep 2015 09:48:19 -0000 Crud. To be honest, I really don't know. It's true - your apples example shows document.write building segments that don't make any sense on their own. It seemed to me that in my other example, well, you have to interpret the jquery syntax to understand it, but the point is that it says 'write', which pumps in whatever is in div.innerHTML, and then immediately afterwards, calls jquery's own find() method on that html. frameDoc.write(div.innerHTML); var $bingImg=$(frameDoc).find("#minimap > img"); But of the two examples, I think you're correct, because the use of jquery is probably a confound whereas your apples landing page uses vanilla javascript. The only thing that bothers me about taking sites.help.org as a precedent is that they appear to be the ethically challenged portion of the internet, and this might suggest that they are less than technically airtight too. For instance, they make an iframe out of: www.youtube-nocookie.com Which is like a phishing trick to deceive you. But does questionable intent necessarily mean that their javascript was bad?! Not necessarily but anyway, I will scout around a little more tomorrow just to corroborate with a little more usage. Kevin