Re: Should we take CSS into consideration? (was: Re: attribute or CSS property?)

On Tue Dec 16 2014 at 10:44:00 AM Johannes Wilm <johannes@fiduswriter.org>
wrote:

> On Tue, Dec 16, 2014 at 7:26 PM, Olivier Forget <teleclimber@gmail.com>
> wrote:
>>
>>
>>
>> On Mon Dec 15 2014 at 11:10:09 PM Koji Ishii <kojiishi@gmail.com> wrote:
>>
>>> +1 from me too.
>>>
>>>
>>> ...
>
>> Needs Olivier's clarification; I think his proposal handles the two
>>> the same way. Since outer one is display:none, carets cannot move into
>>> there unless it's set by scripts, IIUC.
>>>
>>
>> Yes, that's correct.
>>
>
> OK, maybe I don't quite get it. As I understand Olivier's proposal:
>
>
> [A] The caret can go into a contenteditable element inside of a
> "display:none;"-styled element only if it is placed there by Javascript.
> Once it is placed there though. the caret/selection behaves like any other
> caret/selection, right? So it reacts to keyboard input, arrow keys, etc. .
> If it doesn't react to any of this, wouldn't that take the "typing" out of
> "contenteditable=typing"?
>

Sorry I should have been more clear, but it looks like you got it. User
can't navigate to the inside of a display:none (or any of its descendants)
using either mouse or arrow keys.

However Editor Dev can set the selection programmatically but there is no
visible manifestation of the caret.

The question then is: should typing intent events fire when the selection
is inside editable content that is CSS-hidden? What about caret movement
intents?

Let's start with caret movement. Are these even possible? Where does
"up-arrow" go when the characters themselves have no defined position? And
that's just the start of it. Our rules for moving caret around invisible
elements become nonsensical when everything is invisible. I think enabling
caret-movement intents on hidden content will be problematic.

What about typing intents? At first glance it seems this should not be a
problem. However I worry that there may be situations where it breaks down.
One open question about typing is what to do in "overwrite" mode [1]? It
seems cE=typing should support this. However that may mean moving the caret
forward on each new character insert. That implies caret movement. But as
we have seen above caret movement inside an invisible content is
problematic.

[1] https://github.com/w3c/editing-explainer/issues/28

That was just one situation. There could be others. We could spend a long
time defining editor behavior of hidden content. But does it make any
sense? Who does it help?


> [B] An element inside of a contenteditable element that is set to
> "display:none;" will be treated as if it's not there when it comes to caret
> movements. I assume this is both the case for normal, visible
> contenteditable elements, and those not visible as described in A, right?
>

> --
> Johannes Wilm
> Fidus Writer
> http://www.fiduswriter.org
>

Received on Tuesday, 16 December 2014 19:39:22 UTC