Re: Default Caret and Selection Positioning Spec?

On Tuesday, 9 December 2014 at 11:25, Johannes Wilm wrote:

> > * Caret movement direction - from inside or from outside. E.g.:
> > <b>ab|c</b>de -> ARROW-RIGHT
> > <b>abc|</b>de -> ARROW-RIGHT
> > <b>abc</b>d|e
> >  
> > <b>abc</b>d|e -> ARROW-LEFT
> > <b>abc</b>|de -> ARROW-LEFT
> > <b>ab|c</b>de
> Ok, wouldn't this mean in the second example of each that new content being added to the inline element or not depends which arrow key was pressed previously?
No, it doesn’t depend on which key, but on where I was before the caret move. If I was outside, I stay outside. If I was inside, I stay inside.

This is the one and only way to give the possibility to the user to control where to insert the next character.

> Couldn't this lead to confusion when the user doesn't know which arrow key was pressed last?
There is a chance for it to happen, but the confusion is already there in any case, because the user will never be sure if s/he’s inside or outside the style. The proposed feature doesn’t make it worst.

> And what is the element is the very last in the document so that the user can't go further right than this element? Does that mean the user can't go behind the last inline element?
This is related to the last two items in my list. We still have to define what’s the best option in this case.  

> And what about mouse-clicks? Should it be treated like arrow-right or arrow-left?  
This proposal is for keyboard-like movements only. Mouse click behavior should be discussed separately to not mix topics.

> > a|<span cE=false><span cE=true>b</span>c</span>d
> > a<span cE=false><span cE=true>b|</span>c</span>d (nothing to skip)
> This one seems more questionably to me.  What would the use case be to not have the caret be able to go in front of the "b"? It seems like users would need "hack" this by adding a zero-width space to the outer span to get around this limitation. That doesn't seem right.

Visually speaking, the user sees the above as “a|bcd”. Considering that both “a” and “b” are editable, with nothing non-editable in-between them, it is a natural user expectation that ARROW-RIGHT will lead to “ab|cd”.

I understand that there may be situations where you want to style non editable blocks in a more evident way to the user, with borders, padding, etc… so it sounds reasonable for me that if the outer <span cE=false> has the “display” style set to anything that is not “inline”, like "inline-block”, the movement would count as a in-between blocks move, so the caret will be before “b”. This would be a good way to bring developers control over this behavior.

Btw, I feel that the computed style of “display” is critical on the algorithms, because some block elements may be styled as inline and vice-versa.

> We discussed some related cases in the  above URL.
@Ben, It is pretty hard to follow the discussion there, because there are several different topics under discussion on separate comments. Just like this thread. I really think that a shared document would do a better job.

Received on Wednesday, 10 December 2014 09:48:47 UTC