Re: [editing] What caret positions do we need to allow? (#51)

> The way it is defined now, it is dependent on CSS. [...] On my part, this was on purpose.

This makes sense to me. But it’s also not impossible to think those are HTML 4/Historical Editing APIs terms, no?

> If you think it's easier to describe caret positions in terms of what is illegal, I'm OK with.

No, it’s a bit different. Some positions will depend on context (CSS-dependent ones, plus what you said about ‘the same position twice’), and some are *always* illegal (those are currently listed as exceptions). I just don’t want those element names be spec’ed explicitly, as that’s a fragile way. The idea is that they cannot accept any text per HTML, therefore they cannot accept the caret per cE=typing, *regardless of their actual names* (that includes `table`, `ul`, `ol`, `dl`, all stubs and whatever we may get in HTML 5.11). Unfortunately, I cannot replace the whole text with a simple line; it’s just that exceptions may be shorter. Do you see what I mean?

> To me at least this limitation doesn't *have* to be there.

In Selection API or in implementations? I mean, Selection API allows nearly anything, it doesn’t give a damn about the caret or editing, and that’s how it should be. For editing, browsers impose restrictions, and so do we, but those are practical limitations, not abstract ones. That’s why I believe *we*, not Selection API, should spec them. Where am I wrong?

> Is that the only exception for text nodes?

One more that comes to mind is what happens to a collapsed whitespace. As multiple whitespace characters render as a single space by default, they should be treated as such by the caret (that’s how it works now, but that’s not spec’ed, again); but if they are visible (e. g. `white-space: pre-wrap`), they are treated as multiple spaces, i. e. the caret moves between them.

> Is there a name for the other text nodes?

Per HTML, the difference between inter-element whitespace and normal text is that normal text is in the ‘Palpable content’ category, while inter-element whitespace is not. Is that what you mean?

> We need to study what existing browsers allow, and document that with some fixes.

Why? What browsers allow varies from implementation to implementation, it’s based exactly on made up rules, for each their own. Gecko’s bucket of still unfixed range bugs is five+ years deep; is it worth documenting, too?

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/51#issuecomment-114809376

Received on Wednesday, 24 June 2015 09:49:54 UTC