Soapbox time again (Mozilla Composer)

It’s becoming painfully obvious to me that Mozilla Composer wasn’t really designed for extensibility along the lines of what I’m attempting with Abacus (namely, adding support for a secondary markup language).
For instance, Composer adds stylesheets based on the tab you’ve selected at the bottom. If you select the Tags tab, you get a special stylesheet with lots of yellow image boxes for your elements. So far, so good.
Except for how it applies the stylesheet…
I tried doing an XUL overlay for the stylesheet (EditorAllTags.css). That was unsuccessful. I figured out later that the stylesheet was applied through C++ code:
http://lxr.mozilla.org/seamonkey/source/editor/ui/composer/content/editor.js#1928
http://lxr.mozilla.org/seamonkey/source/editor/libeditor/html/nsHTMLEditor.cpp#3730
This stinks. It’d be much easier if we could just apply stylesheets from the Document Object Model, as DOM-2 Style suggests. I’m tinkering around with that idea (based on DOM-2 Events to tell me when to apply the sheet and when to kill it) to make the styling work properly.
It’d also make sense, from a undo/redo point of view, if the various settings used a single transaction manager, and created alternate “views” for the document being edited. The document itself would remain hidden from the user, though all manipulations the user carried out on a view of the document propagate down into the master doc through a transaction manager. I remember someone on the Composer team long, long ago saying this might be a possibility. (Until the Nvu source gets checked into Mozilla’s tree, it’ll be a little hard for me to check that…) Having that undo/redo done this way would make it easier/safer for external applications, like DOM Inspector, to become a part of Composer.
Finally, I cannot for the life of me figure out how in Composer a HTML 4.01 Transitional doctype gets in when the document I’m loading already has a doctype tag.

5 thoughts on “Soapbox time again (Mozilla Composer)”

  1. You should e-mail David G.
    He’s really good about helping people out, and I think he would be specifically interestes since yit has to do with extending Composer/NVU.
    -Jed

  2. If your document already has a doctype, it is preserved. A doctype is added if and only if your document is doctype-less.

  3. That doesn’t jibe with what I’m seeing in Mozilla Composer. I’m including an XHTML 1.1 + MathML 2.0 doctype, and it gets fried…

Comments are closed.