[Mozile] 0.8: nesting contentEditable = "false"
James A. Overton
james at overton.ca
Thu Jun 8 11:01:53 EDT 2006
On 2006-Jun-07, at 9:15 PM, Short, Tom wrote:
> Mozile 0.8 looks like it's coming along great. One interest I have is
> being able to have an uneditable section inside of an editable
> section.
> This is mostly so that the noneditable sections can include buttons
> and
> inputs that the user can interact with.
Nested non-editable sections are an important feature which I haven't
done any work on yet. There are a few major problems:
- Under Mozilla, Mozile is using the designMode. The benefit is that
we get a cursor without asking the user to turn "caret browsing" on
and off. But there are a lot of disadvantages: bugs like the text
field bug you mention in your other post, and unsupported
functionality like text drag and drop and image resizing. We'll have
to evaluate the costs and benefits.
- Generally, if you allow nested non-editable sections then you have
to protect them from being deleted, which takes some doing.
> I found that it mainly works (editing is indeed disabled) except
> for the
> following:
>
> (*) Under Firefox 1.5.0.4 and IE6, when I select the input box and
> type,
> I get Mozile errors in mozile.event.handle. I assume that Mozile
> should
> ignore these keypresses when in a contentEditable="false" section.
In Firefox I can't select the input box at all, so I don't see these
errors. I expect that some tweaking of mozile.event.handle() would
fix them. However, there is a try/catch block in mozile.event.handle
() which catches all sorts of errors in other functions, and so the
message you see might be misleading.
> (*) In Firefox, if you try to arrow-key past the noneditable section,
> the cursor gets "stuck" in the noneditable part. In IE, it more
> naturally jumps over the noneditable section.
>
> A bit related to this last point, page-up and page-down act a bit
> weird
> in Firefox. If I hit page-up near the top of an editable section, the
> cursor will leave the editable section and jump somewhere to the
> noneditable section above and get "stuck"; the cursor is still
> there and
> blinking, but it won't move.
Ok. I'm aware of these problems. I wrote code to handle left and
right arrow keys, but I haven't tackled up/down or page up/down. This
is harder, because the DOM functions we rely on don't include
information about where lines are wrapped. You might remember that
eDOM did a very bad job of this.
Cursor handling is tricky, but with enough cleverness we can make it
work. It's one of those spots where IE does a much better job than
Mozilla.
Thanks for the report, Tom. I know that this is an important feature.
I've got most of the interface and element insertion/wrapping code
running. Although there will be bugs, hopefully it will be
presentable in a day or two. White space and validation still need to
be implemented, but I figure it would be more productive if I spent
some time writing up documentation. That we can get more people
working on the code and make progress faster.
James
More information about the Mozile
mailing list