On Tue, Jun 17, Jorge Arellano Cid wrote:
[...] Technically, what interests me more about the patch is the separation of interface code out of document code.
Now Sebastian is working on another separation; for CSS (it also involves several files), so I think it is better to keep both works separated until our re-structuring of the parser is well defined.
I haven't looked yet at the patch yet (I'll do in the next days), but just FYI an overview of the changes: I'll go a bit beyond the changes suggested in <http://www.dillo.org/CSS.html>. Those changes will introduce a new structure named DocDocument, which represents the document in a DOM-like way, and is put as a layer between the HTML parser and Dw (which currently interact closely). See the document mentioned above for motivations and details. Some weeks ago, I decided to restructure also the HTML parser, with two goals in mind: 1. The file html.c is quite large, and it is quite self-evident to split it into three parts: general parsing and tokenizing, handling HTML specific stuff, and the link block, which contains links, forms etc. 2. It would be interesting to make the general parsing code reusable for handling other XML based documents, and even to render XML documents in a way described by CSS. So far, there will be something like the following design: - DilloHtml is replaced by two structures, SgmlParser, and HtmlParser, where the latter is inherited from the first. (I'm not sure the latter one is actually needed, but it is possible to add additional data and code to the base structure). Despite of the name, I do not intend to implement a fully functional SGML parser, it has a quite general interface, but this interface is actually incorrectly implemented, just as correct as it is needed for HTML. (IMO, this is reasonable, more that vice versa ;-) - DilloHtmlLB either remains in its current form, and there will be a new structure SgmlDoc, or SgmlDoc will also be a generalization of DilloHtmlLB. SgmlDoc will refer to the document tree, as well as to the structures needed to represent style sheets, it will exists as long as currently DilloHtmlLB exists. Accesses to DocDocument will be done mostly by the SGML base, while the HTML specific stuff will access the HTML link block, as well as something currently represented by BrowserWindow (what should be changed). Perhaps, there may be changes in the future, e.g. for MathML, there must be other drawing functions in the document tree, so this may be hidden by some kind of interface, but I do not bother about this, because this should be simple to change. Sebastian PS: Sorry for posting an empty reply.