intertwingly

It’s just data

application/xhtml


In a matter of a weekend; rusty on COM, unfamiliar with the Mozilla codebase, class libraries, build process, trace facilities, test suites, and debugging aids; and therefore armed only with make, vi, and fprintf; I came up with this modest patch against Minefield HEAD.

This patch is merely meant as proof of concept, it certainly isn’t production quality code.  The right thing to do longer term is to refactor the common code out of nsHTMLContentSink and nsXMLContentSink.

What does this patch do?  It enables this document (served as text/html and with the proper META tag) to be treated as application/xhtml (note the missing +xml!), and therefore enabling the SVG diagram embedded therein to be displayed.

The limitations in this proof of concept are numerous.  xmlns attribute values are not inherited, and therefore must be repeated on each element.  XML’s empty element syntax is not implemented, therefore separate start and end elements are required for each element.  Non-element nodes are not handled, so no embedded text or comment nodes will make it into the DOM.

There even seems to be a slight timing/notification problem whereby the first time you display this not all of the red areas show up properly.  If this happens to you, simply press F5.

In any case, the intent of this code is to show what can be done in the hopes of spurring the discussion of what should be done.

Background

At the moment, HTML and XHTML are two different authoring formats covering roughly the same domain of DOM trees.  People like T.V. Raman of Google have worked hard on standards like XFORMS which, at the moment, prereq XHTML.  Due to this dependency, such standards (which also include MathML, SVG, and XBL) are incompatible with other Google features, like AdSense.

In theory, this should all work out.  Eventually the ramifications of draconian error processing will work its way through the tool chain.  Either that, or eventually those who are working on HTML5 will recreate an entirely new toolchain and entirely new grammars.

The problem with the former is that it won’t work.  The problem with the latter is that it won’t scale.

There has to be a third option.  We just need to want to find it.

Let the dialog begin.