On Sun, Aug 30, 2015 at 07:31:07AM -0400, Karl Dahlke wrote: > I was thinking about the history of our js interactions. > We felt it was wise to separate and encapsulate, > writing jseng-moz.cpp as a separate source file running a separate process. > Among other benefits, > this makes it easier to switch engines, or conform to Mozilla upgrades > and changing APIs. > We've talked about v8 and duktape for instance. > Those are still possibilities. > So ... if there is any uncertainty at all about the html parser, > or if we just want to keep the door open, should we do some encapsulation, > and should we start now? Yes. > The connection is far simpler than js. > Pass html text, get back a tree of nodes. > It's conceptually a function call, > and doesn't need to be a separate process or thread. > Nothing asynchronous etc, and no ongoing dialog with states etc. > So it's very simple, but still might be worth putting in another sourcefile. > > html-tidy.c - use tidy to parse html > html-hub.c - use hubbub to parse html > ... Still not sold on hubbub. Can you actually get it to build without building netsurf, or find any documentation on it for that matter? If we can then yeah we can look at it also, that'd be potentially better, but it seems to have disappeared as a separate project and I don't want edbrowse to be bound to netsurf's development. I know when I looked I couldn't extract libhubbub any more and the distro package has gone. > Let the makefile link in whichever one we want, > just as the makefile determines mozilla or v8 or duktape etc. > Then htmltidy.c is the only file that needs tidy.h and its > structures and API, and it returns to us > a tree of our nodes, as converted from the tidy nodes, > which we then use to build our DOM. > It's a small bit of administrative overhead that might pay dividends. > What do you think? I think that we probably want to also create a library of common functions for working with the node tree in that case. That'd essentially be a DOM, with the only work then being to create the rest of the objects it requires, and expose it to js... oh and alter the rendering... and bug squash. Cheers, Adam.