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

On Thu, Jun 23, 2011 at 11:28 AM, Ryosuke Niwa <rniwa@webkit.org> wrote:

> On Thu, Jun 23, 2011 at 11:06 AM, Anne van Kesteren <annevk@opera.com>wrote:
>
>> On Wed, 11 May 2011 06:58:50 +0200, Robert O'Callahan <
>> robert@ocallahan.org> wrote:
>>
>>> On Wed, May 11, 2011 at 3:43 AM, Ojan Vafai <ojan@chromium.org> wrote:
>>>
>>>> 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.
>>>>
>>>
>>> We use a single flag for both, because the semantics match perfectly.
>>>
>>
>> So suggestions for names are .attachment and .affinity neither of which
>> sounds very boolean. We could do something like .isBeforeChar that returns a
>> boolean or maybe .placement which either returns the string "before" or
>> "after". Preferences?
>>
>
> I still don't like the fact we're mixing before/after line break and bidi
> caret.
>

Why?


> Can we have two separate API/attribute for those?  e.g. what does
> beforeChar mean in the context of line break?
>

I agree that beforeChar is weird. "placement" seems fine to me.

Received on Thursday, 23 June 2011 18:59:34 UTC