edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] document.write atomic
Date: Tue, 29 Sep 2015 08:14:32 +0100	[thread overview]
Message-ID: <20150929071432.GT2254@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <20150828232006.eklhad@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]

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:
> 
> document.write("<P><a href=url>");
> document.write("click on this baby");
> document.write("</a>");
> 
> 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:
<http://www.w3schools.com/jsref/met_doc_write.asp>

From 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 guess.

Cheers,
Adam.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-09-29  7:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29  3:20 Karl Dahlke
2015-09-29  7:14 ` Adam Thompson [this message]
2015-09-29  9:51 ` Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150929071432.GT2254@toaster.adamthompson.me.uk \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).