This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22028 - Consider adding hasComposition() in InputMethodContext
Summary: Consider adding hasComposition() in InputMethodContext
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - IME API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Takayoshi Kochi
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-14 10:11 UTC by Takayoshi Kochi
Modified: 2013-12-03 02:33 UTC (History)
6 users (show)

See Also:


Attachments

Description Takayoshi Kochi 2013-05-14 10:11:14 UTC
As proposed by Microsoft:
https://dvcs.w3.org/hg/ime-api/raw-file/tip/proposals/IMEProposal.html#methods-1

consider adding hasComposition() interface in InputMethodContext.

One clarification:
If compositionText is empty, hasComposition() return true?

If so, hasComposition() may not be necessary and you can only need compositionText.
If not, in what case compositionText is empty but hasComposition() returns true,
or compositionText is non-empty but hasComposition() returns false?
Comment 1 Travis Leithead [MSFT] 2013-05-28 22:02:21 UTC
There’re some cases where compositionText is empty but hasComposition() should return true, for example if you try the inbox Chinese Simplified IME on the desktop of Windows 8, you’ll see that it doesn’t compose inline. The string being composed is shown inside the candidate window, one line above the candidates. In this case we return compositionText as empty, but the composition is going on, so hasComposition() is true. Web apps can call getCompositionAlternatives() to find out what’s being composed.
Comment 2 Takayoshi Kochi 2013-07-04 07:31:19 UTC
Why don't you return the text being composed in the candidate window as
compositiontext?
Comment 3 Travis Leithead [MSFT] 2013-08-20 18:08:59 UTC
From one of our Windows Developers (Brendan):

There’s no standard Windows API to obtain the value of an offline composition string (Cicero knows nothing about it); I’ve seen extremely hacky code samples for known Windows IMEs in the IMM32-era, but there’s no chance we could get that to work for 3rd party IMEs.  Due to Windows platform/ecosystem limitations I think we’d rather keep this. Or we have to define what the values of ‘null’ vs. ‘empty string’ are if we want to do it purely based on compositionText.
Comment 4 Takayoshi Kochi 2013-10-10 06:07:32 UTC
What's the expected usage scenario for checking emptiness of the composition string?

The most common usage of composition text is to get the value when compositionupdate event happens, and existence of some text is expected.

During the time between compositionend and compositionstart, no text is expected.

Do you see any use case that you use IME API without composition events?
Comment 5 Jianfeng Lin 2013-10-22 01:33:36 UTC
We don't have scenario to use IME API outside composition events. Having a "hasComposition" property is an easier way than tracking that compositionstart event was fired and a matching compositionend event hasn't' been fired.

As mentioned above, in offline composition the compositiontext would be empty even though the text is being composed in the IME window. We would love to expose it through compositiontext, but due to limitation of our platform we can't.
Comment 6 Takayoshi Kochi 2013-11-06 04:40:35 UTC
Thanks, now I understand the technical reason hasComposition() has to exist,
but without any concrete use case, I'm hesitant to incorporate this in InputMehtodContext (or Composition) interface.

Do you imagine a use case similar to oncandidatewindowshow/hide?
i.e. when a non-inline composition starts, suppress web suggest dropdown
which may overlap the offline composition UI?  I'm still not sure
you can catch when it starts, as hasComposition() is not an event.
polling?
Comment 7 Jianfeng Lin 2013-12-03 02:33:53 UTC
After some discussion we agree with not having this function in the API, so as to simplify the API set, as this function is equivalent to a local variant that tracks the history of compositionstart/end events.