W3C home > Mailing lists > Public > www-style@w3.org > May 2011

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

From: Ojan Vafai <ojan@chromium.org>
Date: Tue, 10 May 2011 08:43:17 -0700
Message-ID: <BANLkTimtG_8eTi8oYsLB5u7r4gBd12scBw@mail.gmail.com>
To: "Robert O'Callahan" <robert@ocallahan.org>, Julie Parent <jparent@chromium.org>, Ryosuke Niwa <rniwa@webkit.org>, Eric Seidel <eseidel@chromium.org>
Cc: "www-style@w3.org" <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:40 GMT