[webkit-dev] Should editable webkit accept option space to insert non-breaking space?

Maciej Stachowiak mjs at apple.com
Mon Feb 19 21:30:13 PST 2007

On Feb 19, 2007, at 9:04 PM, Dan Wood wrote:

> Running blot, it appears that editable divs in webkit treat option- 
> space as a regular space, not as a non-breaking space.  I can't  
> believe this could have been neglected, so maybe it's not a bug?
> Personally, I'd like to be able to insert non-breaking spaces,  
> since it would mirror other text fields.
> Any thoughts?  Should I file a bug?

I think the reason this is done is because we use a sequence of  
alternating normal spaces and non-breaking spaces, plus some special  
WebKit-specific CSS properties, to achieve desired whitespace  
behavior. We want multiple spaces to show up in the middle of a line,  
but collapse away at the end, as in normal text editors.

In WebKit-based clients, like Safari or Mail, we can get the display  
to be just right, using a special CSS property. In other clients, we  
want decent fallback. The closest you can get is alternating space /  
nbsp, which preserves the multiple spaces but will break in the  
middle if needed.

An alternate design for this that still allowed entering true non- 
breaking spaces would be welcome - we could not figure out how last  
time we thought about this.


More information about the webkit-dev mailing list