Re: [CSSOM] does CaretPosition need a "before/after" hint?

On Tue, May 10, 2011 at 12:45 AM, Robert O'Callahan <robert@ocallahan.org>wrote:

> Gecko's internal equivalent of CaretPosition has a flag that we use to
> disambiguate "the caret is after character N-1 of the text node" and "the
> character is before character N of the text node". This matters because in
> bidi situations the screen positions of those caret locations can be
> different. For example, consider the text node "Latin HEBREW" rendered as
> Latin WERBEH
> If the caret is after the space, then it should be displayed in the middle
> of the line. If the caret is before the H, it should be displayed at the end
> of the line.
>
> Does the CSSOM CaretPosition need to expose something similar?
>

Makes sense to me.

Similarly, does it need to disambiguate line-wrapped positions?

"Line 1<wrap>
Line 2"

After Line 1 and before Line 2 are equivalent DOM positions.

I think we might be able to have a single flag for both of these. The case
of "Latin <wrap here>HEBREW", in which case the cursor could be at the end
of the first line or the end of the second line. But being at the beginning
of the first line would be a different DOM position.

I expect there's a case I'm not thinking of and we might need two flags.

Ojan

Received on Tuesday, 10 May 2011 15:44:01 UTC