[Mozile] Line-breaks and XML/XHTML

James A. Overton james at overton.ca
Mon Jun 12 10:13:16 EDT 2006


Hi Reto,
	XML editing has always been a major goal of the Mozile project, but  
so far we've never had it working quite right.
	In Mozile 0.7, keyboard events are handled in "core/core.js" by  
mozileHandleKeypress(). Near the end of that function is the  
conditional that watches for DOM_VK_ENTER and DOM_VK_RETURN keyCodes.  
It then calls MozileEditor.splitBlock() in most cases.
	splitBlock() is probably where the trouble lies. What it does is  
look for the nearest ancestor element which is a block (judging by  
it's CSS "display" property), and then clones that ancestor and moves  
all the contents after the cursor into the clone. But looking at it,  
I don't see any code that is HTML specific. It should all work in  
XML. In fact, in a quick test I did I was able to split XML elements  
with the "enter" key.
	splitBlock() was changed in version 0.7.5, and if you have an older  
version of Mozile then that could be the problem. Compare splitBlock 
() in the copy you have with the latest version in CVS: http:// 
www.mozdev.org/source/browse/mozile/www/0.7/core/core.js? 
rev=1.49&content-type=text/x-cvsweb-markup
	I can't say much more than that without knowing more details about  
your situation. If you can tell me more, or send along a test file,  
I'll be glad to help.

James


On 2006-Jun-12, at 5:40 AM, Reto Bachmann-Gmür wrote:

> Hello
>
> I've just started using mozile for editing sections of a page  
> served as
> application/xml .
>
> For the edit widgets to work I did a search and replace from
> createElement( to .createElementNS("http://www.w3.org/1999/xhtml", for
> all .js file in the mozile 0.7 distribution (except for the
> unparameterized createElement() on line 271 of core.js).
>
> Things like bold/italic/underline/lists work, however pressing  
> return in
> an editable section has no effect, neither does shift-return.
>
> Any help?
>
> Cheers,
> Reto
>
> _______________________________________________
> Mozile mailing list
> Mozile at mozdev.org
> http://mozdev.org/mailman/listinfo/mozile



More information about the Mozile mailing list