edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: edbrowse-dev@edbrowse.org
Subject: [edbrowse-dev] tagIsRooted
Date: Mon, 26 Oct 2020 14:50:56 -0400	[thread overview]
Message-ID: <20200926145056.eklhad@comcast.net> (raw)

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

First off, the question I like to ask, and the question you should ask:
why don't other browsers run into trouble if the engine doesn't provide gc free object hooks for the browser to use?
Why does only edbrowse need this stuff?

Because every other browser rerenders the screen after each dom change.
That might be ten times a second, and why not?
If things change that fast it looks like animation, perhaps it is intentional animation.
Or, maybe the little stock price in the upper right corner is constantly changing,
or a countdown timer to when the bidding is ticking down, or whatever.
The user can look at it or not.
His eyes do the selecting.
This on the fly rerendering is a feature for them.
We don't have that luxury.
I can't print "line 3 has changed" ten times per second.
That is an unworkable interface, and it illustrates the nearly impossible task of squashing visual websites into a command line format.
So, I rerender every 20 seconds or so, or if you issue a command that might cause a screen change.
That is my algorithm in a nutshell.
But that means the stuff you are reading, and maybe clicking on, might not be up to date.
The object you are accessing when you submit a form might not even be there any more, freed,
and if I access it, core dump.
So wee need mechanisms that no other browser needs.
duktape happens to provide those mechanisms; I don't think the other engines do.

With this in mind, please pull and look at a routine I wrote,
tagIsRooted() in ebjs.c.
I might call this when you want to go to a hyperlink or submit a form or such,
just to make sure the tag and its corresponding object are still valid.
If I call this in just the right way, from all the right places, I might not need the gc free-object notifications that I get from duktape.

The tagIsRooted routine is kind of awkward, some would say ugly,
but it isn't called often, so it just needs to work, and work reliably.

Reply with comments and thoughts.
This stuff is complicated, probably at the limits of what I can do.
So I'll need help from younger and smarter people.

Karl Dahlke

                 reply	other threads:[~2020-10-26 18:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200926145056.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=edbrowse-dev@edbrowse.org \
    /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).