- From: Johannes Wilm <notifications@github.com>
- Date: Sun, 31 Jul 2016 21:18:16 -0700
- To: w3c/editing <editing@noreply.github.com>
- Message-ID: <w3c/editing/issues/133/236486003@github.com>
> For an image, it is relatively unanbiguous. However, let's say the thing just before the caret is a table. Should the range contain the table? the last table cell? the last character in the last table cell? When moving away from exec command into JS driven things, this is precisely the kind of thing we want to leave up to JS. Well, execCommand isn't used today anyway, at least not for this. Right now one will listen for the keypresses that may cause deletion in either direction, then check what is in the direction that the deletion is to take place. In some cases, some editors then allow for the browser to do what it wants to do (for example because it determined there is just a character in front of it, and it trusts the browser to deal with that). If the caret is behind a table, it would usually delete the entire table. There may be some browser inconsistencies with this that I am unaware off, but those we will not fix right now. Some browsers could indeed be so broken in every respect that one just chooses to completely ignore everything that the browser says about what it would do. But this would then likely apply both to table deletion as well as codepoint deletion. > If instead we make it super easy to distinguish "this is just text deletion, and this range is one character worth of text", and "there's some markup in there, do your own thinking", we may increase the chance of naïve implementations getting text right. If the range start-node and end node are the same and this node is a text node, we know it's character deletion. In all other cases it will be something else, right? Additionally, we should probably add examples of this to the spec to make it clearer to everyone. The function you are asking for may have more usecases though. Basically it would be about turning a string of unicode characters into an array of graphemes. This could be used if, for example, one wants to do grapheme deletion using backspace under all circumstances. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/editing/issues/133#issuecomment-236486003
Received on Monday, 1 August 2016 04:18:49 UTC