From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24571 invoked from network); 10 Jun 2021 11:51:02 -0000 Received: from hurricane.the-brannons.com (2602:ff06:725:1:20::25) by inbox.vuxu.org with ESMTPUTF8; 10 Jun 2021 11:51:02 -0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hurricane.the-brannons.com (OpenSMTPD) with ESMTP id ca2857fc for ; Thu, 10 Jun 2021 04:50:57 -0700 (PDT) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by hurricane.the-brannons.com (OpenSMTPD) with ESMTPS id 6ff2480d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Thu, 10 Jun 2021 04:50:19 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id b145-20020a1c80970000b029019c8c824054so6346163wmd.5 for ; Thu, 10 Jun 2021 04:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CEjrioqUZBuNubkw63DaXiKg0wVcOOgtNYzzrAA5obc=; b=oYYg0pWBzGCRGk2bcBUvW8AXCFY6C5qPTbWTfngp1i0iNHhGFu4/hfANq007lqkCuT ayxwsvVsyP90nUg6G8SdbUsIhYrjhwakYvX0D+7mAtqgqlzWAsvIzY3QRDlEhWhQcic0 70Dhe+EXAIVQ6lokuxlNkZ63pGLvOXIu2Rj/5M0bvXbyg/qOWOfT//Xipkuz0UAwFgGA UkVmdmzuHSeFqz3Enosqa5g+MWfEDnWcaxdmK+xek5j1c5B95JJp48AjHozd9Q0kcEA4 Ca3gLqAOBIai5VbrEenoeZgHREXXVMJcF/fcZyXMgYjatnuOyx+2oLu8ebT80Y59kk3k zD/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CEjrioqUZBuNubkw63DaXiKg0wVcOOgtNYzzrAA5obc=; b=IwxHLUeZo7UWJU2R/7x8uzlZBfmC9eFh3ZDPg4Y9VUS83hCuXJAiX6w4B6m0mdpOXW 7qW4OPwYl+qc5/knwQKDzYlF8RdMA4Zdk61KsWMz1PpkfHDTsxATkBVMzj8keEyemH/c rji4dNkgMZxXBrXT/7agvkeO5m2knexIn4MUaGXxXZWfQ49V2FhOFP8L0059NaVNOpen 260nYRssLbsRCR04XU5r8IKLYZQ+RfR1Kzs0MoWJU+3D5Y31Q+qa9QjFixDheLtd34wh oow0+6Y+8OBd82rF8a6KP2PVGk1JFmCAmb5hqDsWscmqpjFetlFJw0Yf7hVVs9jQT7BD EKkA== X-Gm-Message-State: AOAM5314xcNudeSnpArwTG4RlKD1SmFDver7cusKMojLDab/PBU9GJU6 VM1r8z3bGzkGGdbK0En9ipI= X-Google-Smtp-Source: ABdhPJwuYFIim9FFgKNN2Y8FTEx6SYvuKxgySk5RiBrEC3bAl80O38jgWofQEPgkdid/utFKg4HcIw== X-Received: by 2002:a1c:23d6:: with SMTP id j205mr15055905wmj.94.1623325751793; Thu, 10 Jun 2021 04:49:11 -0700 (PDT) Received: from toaster (b.5.b.9.4.f.e.f.f.f.c.f.1.b.a.e.1.4.0.9.2.4.1.1.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1142:9041:eab1:fcff:fef4:9b5b]) by smtp.gmail.com with ESMTPSA id l20sm2563051wmq.3.2021.06.10.04.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 04:49:10 -0700 (PDT) Date: Thu, 10 Jun 2021 12:49:08 +0100 From: Adam Thompson To: Kevin Carhart Cc: edbrowse-dev@edbrowse.org Subject: Re: document.write and innerHTML Message-ID: References: <8735ugxtsz.fsf@the-brannons.com> <90c5d52b-6529-4fd8-bff3-4a1d5a08b6bf@www.fastmail.com> X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90c5d52b-6529-4fd8-bff3-4a1d5a08b6bf@www.fastmail.com> On Wed, Jun 09, 2021 at 10:14:50PM -0700, Kevin Carhart wrote: > I researched what Silas is talking about a little bit and here is what I found out. I can't tell if it's significant or just odd. > > I went to both jdb and the firefox console, and I can confirm that our behavior diverges from FF behavior, but it's also different from what I expected in a strange way > In edbrowse, if I load a page and then say document.body.innerHTML, I get stuff > Then if I say document.write("hello") and then document.body.innerHTML, nothing changed and it echoes the same string. > In the FF console if I run the same things, I was expecting it to append "hello" on the existing innerHTML. But it completely clobbers. And correspondingly, the render completely changes. (of course, only in the browser, where you can mess with the already-downloaded as much as you like.) So now the entire page has had its innerHTML changed to just "hello". > > So I don't know if ssb22 is saying that an append or a clobber is what should happen, but I think he's pointing out that currently in edbrowse neither happens. > I also always assumed append would be the thing to do here, but I checked [1] and it seems that if the document is already loaded when document.write is called it defaults to blasting the document first. [1]: https://developer.mozilla.org/en-US/docs/Web/API/Document/write