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

2014-03-22 Thread Johannes Wilm
I would think that would be a great idea. We would need to contact the
different editor development teams and see if that works for them.


On Fri, Mar 21, 2014 at 2:12 PM, Ryosuke Niwa rn...@apple.com wrote:


 On Mar 18, 2014, at 2:22 PM, Johannes Wilm johan...@fiduswriter.com
 wrote:




 On Mon, Mar 17, 2014 at 4:59 AM, Robin Berjon ro...@w3.org wrote:

 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).


 That is interesting. I had not heard that before, but it certainly makes
 sense in many cases. Some other issues, such as when joining two paragraphs
 by hitting backspace at the beginning of the second one leading to the two
 paragraphs not being merged the way one would assume by joining the
 contents of the two paragraphs, but instead by a number of font elements
 and similar being inserted, don't seem like they would be used by any
 current editor. It is my understanding that the reasoning behind this is
 just that A. there is no full and good spec on doing this, so B. everybody
 waits until there is one with fixing this.



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


 They are also some of those I have spoken to. We share a lot of the same
 problems as they have, but it is my understanding that they have not yet
 had to deal with noneditable islands or noneditable islands with
 editable lakes and similar items. The CKEditor on the other hand does have
 to deal with this, as do we.


 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.


 This would certainly be an improvement. As it is now, we for example do
 not use contenteditable for anything else than the caret movement, so if
 that could be done right in all cases, that would mean a lot.

 Creating a javascript/contenteditable editor is not that hard, if one only
 has to deal with the various text formatting and adding functions. The
 problems starts if one has to get around bugs related to the cursor not
 moving correctly or not moving at all to certain places (for example
 between two inline non-editable objects in Firefox). Then one needs to
 create a fake-cursor, etc. which is a much bigger task and only has been
 achieved by a very few projects so far.



 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.


 If it would help, I could help organize a meeting with the various editor
 creators (Aloha, TinyMCE, CKEditor, Substance.io, Fidus writer, HalloJS,
 etc.) to discuss this. In my experience, these developers are very
 interested in getting in contact with the browser makers about this, and
 haven't always been successful in this.


 Understanding the real needs of editor developers would be great.

 Would it be possible to have this meeting at this year's TPAC?

 - R. Niwa




-- 
Johannes Wilm
Fidus Writer
http://www.fiduswriter.com


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

2014-03-22 Thread Adam Sobieski
Web Applications Working Group,


With a Selections API in its own specification, discussion topics include:


Document Object Model

Range

Selection

HTMLRange : Range

HTMLSelection : Selection


Interfaces such as HTMLRange and HTMLSelection can extend Range and Selection 
to provide UI features, e.g. context menus and HTMLMenuElement.


Selections API topics include:


Attributes on ranges, selections.

Styling of ranges, selections.

Tooltips on ranges, selections.

Context menus on ranges, selections.

Scrolling to ranges, selections.



Navigating between ranges in a selection and between selections (e.g. tabIndex)

Hyperlinks to ranges, selections.

Canonical URI fragments for ranges, selections; extending default context menus 
on selections to clipboard hyperlinks which include the canonical URI fragment.





Hypertext content can utilize hyperlinks to ranges and selections to discuss 
relationships between selected content; see also: http://inference-web.org/ , 
http://www.w3.org/TR/prov-o/ , http://lurchmath.org/ .  Informative content can 
provide users with information about related ranges or selections with 
hyperlinks which scroll to ranges or selections and with effects on mouseover.


Other topics include visual indicators on scrollbars based on styled ranges and 
selections.






Kind regards,


Adam Sobieski






From: Ryosuke Niwa
Sent: ‎Thursday‎, ‎March‎ ‎13‎, ‎2014 ‎7‎:‎45‎ ‎PM
To: public-webapps@w3.org
Cc: Jonas Sicking, Ted O'Connor, Ehsan Akhgari, Aryeh Gregor, Yoshifumi Inoue





Hi,

It appears that there is a lot of new features such as CSS regions and shadow 
DOM that have significant implications on selection API, and we really need a 
spec. for selection API these specifications can refer to.

Thankfully, Aryeh has done a great work writing the spec. for selection API as 
a part of HTML Editing APIs specification [1] but no browser vendor has been 
able to give meaningful feedback or has implemented the spec due to the 
inherent complexity in HTML editing.  As a result, the specification hasn't 
made much progress towards reaching Last Call or CR.

Given the situation, I think it's valuable to extract the parts of the spec 
that defines selection API into its own specification and move it forward in 
the standards process so that we can make it more interoperable between 
browsers, and let CSS regions, shadow DOM, and other specifications refer to 
the specification.

Any thoughts and opinions?

[1] https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html

- R. Niwa