[Mozile] mozile 0.8
James A. Overton
james at overton.ca
Tue Apr 25 14:22:41 EDT 2006
Hi David,
I'm starting work on the new editing system, and I'd appreciate it
if you could send along the Range and Selection code you mentioned.
Many thanks,
James
On 2006-Apr-11, at 4:10 PM, David wrote:
> Hi James,
>
> Great to hear about cross browser support, which is just what I was
> hacking around in 0.7. The to try the mozile editing commands was
> because I was tired of all the font tag crap and other non xhtml
> tags in my markup.
>
> To create cross-browser editable regions I switch to designMode
> when somebody is inside the editable area (which only allows block
> elements to be editable). This works pretty well, I hate to use (i)
> frames.
>
> I created w3c compatible range object and a Mozilla compatible
> selection object for IE, which I can contribute.
>
> Kind regards,
>
> David
>
> James A. Overton wrote:
>> Time for an update on Mozile 0.8.
>> My goal for 0.8 is the ability to edit arbitrary XML files
>> (styled with CSS) in a structured way. By this I mean that the
>> editor will prevent you from breaking the structure of the XML
>> dialect, and also help you by providing commands and tools which
>> are appropriate to the editing context. The features that will
>> allow this will also improve XHTML editing.
>> First of all, we need a technique for describing the structure
>> of an XML dialect. DTDs and XML Schemas do this, but I think there
>> is broad consensus that RelaxNG is the best of these tools. RNG is
>> extensible (using namespaces) and we'll add configuration details
>> for editing commands to the basic RNG file.
>> The idea is not to build a validating editor per-se, but to
>> provide the information that the editor needs to keep the document
>> valid at each step. Bitflux has had an RNG validator for years,
>> but I've written a new one which I think suits the current
>> purposes better. Validation is always going to be slow in
>> JavaScript, but the plan is only to validate small pieces of the
>> document infrequently.
>> So we'll be able to take a node in the DOM and look up the
>> matching RNG rule (or rules). The RNG rule will know whether this
>> node is allowed text content, whether it can be deleted from the
>> document, and what children it's allowed. All that information
>> comes just from RNG, and we can add more information like button
>> icons and tooltips with extensions to the RNG schema.
>> The commands will be implemented much like in Mozile 0.7, as
>> JavaScript objects which take events and manipulate the DOM.
>> However they will be constrained to changing only the current
>> node, and passing messages up and down the DOM tree. They will
>> also be much smarter about undoing their operations. You'll have a
>> library of commands to draw on, and each editor will support a
>> subset which is appropriate for its content.
>> The upshot is that there will be fine-grained control of what
>> is editable and how it can be edited.
>> That much is solid. I've prototyped it and I'm sure I can make
>> it work. Here are some ideas that should be possible, but which I
>> haven't tested yet:
>> RNG has (indirect) support for datatypes as well. This opens
>> the door for "binding" widgets to the datatypes. For example, if
>> the RNG marks an attribute as a date, then we'll be able to attach
>> a calendar widget to guide editing of that attribute.
>> I'm also planning to make the interface system much more
>> flexible by using a Factory pattern. Two immediate possibilities
>> are separate HTML and XUL interface factories.
>> Other changes: I took a good look at Dojo (http://
>> dojotoolkit.org) and liked a lot of their architectural choices.
>> Mozile 0.7 takes object oriented design to an unreasonable degree
>> for JavaScript. The 0.8 code takes a library-style format like
>> Dojo, using both functions and classes where it makes the most
>> sense. I've also copied their loading system.
>> And finally, at the risk of creating unrealistic hopes which
>> could be cruelly dashed by fate, I'm experimenting with cross
>> browser support.
>> I now believe that it's possible to get Mozile 0.8 working
>> under browsers other than Mozilla. I've spent the last week
>> figuring out how to do this. For example, instead of using
>> Mozilla's caret mode, in other browsers we can use the
>> contentEditable mode (IE and Safari) to get a cursor. Then we can
>> capture events, avoid the constricting execCommand method, and
>> manipulate the DOM directly. There are many many many differences,
>> small and large, which have to be abstracted away in order for
>> this to have a chance of working.
>> I've been fighting with Safari and Internet Explorer for days,
>> trying to build layers of cross-browser code. I haven't got the
>> RNG system working yet outside of Mozilla, but I think it's
>> possible. After that the big question is the Range and Selection
>> objects. Safari seems to be similar to Mozilla, but IE is very
>> different.
>> In short, I don't yet know if it's possible to build a cross-
>> browser WYSIWYG structured XML editor. No one else has done a
>> proper job of it. My first priority is making it work properly in
>> Firefox. After that, additional browsers are icing on the cake.
>> What's finished? I have code and tests written for the
>> mozile.core, mozile.dom, mozile.util, mozile.xml, and mozile.xpath
>> modules. These work (so far) in Mozilla 1.7 (and FF 1.0), Mozilla
>> 1.8 (FF 1.5, SeaMonkey 1.0, Camino 1.0), Safari 2, Opera 9.0p2,
>> and IE 6.
>> I'm working on mozile.rng today. I have RNG validation code
>> working in Firefox which is capable of validating XHTML documents
>> against the schema here: <http://www.thaiopensource.com/relaxng/
>> xhtml/>. Name class and datatype features are still lacking, as
>> well as some RNG elements. Those will be added as needed.
>> None of this amounts to an editor, yet.
>> I've just uploaded a bunch of code to CVS. You can,
>> - play with the validator: http://mozile.mozdev.org/0.8/demo/
>> validation.html
>> - run the test suite: http://mozile.mozdev.org/0.8/test/index.html
>> - look at some Known Issues: http://mozile.mozdev.org/0.8/KnownIssues
>> There's a lot more to be done, and help is always appreciated.
>> For example, if someone could add the examples from <http://
>> www.oasis-open.org/committees/relax-ng/tutorial.html> to this test
>> library <http://mozile.mozdev.org/0.8/demo/RNGLibrary.xml> I'd be
>> very grateful. I'd also appreciate any tips on debugging
>> JavaScript in IE or Safari; I'm finding it very difficult.
>> I'll be hanging out on IRC at freenode.net/#mozile today and
>> tomorrow. I'm travelling for Easter and might not have regular
>> email access.
>> Thanks for your interest,
>
> _______________________________________________
> Mozile mailing list
> Mozile at mozdev.org
> http://mozdev.org/mailman/listinfo/mozile
More information about the Mozile
mailing list