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] startwindow.js changes
Date: Tue, 13 Jan 2015 23:21:18 +0000	[thread overview]
Message-ID: <20150113232118.GL31364@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <20150013161052.eklhad@comcast.net>

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

On Tue, Jan 13, 2015 at 04:10:52PM -0500, Karl Dahlke wrote:
> Well it did break something in jsrt, though small.
> 
> You removed the lines that link the new elements into the arrays
> of said elements, and honestly I don't know what the correct behavior is here.
> When I create a script, should it be in the list of scripts?
> I don't know.
> The last function document.script$$pending() assumes that a script created
> will be in this list, and then looks through this list for scripts pending,
> for a script to run that hasn't been run.
> If a created script should not be put on the list document.scripts,
> then we have to put this one somewhere, in some kind of queue,
> so it can be run.
> 
> jsrt exercised this feature by creating one final script which, when run,
> put one line at the end of jsrt.browse.
> The line use to say {Last Link}.
> That line is not there any more, because the last script never runs,
> because it is not placed in document.scripts.
> We may need to do a little research to see how it *should* behave.
> Either these elements get put in their corresponding lists automatically,
> or if not then we need to implement a run queue for created scripts.

Sorry, I did wonder if I'd break something by doing this.
I'm fairly confident in saying that elements *shouldn't* be put in these lists
automatically since the function returns the created element to javascript
which then inserts it into the DOM in the correct position, i.e.
in the case of mouse.com, the created script should really appear before any
other scripts in the document and thus at the start of the scripts array.
As for what we do about running these scripts,
the logic seems to involve reparsing the DOM once the current script has
finished execution (I presume) and running the new script elements at that stage.
Since we don't do this at the moment, a separate run queue is probably needed,
along with some form of functionality in our DOM insertion functions
(appendChild, insertBefore etc) to put elements in the correct place in these arrays.
Tbh, I suspect we can probably put together the relevant functionality in
startwindow.js to reparse the DOM and generate the arrays from the js side,
though this obviously doesn't help the rendering at all.

Also, as per comments in startwindow.js,
apparently we're supposed to return something called a node list object rather
than an array from getElement* functions.
No idea what one of these is yet, more future research I think.

Cheers,
Adam.

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

  reply	other threads:[~2015-01-13 23:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 21:10 Karl Dahlke
2015-01-13 23:21 ` Adam Thompson [this message]
2015-01-13 23:34   ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2015-01-13 23:42 Karl Dahlke
2015-01-14  0:15 ` Adam Thompson
2015-01-13 20:38 Adam Thompson

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=20150113232118.GL31364@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).