-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to specify which input types are handled by EditContext #94
Comments
As I understand the difference between an input type that is on this list and one that is not:
A lot fo the input types will not normally lead to an update to the The selection of input types may seem a bit arbitrary, almost no matter what one chooses. It looks like the criteria that has been used for this selection was:
This selection follows a certain logic. However, this still gives me a few more input types than what are currently selected, namely:
Question: Would it be an option to not have any of the input types auto-update the |
Minutes from the April WG meeting:
|
Going through each inputType defined at https://w3c.github.io/input-events/#interface-InputEvent-Attributes:
For the most part what my analysis of which commands EditContext should support matches what’s already been implemented in Chromium. One exception is “insertTranspose”, which EditContext could support, but the interoperability status of the “insertTranspose” is not clear. It exists under the name “transpose” in Chromium. In WebKit “insertTranspose” doesn’t exist -- not sure about “transpose” – and neither work in Firefox. I guess for browsers that implement it, under whatever name, EditContext should support it. There's also a caveat about “deleteContent”. This is probably a candidate for EditContext to support, but contrary to my first comment in this thread, that command doesn’t actually exist in Chromium (only "deleteContentForward"/"deleteContentBackward" exist). Looks like Firefox also does not support it, but WebKit maybe does? In any case the spec should probably indicate it as supported by EditContext for browsers who implement the command. |
The Web Editing Working Group just discussed The full IRC log of that discussion<sanketj_> Topic: Need to specify which input types are handled by EditContext<sanketj_> github: https://github.com//issues/94 <sanketj_> dandclark: Issue is about which input types should be handled by EditContext <sanketj_> ...: Ie. which which input types should change the text store and fire the textchange event <sanketj_> ...: Unhandled types don't reflect in text store or event dispatch, authors need to handle this on their own <sanketj_> ...: Chromium implement 5 of them (see issue) <sanketj_> ...: Ask from last time was to inventory and check if there are any missing/incorrect ones. <sanketj_> ...: Mostly right. insertTranspose is probably one that we should handle. <sanketj_> ...: Not great interop on this one. Chromium and Safari use different names, and Firefox doesn't seem to implement. <sanketj_> ...: However, should probably still include this in the supported list. <sanketj_> ...: Similar caveat about deleteContent. Lack of interop. <sanketj_> ...: In any case, deleteContent should also be added to the supported list. <dandclark> https://w3c.github.io/input-events/#event-type-beforeinput <sanketj_> ...: Propose that list of supported commands should be in the EditContext spec. EditContext dispatch conditions, based on input types, should go into input events. <sanketj_> johanneswilm: Is there an input type in Chromium called "transpose"? <sanketj_> dandclark: It is an execCommand. <sanketj_> johanneswilm: Input types prefixed so that JS can clearly tell what happened and can be handled differently. <sanketj_> ...: If really there is an input type that is not prefixed, that's a bug and should be fixed. <sanketj_> ...: But execCommand may be different. <sanketj_> dandclark: That's right. transpose is just the execCommand name. Input type for input event is insertTranspose. <sanketj_> ...: Seems to only be invokable via execCommand <sanketj_> johanneswilm: Is there not a keyboard shortcut? <sanketj_> dandclark: Not sure. <sanketj_> ...: In any case, input type does exist and anything that invokes that input type should be supported by EditContext. <sanketj_> ...: Missed adding this earlier. <sanketj_> johanneswilm: Sounds good. <sanketj_> smaug: What about insertFromPasteAsQuotation? Supported in Firefox. <sanketj_> dandclark: Copy/paste and clipboard related commands not included. <sanketj_> johanneswilm: Will we explain what is supported and how they were chosen? <sanketj_> dandclark: We can spec the fixed list and add some explanatory spec that describes the criteria used. <sanketj_> johanneswilm: Sounds good to me. <sanketj_> johanneswilm: Resolved to accept Dan's proposal. |
EditContext doesn't fire
textupdate
for everyinputType
. E.g. EditContext will firetextupdate
for"insertText"
but not for"formatBold"
. However this behavior doesn't actually seem to be in the spec.It seems that it should be added to either the EditContext bullet point of https://w3c.github.io/input-events/#event-definitions or to https://w3c.github.io/edit-context/#dfn-handle-input-for-editcontext.
While we work this out, it would be a good time to review that we're sending the correct
inputType
s to EditContext.In the Chromium's implementation the list is:
"insertText"
"deleteContent"
·"deleteWordBackward"
"deleteWordForward"
"deleteContentBackward"
"deleteContentForward"
The intention here is that EditContext only handles changes that make sense for plain text, so things like bold/italic/underline are excluded. An interesting case to consider is that currently the Enter key is not handled by EditContext, because formatting for commands like
"insertLineBreak"
or"insertParagraph"
can be nontrivial in rich text.The text was updated successfully, but these errors were encountered: