edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev]   Render
Date: Fri, 28 Feb 2014 18:32:38 -0500	[thread overview]
Message-ID: <20140128183238.eklhad@comcast.net> (raw)

> Also, how are you going to make this function called every time js does anything?

Already done.
jSyncup is called before every js action, and jsdw is called afterword.
It's already bracketed.
And we have to do that anyways, to see what changes js made to our buffer
and report them back to the user.
These are things you just "see" in a regular browser.
"Oh - I clicked this button and now there's something new there."
We have to report it, and I made a first stab at it,
but we have to do better.
Like jsrt when you push the calc button it tells you that a line was updated.

> Primarily because I know of no way of protecting this js render function from
> being zapped by an unfortunately crafted page.

Like malice?

> At the moment if js does stupid things and breaks the js dom that's not nice
> if it completely destroys our method for rendering the buffer that's
> not only difficult to debug but also means you end up with an empty page.

Yes, a great point made in one sentence.
You couldn't turn js completely off, as you do today,
it would still have to be on long enough to build the objects from html like today,
but not run any scripts, then traverse the objects to render the page,
which is a funny flavor of off, not entirely off.
And if js was off because some other session hogged all the js memory,
well then we're up the creek eh?
Really annoying that the js pool is a fixed size.
So yes there's more to think about here.
Damn, I really liked the idea too!
Well we have time to mull it over and talk it out.

I found this in a tutorial long ago and bookmarked it.
It's the kind of thing we should support.
See how tables and cells and paragraphs and just about anything
on the web page can be built by javascript, not just by html tags?

https://developer.mozilla.org/en/docs/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces

Most web pages aren't that crazy but some are, and more and more web pages
at least build little partswith js,
like building the secondary menu based on your selection in a primary menu.
That happens all the time.
I wrote such a website for my work; I wrote a website
I couldn't even use with edbrowse. Ironic.
Anyways, I wonder, how long can we say
"Gee we need to render html even if js won't run",
will the day come when there just aren't many web pages left
that have any meaning without js?
Not trying to cause trouble, just wondering.
So anyways all this dynamic creation, perhaps well after the page is parsed,
perhaps because you pushed a button,
all this dynamism we must support.

html tags become js objects.
js scripts make more objects or change these objects.
js objects become things on the screen, or in our case the text buffer.

User pushes a button.
js function makes new objects or changes the objects.
js tree of objects implies a new buffer.
compare with the old buffer and report any differences.
Wait for next user input or action.


Karl Dahlke

             reply	other threads:[~2014-02-28 23:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 23:32 Karl Dahlke [this message]
2014-03-01 13:35 ` Adam Thompson
2014-03-12 16:57   ` Chris Brannon
2014-03-13 10:45     ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2014-02-28 20:01 Karl Dahlke
2014-02-28 22:04 ` Adam Thompson
2014-02-28 16:43 Karl Dahlke
2014-02-28 17:44 ` Adam Thompson
2014-02-28 19:16   ` Chris Brannon

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=20140128183238.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /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).