W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

RE: contentEditable=minimal

From: Ben Peters <Ben.Peters@microsoft.com>
Date: Thu, 22 May 2014 23:23:53 +0000
To: Robin Berjon <robin@w3.org>, Julie Parent <jparent@gmail.com>
CC: Johannes Wilm <johannes@fiduswriter.com>, "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <f5e247a8774244c788ad10194a9a72f5@BY2PR03MB444.namprd03.prod.outlook.com>
> Let us take the relatively simple issue with typing "ñ" on a keyboard setup
> that does not natively support the character. On my keyboard, that is done
> by first typing Alt-N, then N.
> 
> At the more complete end of the spectrum, what we have today, without
> the developer doing anything, when I type Alt-N the DOM is modified to
> include a U+02DC SMALL TILDE (note: *not* U+0303 COMBINING TILDE) and
> that character is underlined in the rendering to let me know that it is awaiting
> a character to combine with. Interestingly, that information is not reflected in
> the DOM — I don't even know how you can handle it. In fact, editors that try
> to take over too much from the platform (in this case, Substance for instance)
> completely fail to allow this sort of text entry.
> 
> At completely the other end of the spectrum (more or where developers
> find themselves today when they override as much as they can, out in the
> cold), all you get are two entirely independent keyboard events: one N with
> altKey set to true, and another N with altKey set to false.
> 
> Unless you know all platform conventions (plus the user's keyboard
> layout) or you manage to enforce your own, which isn't friendly to users, you
> can't do anything useful with that.
> 
> What I meant by having the browser handle text input, is that it needs to
> know the platform conventions so as to convey user intent to to the
> application correctly. When I hit Alt-N then N, the UA should relay something
> that looks like the following events (I'm deliberately not including
> keyup/down/etc. for simplicity):
> 
> compositionstart \u0303 (combining tilde) compositionupdate ñ
> compositionend ñ
> 
> (We might be able to do without the compositionupdate in this case, I'm
> including it because for more elaborate compositions it's needed.)
> 
> I believe that this provides the appropriate level of abstraction to address the
> use case. Without the composition events (e.g. if you only send a text input
> event) the developer can't show the composition in progress to the user
> (which for complex compositions like Kotoeri is a non-starter); and with
> these events developers don't need to know about the platform's
> conventions for composition. Orthogonality is where it should be.
> 
> As I said I am unsure that the way in which composition events are described
> in DOM 3 Events is perfect, but that's only because I haven't used them in
> anger and they aren't supported much.

My thought is that we can use CommandEvent with type="insertText". This would be the corollary to execComamnd("insertText"), and the data would be the ñ that is about to be inserted.
Received on Thursday, 22 May 2014 23:24:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:24 UTC