WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
42805
TextEvent should have inputMode property
https://bugs.webkit.org/show_bug.cgi?id=42805
Summary
TextEvent should have inputMode property
Hajime Morrita
Reported
2010-07-21 21:52:57 PDT
DOM Level3 standard defines inputMode property on TextEvent object.
http://www.w3.org/TR/DOM-Level-3-Events/#events-textevents
So we should have it.
Attachments
Patch
(15.37 KB, patch)
2010-07-22 18:31 PDT
,
Hajime Morrita
ap
: review-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2010-07-22 16:46:05 PDT
Hmm. Is there any way we could possibly implement it?
Hajime Morrita
Comment 2
2010-07-22 18:31:19 PDT
Created
attachment 62370
[details]
Patch
Hajime Morrita
Comment 3
2010-07-22 18:34:44 PDT
> Hmm. Is there any way we could possibly implement it?
Sure, there is some limitation actually because our browsers has no way to distinguish voice/hand-writing based input from normal IME-based input like kotoeri. I'm doing this because we have a plan to fire textInput event for pasting and dropping, and we would like to distinguish them from key input / ime input.
Alexey Proskuryakov
Comment 4
2010-07-22 18:52:04 PDT
I don't see how such a distinction makes sense. Specifically, on a Mac there is no way to tell that input comes from an input method (a custom key binding can send insertText: just as well). What is the high level goal here? Maybe it can be achieved in a different way.
Hajime Morrita
Comment 5
2010-07-22 19:16:21 PDT
Thank you sharing your thought.
> I don't see how such a distinction makes sense. Specifically, on a Mac there is no way to tell that input comes from an input method (a custom key binding can send insertText: just as well). > > What is the high level goal here? Maybe it can be achieved in a different way.
One of our goal is to support rich-text editor implementation and to do so, we'd like to provide a way to hook text inputs that is allowed by WebKit currently, i.e. pasting and dropping. Because pasting/dropping would have HTML fragment, it might be helpful to distinguish them from plain text input. (BTW, the standard says nothing how we should handle such HTML fragment in TextEvent.data property so we need discuss it anyway.)
Alexey Proskuryakov
Comment 6
2010-07-22 20:29:29 PDT
Comment on
attachment 62370
[details]
Patch Pasting and dropping can be distinguished from other input - in fact, we already have such a distinction, see EditorInsertAction.h in WebCore. We don't expose that to JS code as far as I know, and it may be useful indeed. However, please note that text added via insertText: can also be styled - the caller can always pass an NSAttributedString there. I'm marking the patch r-, as I don't see why we would want to expose all the other options currently in DOM 3 events.
Hajime Morrita
Comment 7
2010-07-22 21:59:30 PDT
Hi, thank you for taking a look!
> Pasting and dropping can be distinguished from other input - in fact, we already have such a distinction, see EditorInsertAction.h in WebCore. We don't expose that to JS code as far as I know, and it may be useful indeed.
Sure, we'd like to distinguish them from JS world because our goal is implementing rich text editors in JavaScript. So distinguish them in WebCore isn't enough. Thank you for letting me know. I should refer there to add paste/drop events.
> > However, please note that text added via insertText: can also be styled - the caller can always pass an NSAttributedString there.
Wow, I didn't notice tha so I'm taking a look. It looks that current implementation only handles a specific type of attributed string that is given by an IME implementation (according to a comment there). So It looks we don't need to handle a generic case. (What I checked is [WebHTMLView insertText].)
> > I'm marking the patch r-, as I don't see why we would want to expose all the other options currently in DOM 3 events.
OK. I'll ask some webdev people what they exactly want. And try to add pasting/dropping event at first, which are required anyway.
Ojan Vafai
Comment 8
2010-07-26 17:37:38 PDT
> > I'm marking the patch r-, as I don't see why we would want to expose all the other options currently in DOM 3 events. > OK. I'll ask some webdev people what they exactly want. > And try to add pasting/dropping event at first, which are required anyway.
I agree with Alexey, the other inputModes are not very useful and likely hard to implement. I think we should go ahead just with paste and drop. We should also make a proposal for more reasonable list of inputModes, but we should wait until the current discussion on www-dom about converting textInput to beforeInput is resolved since that greatly affects what should go on that list.
Hajime Morrita
Comment 9
2011-11-22 00:57:09 PST
Closing this since DOM3 evolution is fading out and DOM4 is coming. And we don't have any consensus to implement this. Someone may reopen this when there is clear demand for the feature.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug