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