Re: contentEditable=minimal

On Fri, May 23, 2014 at 4:43 AM, Robin Berjon <robin@w3.org> wrote:
> On 23/05/2014 12:28 , Jonas Sicking wrote:
>>
>> And on mobile autocorrect of misspelled words is common, though that
>> can probably be handled by moving the selection to the misspelled word
>> and then writing the fixed word.
>
> Autocorrect should be handled like composition. Composition is pretty much
> what happens whenever you type some stuff and some other stuff comes out.
> (Technical definition.)

I sadly don't think it's that simple. When compositing chinese
characters, or characters like ü, an underline should be rendered
during the composition and then removed once a character (or set of
characters) is selected. This underline should not appear when typing
on a mobile keyword, even if it supports autocorrect.

It's not clear to me if the difference is just one of styling, or if
there are semantic differences as well.

>> Though one interesting edge case there is what happens if the page
>> adjusts the selection as it's being moved to the word autocorrect
>> wants to fix?
>
> I'm sorry, I don't understand the case you're thinking of?

My assertion is that we don't want to use compositing events when
typing on a keyboard which has autocorrect. (This might be a wrong
assertion in which case none of this matters). Rather than composition
events we fire events like:

insert 'c'
insert 'a'
insert 'g'
selection moved to start at index 0 and end at index 3
insert 'cat'
insert ' '

However we've previously said that pages should be able to cancel or
adjust selection moves. The question is what happens if the page
changes the selection when autocorrect attempts to select the word to
be fixed.

/ Jonas

Received on Friday, 23 May 2014 19:33:48 UTC