edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] DOM tree
@ 2015-05-09 16:28 Karl Dahlke
  0 siblings, 0 replies; only message in thread
From: Karl Dahlke @ 2015-05-09 16:28 UTC (permalink / raw)
  To: Edbrowse-dev

Chris writes:
> Since we only need to parse HTML once, when the document is read, we can
> dispense with the tidy tree as soon as we have converted it to our DOM.

True, but bear in mind we may need to do the same thing again,
creating another dom tree that pastes into the first,
as a branch of the first.
This happens in at least two ways.

document.write()
document.something.innerHTML()

Both of these inject html into the stream, as though it was written at that point.
This html must be parsed, and the resulting dom tree
becomes a subtree of the higher tree,
attached to the js script node that called document.write()
or to the entity that becomes "this" for innerHTML.
I accomplish this now by calling htmlParse() in html.c
whenever I have some html to parse.
This can be called multiple times from within one browsing operation,
or again as you push buttons and otherwise activate js functions.
Chris let me know if you want more collaboration on using tidy to parse the html
rather than my home grown parser.
I'm happy to help,
or at least unravel the mystery of the code that is already there.

Karl Dahlke

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-09 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 16:28 [Edbrowse-dev] DOM tree Karl Dahlke

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).