Re: [Editing] Splitting Selection API Into a Separate Specification

On 15/03/2014 18:44 , Johannes Wilm wrote:
> yes btw -- where should one go to lobby in favor of the editing spec? I
> have been communicating with several other browser-based editor
> projects, and there seems to be a general interest of more communication
> with the browser creators and spec writers. Currently the situation is
> that it's so broken in all the browsers, that one needs to use a 100%
> javascript approach, painting the caret manually and creating a separate
> system for selections, to circumvent the main problems of
> contenteditable (for example:
> https://bugzilla.mozilla.org/show_bug.cgi?id=873883 ). Codemirror is a
> good example of that.

My understanding from talking to various people is that at least part of 
the problem comes from the type of code that is currently deployed in 
the wild. An awful lot of it works around browser inconsistencies not 
through feature testing but through user agent switching. This means 
that when a given browser fixes a bug in order to become more in line 
with others (and presumably the spec), it actually breaks deployed code 
(some of which is deployed an awful lot).

I've been talking with some editor developers and have heard some 
interesting ideas, notably from the Substance.io people.

One suggestion has been to make at least the selection API 
interoperable, which seems achievable. So I'm very glad to see Ryosuke 
propose it here, I was about to suggest the same.

Another that I've been mulling over is to have something like 
contenteditable=minimal (bikeshed syntax at will). This would give you a 
caret with attendant keyboard motion and selection, but no ability to 
actually edit the content. Editing would happen by having a script 
listen to key events and act directly on the content itself. The hope is 
that not only is this a saner architecture for an editor, but it can 
also bypass most (possibly all, if the selection API is improved 
somewhat) browser bugs to do with editing.

I reckon a spec for that could be put together relatively easily. I'm 
still digging through Web editors' code to get a feel for how much it 
would actually help.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon

Received on Monday, 17 March 2014 11:59:27 UTC