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

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?


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Thursday, 23 June 2011 18:06:37 UTC