Граф коммитов

153 Коммитов

Автор SHA1 Сообщение Дата
Srujana Peddinti b44e48bff4 Bug 1259660 - Moved mozilla::WidgetMosueEventBase::buttonType in MouseEvents.h to mozilla::MouseButton in EventForwards.h, and mozilla::WidgetMouseEventBase::buttonsFlag to mozilla::MouseButtonsFlag r=masayuki
Moved mozilla::WidgetMosueEventBase::buttonType in MouseEvents.h to mozilla::MouseButton in EventForwards.h, and mozilla::WidgetMouseEventBase::buttonsFlag to mozilla::MouseButtonsFlag so that any referer in header files do not need to include MouseEvents.h only for referring them. Instead, they just need to include EventForwards.h. Now when MouseEvents.h is changed, the rebuild speed becomes faster.

Differential Revision: https://phabricator.services.mozilla.com/D25325

--HG--
extra : moz-landing-system : lando
2019-04-21 20:13:34 +00:00
Masayuki Nakano 682a4d56d1 Bug 1504963 - part 3: Make TSFTextStore create native caret when it gets notified of content change r=Jamie,m_kato
If WM_GETOBJECT for OBJID_CARET is received but a11y module is not active,
IME module should create native caret over our caret because Windows will
handle the request with native caret automatically and we don't need to
enable a11y module only for it.

This patch makes IMEHandler store whether such message has been received and
makes TSFTextStore create native caret when composition, selection or layout
is changed because especially when there is composition, only TSFTextStore
knows correct position to put caret if there is composition or some dispatched
events have not been handled by content process yet.

Note that IMMHandler already does that since some legacy IMEs require native
caret to show its UI and we cannot check active IME strictly.  Therefore, this
patch does not touch IMMHandler.

Differential Revision: https://phabricator.services.mozilla.com/D13961

--HG--
extra : moz-landing-system : lando
2018-12-18 08:38:23 +00:00
Masayuki Nakano 55978ba309 Bug 1504963 - part 2: Make IMEHandler manage whether native caret is created by it r=m_kato
IMEHandler needs to create native caret later (when there is no composition).
Therefore, IMEHandler should manage whether it creates native caret or not
and IMMHandler and TSFTextStore should create/destroy native caret via
IMEHandler.

Note that this patch makes IMMHandler stops managing whether native caret
is created for plugin or not because native caret is created only one instance
and anyway IME handlers should stop managing native caret when they loses
focus.

Differential Revision: https://phabricator.services.mozilla.com/D13960

--HG--
extra : moz-landing-system : lando
2018-12-18 08:38:22 +00:00
Masayuki Nakano fd2f9270a7 Bug 1504963 - part 1: Make IME modules not touch native caret if a11y module handles native caret r=Jamie,m_kato
If a11y module is active, it observers caret position and size, and when caret
position or size is changed, it creates/moves native caret to overlap with
our caret.

On the other hand, IME module also creates native caret if active IME requires
it.  Therefore, both of them conflicts each other.

This patch makes IME module stop touching native caret if a11y module is active.

Although, a11y module with Flush Player does not work well for IME.  Therefore,
this patch keeps the conflict between them as-is for now.

Differential Revision: https://phabricator.services.mozilla.com/D13959

--HG--
extra : moz-landing-system : lando
2018-12-18 10:40:50 +00:00
Masayuki Nakano 586ba79d72 Bug 1513145 - Make some callers of TSFTextStore::Selection::GetWritingMode() check whether the selection has already been initialized r=m_kato
If TSFTextStore fails to get selection, e.g., the content is really odd like
fuzzing tests, its mSelectionForTSF is marked as dirty.  However, Windows may
try to retrieve writing mode while we're creating new TSFTextStore. Then, we
may hit MOZ_ASSERT(!mDirty) in TSFTextStore::Selection::GetWritingMode() in
debug build.

So, we need to make some callers of GetWritingMode() check whether selection
is marked as dirty.

Differential Revision: https://phabricator.services.mozilla.com/D14137

--HG--
extra : moz-landing-system : lando
2018-12-15 03:23:38 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Makoto Kato 82b98972c8 Bug 1488803 - Don't allocate PendingAction twice. r=masayuki
--HG--
extra : histedit_source : 2197a1ddf204b19e1ecd3cf5142fe22e0a2aa04e
2018-09-14 15:23:32 +09:00
Masayuki Nakano 8da2dfcf57 Bug 1481148 - Make TSFTextStore::MaybeHackNoErrorLayoutBugs() keep hacking the result of GetTextExt() even on Win10 build 17643 and later for ATOK 2016 and newer r=m_kato
ATOK 2016 and newer may show candidate window at odd position temporarily
when user converts a word quickly (e.g., keep pressing space bar).
For avoiding this flicker, we should keep hacking GetTextExt() result for
ATOK 2016 and later even after Windows fixes TS_E_NOLAYOUT bug.
2018-08-07 15:56:17 +09:00
Masayuki Nakano a5cfed23c5 Bug 1481153 - part 4: Should stop hacking the result of TSFTextStore::GetTextExt() when Win10 build 17643 only in Nightly or early Beta r=m_kato
We should get feedback from each CJKT testers at least one cycle after Win10
RS5 is released.  Until then, we should not stop hacking GetTextExt() result
in late Beta nor Release builds.
2018-08-07 21:30:52 +09:00
Masayuki Nakano d928c7f7e1 Bug 1481153 - part 3: Make TSFTextStore::MaybeHackNoErrorLayoutBugs() hack even on Win10 build 17643 or later when Microsoft Pinyin or Microsoft Wubi is active r=m_kato
Microsoft Pinyin and Microsoft Wubi (Simplified Chinese TIPs) work better on
Windows 10 Build 17643 or later (i.e., TS_E_NOLAYOUT bug is fixed).  However,
they sometimes do not show candidate window, perhaps, the reason is something
stateful bug in them.  Therefore, we still need to hack the result of
GetTextExt() until they fix this bug.
2018-08-07 15:09:31 +09:00
Masayuki Nakano 4cb7504106 Bug 1481153 - part 2: Rewrite TSFTextStore::MaybeHackNoErrorLayoutBugs() with switch-case statement with TSFStaticSink::ActiveTIP() r=m_kato
Currently, TSFTextStore::MaybeHackNoErrorLayoutBugs() checks pref to enable
hack first, then, check if active TIP is the target of pref.  This was intended
to save comparison cost of GUIDs.  However, we don't need to worry about the
cost and that was not makes sense since all prefs are true by default.

So, this patch makes the big if-elseif blocks with switch-case with
TSFStaticSink::ActiveTIP().  Then, each case block starts to check if
- if Windows still TS_E_NOLAYOUT bug of GetTextExt().
- if corresponding pref is true.

Note that this duplicates some code for making the code look easier.
E.g., eMicrosoftOfficeIME2010ForJapanese case is duplicated from
the eMicrosoftIMEForJapanese case.  eMicrosoftPinyin and eMicrosoftWubi case
is duplicated from the eMicrosoftChangJie and eMicrosoftQuick case.
2018-08-07 14:12:13 +09:00
Masayuki Nakano 1bb7f99732 Bug 1481153 - part 1: Make TSFStaticSink cache active TIP rather than checking it every time with GUID comparison r=m_kato
As we know, GUID comparison is not cheap if it's required a lot.  Unfortunately,
we need to check it more in TSFTextStore::MaybeHackNoErrorLayoutBugs() and
it's called a lot.  So, even though mapping from GUID to TIP is expensive,
we should do it only once.  Note that most users won't change IME during a
browser session, so, running this expensive method once must be reasonable.
On the other hand, we don't allow to make damage to start up performance,
we should avoid to do it as far as possible.  For example, when we need to
check if active TIP is a specific TIP, we should check current language.
2018-08-06 22:29:14 +09:00
Masayuki Nakano 2552597ed2 Bug 1467373 - part 2: Skip hacks for most TIPs in TSFTextStore::HackNoErrorLayoutBugs() if running on Windows 10 build 17643 or newer r=m_kato
At Windows 10 build 17643, Microsoft fixed the bug of TSF which returns E_FAIL
to TIP when GetTextExt() returns TS_E_NOLAYOUT.  With this fix, most TIPs do
not have any problems even if we return TS_E_NOLAYOUT.  So, unless active
TIP still needs the hack, the method can skip the hack if running on build
17643 or later.

Note that we still need to support Japanist 10 and Microsoft Office IME 2010.
It confirmed that Japanist 10 has a bug of handling TS_E_NOLAYOUT.  On the
other hand, we have not tested Microsoft Office IME 2010 since it's installable
only into Win7 or Win8 and needs to upgrade it to Win10 for testing, but I
do not have the license.  After the fix comes into release channel, I'll be
able to test it though (my main environment is Win10 and it was installed
before upgraded).  So, we need to be back after Microsoft releases the fix.

MozReview-Commit-ID: 2BzkDvHTKyI

--HG--
extra : rebase_source : ee0261c83c5a1ab7b2aa2a8f476f0c6634e2cf34
2018-08-02 14:55:52 +09:00
Masayuki Nakano 34ee9cefe7 Bug 1467373 - part 1: Split hack for TS_E_NOLAYOUT part from TSFTextStore::GetTextExt() r=m_kato
The block in TSFTextStore::GetTextExt() which decides whether we should return
S_OK with unmodified character rectangle rather than TS_E_NOLAYOUT is too big.

Additionally, we need to add new condition to check Windows 10's version there.
That makes the large block more complicated.  So, we should split the block
off from TSFTextStore::GetTextExt().  Then, we can use early-return-style to
reduce the deep indentations.

MozReview-Commit-ID: J2BJMB1QD0T

--HG--
extra : rebase_source : 3c86b5ed3a83fda1045a6453250e784f11419b97
2018-08-02 14:36:03 +09:00
Xidorn Quan c6926db959 Bug 1476477 - Replace nsAutoCString with nsCString for local result variables in windows widget. r=masayuki
MozReview-Commit-ID: JN6GVPTZNg2

--HG--
extra : rebase_source : f3b997f3b8fbcefd2de660158f336364282ef2f6
2018-07-18 10:44:00 +10:00
Masayuki Nakano bb49027e6b Bug 1475153 - Make TSFTextStore::RecordCompositionStartAction() merge new composition with previous composition if IME commits composition and restart composition to replace the previous commit string r=m_kato
When user removes all composition string of MS Pinyin, MS Wubi, MS ChangJie and
MS Quick with Backspace key, IME commits last character temporarily and
restart composition to replace the last character with empty string when
user tries to remove last one character.

This causes flicking composition string because the additional composition
selects the character and it may be painted immediately before removed, and
also editor will have unnecessary undo transaction.

Therefore, as same as bug 1208043, TSFTextStore::RecordCompositionStartAction()
should restart last composition in such case.  Fortunately, we implemented
similar code for bug 1208043, however, unfortunately, we don't have preceding
pending compositionstart in this case.  Therefore, this patch makes
pending compositionend store start offset of composition.  Then, we can
restart composition only with information stored by pending compositionend
action.  Additionally, this patch renames the method checking pending
actions for self-describing the new meaning.

MozReview-Commit-ID: 1RyuacxEbky

--HG--
extra : rebase_source : 1c8ecc0b63114ae65c77cd76cb85a21d2716442c
2018-07-12 22:40:07 +09:00
Masayuki Nakano d7023e18b8 Bug 1215818 - part 1: Add telemetry probe to collect TIP names of TSF which are actually used by the users r=jimm,m_kato
We always struggle with a lot of IME bugs on Windows.  Currently, any IME
vendors should've already released TIP for TSF rather than legacy IMM-IME
since IMM-IME is not available on UWP apps.  Additionally, due to API
limitation, it's difficult to get human-friendly name of IMM-IME.  So, let's
collect only TIP names of TSF on Windows.  This must be enough.

Note that we cannot get common-English name even though the API to retrieve
TIP name taking language code.  Therefore, a TIP may be collected with
different name, e.g., one is Japanese name and the other is English name.
If we collect GUIDs of TIP, we can avoid this issue.  However, it's
difficult to collect both GUID and human-friendly name since Telemetry
key is up to 72 characters.

Currently, I give up to avoid this duplicated issue.  Perhaps, this is not
so serious issue since most TIP users must match language of TIP and their
system language settings.  Therefore, this patch collects Locale ID of
TIP and description of it.  Locale ID is necessary because some TIPs may be
named same name for different languages.  For example, both Japanese and
Hangul IMEs of Microsoft are named as "Microsoft IME".

MozReview-Commit-ID: IeSxfeqS62a

--HG--
extra : rebase_source : b269ce3c41f7a998193972afb31183a61d3948be
2018-06-19 21:00:01 +09:00
Masayuki Nakano fe7c9f7c32 Bug 1468917 - part 2: TSFTextStore::GetTextExt() shouldn't return TS_E_NOLAYOUT when ATOK retrieves text rects *in* the composition string r=m_kato
Currently, TSFTextStore::GetTextExt() won't return TS_E_NOLAYOUT error when
ATOK retrieves text rect of all of the composition string.

However, if user converts 2nd or later clause, ATOK retrieves text rect after
start of the character of selected clause.  Returning TS_E_NOLAYOUT in this
case causes candidate window being positioned temporarily below first character
of the composition string.

For avoiding the flicker of the candidate window, TSFTextStore::GetTextExt()
shouldn't return TS_E_NOLAYOUT when ATOK retrieves text rects *in* the
composition string.

MozReview-Commit-ID: Cp17HmP2QGK

--HG--
extra : rebase_source : bdd2d2867cccdcf1fe39612ca2f52872d472cb7a
2018-06-22 18:43:40 +09:00
Masayuki Nakano 9c693d932d Bug 1468917 - part 1: Make TSFTextStore not create native caret if ATOK 2016 is active r=m_kato
Old ATOK referred native caret position to decide its candidate window position.
However, at least ATOK 2016 does not need to refer it.  Additionally, if we
create native caret for ATOK 2016, the candidate window position, ATOK 2016
refers the native caret only when we cannot return expected rect.  Therefore,
only immediately after modifying composition string, the position is different
from actual position by a couple of pixels and that looks like flicks the
candidate window.

So, we should stop creating native caret for ATOK 2016 (as same as ATOK 2017).

MozReview-Commit-ID: LsmVXCmRIzc

--HG--
extra : rebase_source : 30b7d15cb23e567b14e1231909aa5a17bdf909a6
2018-06-21 19:57:58 +09:00
Masayuki Nakano 19af69cf33 Bug 1456381 - TSFTextStore should discard pending composition update actions before recording composition end action r=m_kato
TSFTextStore should discard pending composition update actions when it records
end composition update action because end composition update action causes
dispatching eCompositionCommit event and it replaces old composition string
anyway.  So, following eCompositionChange which is dispatched by preceding
composition update actions are just redundant.

MozReview-Commit-ID: HBHx2jA15ro

--HG--
extra : rebase_source : 74d1e91d73bf9c8182a9c5e3fd55d052d8ec4bea
2018-04-19 20:42:00 +09:00
Masayuki Nakano e9d257856b Bug 1448282 - TSFTextStore should append a pending action for dispatching keyboard event into the queue if OnUpdateComposition() is called without new range r=m_kato
OnUpdateComposition() may be called without new range instance by some TIPs
when they starts to modify composition string.  At this timing, TSFTextStore
should append a pending action for dispatching keyboard event into the queue.
Without this patch, OnUpdateComposition() creates incomplete pending action
for composition update and then, MaybeDispatchKeyboardEventAsProcessedByIME()
appends pending action for dispatching keyboard event from another point
immediately (e.g., from SetText()), then, finally, the caller of
MaybeDispatchKeyboardEventAsProcessedByIME() appends another pending action
for composition update with proper composition string.  Therefore, the
first pending action for composition update clears composition string before
actually updating it with new composition string.  In other words, new
pending action for dispatching keyboard event splits a pending composition
update.  So, this patch prevents the splitting.

MozReview-Commit-ID: 9pYO9pm3Vh9

--HG--
extra : rebase_source : a8fb903174c0f1af61a71175dbbf01b7b1c5cb53
2018-03-26 15:07:59 +09:00
Miko Mynttinen 65c6bee9d6 Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj
MozReview-Commit-ID: rGjabnP2iz

--HG--
extra : rebase_source : 1ef6c5ce028ac9ebd9f3176d57835c43fe46bada
2018-03-13 14:51:33 +01:00
Masayuki Nakano f54903a9ee Bug 1259692 - Make TSFTextStore dispatch eKeyDown or eKeyUp event when TIP processes a WM_KEYDOWN or WM_KEYUP message r=m_kato
TSF doesn't send WM_KEYDOWN nor WM_KEYUP to us while it handles a key message
with ITfKeystrokeMgr::KeyDown() or ITfKeystrokeMgr::KeyUp().  Therefore,
TSFTextStore needs to store handling key event message during calling
those methods and if it does something, we need to dispatch eKeyDown event
or eKeyUp event before dispatching any events.

However, we shouldn't dispatch WidgetKeyboardEvent during a document lock
because TSF/TIP do not assume that document is broken during a document lock.
Therefore, TSFTextStore needs to put it as a pending action into the queue.

So, this patch wraps this with
TSFTextStore::MaybeDispatchKeyboardEventAsProcessedByIME().  It checks if
there is a document lock when it's called.  If it's locked (and not yet
dispatched keyboard event for the handling key message), it adds pending
action to dispatch keyboard event later.  Otherwise, (and not yet dispatched
one), it dispatches keyboard event directly.

MozReview-Commit-ID: 9rJTJykVLyf

--HG--
extra : rebase_source : 4f8297b2b9fe2905e4cd1f64086fcdbe3d0b6035
2018-02-28 21:53:23 +09:00
Masayuki Nakano 60854caf9b Bug 1440215 - TSFTextStore::FlushPendingActions() doesn't dispatch eSetSelection event r=m_kato
Although we haven't any bug reports caused by this, this is a really old bug.

When we implement TSFTextStore, we decided to use queue of dispatching
events and flush it when document lock is unlocked.  When we implement the
queue, we got this regression.

When TSFTextStore::SetText() is called with different range from current
selection range, TSFTextStore::SetSelectionInternal() add
PendingAction::SET_SELECTION into the queue first for replacing existing
text or inserting text into different position if there is no composition.
Then, TSFTextStore::InsertTextAtSelectionInternal() inserts text at the new
selection range.

When TSFTextStore::FlushPendingActions() is called after that, eSetSelection
should be dispatched and then, new text is inserted wit a set of composition
events.  However, we forgot to dispatch creating eSetSelection event.

So, this patch just dispatches the event.

MozReview-Commit-ID: Hw8FTB1R5kR

--HG--
extra : rebase_source : 8a119f1f48b167d9423fc89ce0efc722313c3732
2018-02-22 15:30:58 +09:00
Masayuki Nakano b00776035f Bug 1435730 - part 2: TSFTextStore::GetTextExt() shouldn't adjust acpStart to start of composition string if ContentCacheInParent perhaps has some character rects in composition string r=m_kato
The renaming problem is, when I try to convert 2nd or later clause of
composition string with Japanist 10, it shows candidate window below the
start of composition string first, then, it moves candidate window to
below the selected clause.  This is caused by our bug of the hack in
TSFTextStore::GetTextExt().

First, we compute wrong minimum modified
offset of mContentForTSF.  It stores last composition string when it's
initialized.  Then, when a part of composition string is modified, it
sets minimum modified offset with the last composition string.  However,
we don't update it when we receive notifications from content which means
all dispatched composition events are handled in content and
ContentCacheInParent stores character rects at least in this time.  So,
this patch adds TSFTextStore::Content::OnCompositionEventsHandled() to
update the last composition string.

Next, TSFTextStore::GetTextExt() always adjusts acpStart to start of
composition string when acpStart is larger than composition start.
However, this causes this remaining problem.  If ContentCacheInParent
stores character rects of even older composition string, we should use
it as far as possible.  This must not be problem in most cases since
most Chinese characters and Japanese Kana characters have same width.

This touches share code of the hack between any TIPs.  However, this must
not be risky because this patch just reduces amount of adjusting acpStart
offset in safe range.

MozReview-Commit-ID: KlDeaGa26UG

--HG--
extra : rebase_source : 6d906f9810b8e067018f7ff3ab2fd31f5bef49f6
2018-02-06 21:59:52 +09:00
Masayuki Nakano d6f1c6f7dd Bug 1435730 - part 1: Make TSFTextStore::GetTextExt() not return TS_E_NOLAYOUT error to Japanist 10 when the range is in composition string r=m_kato
Similar to ATOK, Japanist 10 requests all or part of composition string.
If we return TS_E_NOLAYOUT in this case, you'll see candidate window at
top-left of the screen.

For avoiding this issue, we should not return TS_E_NOLAYOUT to Japanist 10
when the query range is in composition string.

MozReview-Commit-ID: 2OPafUO5PQC

--HG--
extra : rebase_source : bd7a594d8d3540374d61860651b69528aa6e3793
2018-02-06 14:45:22 +09:00
Masayuki Nakano 34b1964a5b Bug 1435701 - Make TSFStaticSink::IsATOKActiveInternal() aware of ATOK Passport r=m_kato
TIP name of ATOK Passport's ATOK 31.1.2 is just "ATOK", not "ATOK " + release
year.  Therefore, TSFStaticSink::IsATOKActiveInternal() returns false when
new ATOK is active.  This patch updates it.

Additionally, this patch adds GUID list of new Japanese TIPs with comment.
They should be useful when somebody needs to add hack for them.

MozReview-Commit-ID: 6L5SjWEK6i0

--HG--
extra : rebase_source : e3ac9eb1377ee9143a4e2e9fa2ce4be98983bb4b
2018-02-05 22:29:03 +09:00
Masayuki Nakano e8c2ae6847 Bug 1422230 - part 4: TSFTextStore::GetTextExt() should refer composition string in content r=m_kato
Currently, TSFTextStore::GetTextExt() refers mComposition for doing its own
hack.  However, this means that it refers composition in TIP.  However,
query event is computed with content information.  So, even if TSFTextStore
dispatched eCompositionCommit event, it may not be handled by content yet.

In this case, we need information relative to last composition string.
So, TSFTextStore::GetTextExt() should refer IsHandlingComposition() and
last composition string information stored by mContentForTSF.

MozReview-Commit-ID: KMqrDmnUldU

--HG--
extra : rebase_source : cea97c9e9117028913cf45e4dc1e83e2b4f102e9
2018-01-12 15:31:04 +09:00
Masayuki Nakano c1ed5bb499 Bug 1422230 - part 3: TSFTextStore should store composition string information until both TSF/TIP and our content finish handling composition r=m_kato
If remote process hasn't handled dispatched commit event yet, TSFTextStore
needs to dispatch query content event relative to latest composition string
information.  So, TSFTextStore::mContentForTSF should cache composition start
and composition string length until pending composition events are handled
by content actually.

MozReview-Commit-ID: ARM851nNZGz

--HG--
extra : rebase_source : d4f1ddb197d3168f2db52849b2982779c388e2e8
2018-01-12 15:23:43 +09:00
Masayuki Nakano 0674b4fc1f Bug 1422230 - part 1: TextEventDispatcher should manage if dispatched composition events have been handled by remote content and TSFTextStore refer the state r=m_kato
When composition events are handled by content actually, widget receives
NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED notification.  If focused content
is in a remote process, this is notified only when all sending composition
events are handled in the remote process.  So, when widget receives the
notification can there is no composition in IME, that means that nobody is
composing composition at that time.

This patch adds TextEventDispatcher::IsHandlingComposition() which returns
false only when nobody has composition and makes TSFTextStore refer this
method because TSFTextStore needs to know if focused content has composition
in any cases.

MozReview-Commit-ID: F1ZZgFJAArD

--HG--
extra : rebase_source : 65e7f592e0ffd1c516e4dab16ab4ca8d7171f954
2018-01-12 11:31:53 +09:00
Milan Sreckovic bd27b86da3 Bug 1423559: Use BaseRect access methods instead of member variables in widget/ r=mstange
MozReview-Commit-ID: AqnztoUbsmk

--HG--
extra : rebase_source : 76a232a08b42ed73b4922c03bc0f2e9d1769203b
2018-01-10 11:14:16 -05:00
Masayuki Nakano 6b9a0451ae Bug 1420215 - Make TSFTextStore set input scope of URL bar to IS_DEFAULT when some Microsoft's Trandtional and Simplified Chinese IMEs and some Microsoft's Korean IMEs which change their open state to "closed" when input scope is IS_URL r=m_kato
This patch adds following Microsoft's IMEs into the black list which set
their open state to "closed" when input scope is set to IS_URL and sets
input scope for the URL bar to IS_DEFAULT.

Additionally, this adds a new pref to disable this hack because a lot of
users will affect this hack but perhaps, somebody may not like this if
they use tablet.

The new black listed IMEs:
 - Microsoft Bopomofo
 - Microsoft ChangJie
 - Microsoft Phonetic
 - Microsoft Quick
 - Microsoft New ChangJie
 - Microsoft New Phonetic
 - Microsoft New Quick
 - Microsoft Pinyin
 - Microsoft Pinyin New Experience Input Style
 - Microsoft Wubi
 - Microsoft IME for Korean (except on Win7)
 - Microsoft Old Hangul

MozReview-Commit-ID: BwJKFcu80B8

--HG--
extra : rebase_source : 75aeed04504b476520102984ab6e7875c98b36c8
2017-12-19 13:13:45 +09:00
Sylvestre Ledru d60d69e2cb Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj
MozReview-Commit-ID: DjDkL20wRg0

--HG--
extra : rebase_source : a343d83d1f4e97e4ba56d0f57fec93079df0b5ea
2017-10-23 20:59:55 +02:00
Tom Ritter 37b20d345d Bug 1409619 Resolve signed/unsigned comparison warning by fixing function definitions to be signed in widget/windows/TSFTextStore r=jimm
The functions changed are given signed arguments (that are converted to unsigned).
Changing them to signed resolves the warnings and preserves the original values.

MozReview-Commit-ID: BxIAECFiuQR

--HG--
extra : rebase_source : c48cef46f3ad5a060ad1f33d1c97744bfa8a82d7
2017-10-17 23:37:31 -05:00
Wes Kocher d8985b6e57 Merge inbound to central, a=merge
MozReview-Commit-ID: IUFdbLdYFhX
2017-10-04 16:37:59 -07:00
Masayuki Nakano 5726ada8a0 Bug 1404206 - Part 2: Make TSFTextStore and IMEHandler handle "mozAwesomebar" inputmode value. r=m_kato, r=gijs
When "mozAwesomebar" is set to inputmode value, that means that the Smart
Location Bar gets focus.  In that case, we should notify IME of input scopes
as "URL" because on-screen keyboard for URL has some useful additional keys
but they are not hindrances even when users want to type non-URL text.

On the other hand, MS-IME for Japanese and Google Japanese Input changes their
open state to "closed" if we notify them of URL input scope.  A lot of users
complain about this behavior.  Therefore, we should notify only them of
"Default" input scope even when "mozAwesomebar" has focus.

MozReview-Commit-ID: DIgqpR7TXQx
2017-09-29 15:15:14 +09:00
Tom Ritter c6c164aef4 Bug 1404147 Make string index and lengths unsigned to resolve signed/unsigned comparison warning r=jimm
MozReview-Commit-ID: Cpo5Gd1puzd

--HG--
extra : rebase_source : 0f47604366d2cfd8356c4d76c6dccdb03a42b0fe
2017-09-28 18:01:58 -05:00
Tom Ritter 411be7e1c2 Bug 1403825 Resolve sequence-point warning in widget/windows/TSFTextStore.cpp r=jimm
This warning is saying the operation may be undefined because the value of
->left is not guarenteed to be the same because of undefined order of operations.

Fortunately, this seems like a typo and we actually meant to assign ->bottom

MozReview-Commit-ID: H5G8fnDwIJP

--HG--
extra : rebase_source : cd6a2463a90b6675b12bb8255fe605937771bee8
2017-09-28 00:33:11 -05:00
Masayuki Nakano baead301db Bug 1386556 - TSFTextStore::GetIMENotificationRequests() should always return notification requests for sEnabledTextStore r=m_kato
Currently, TSFTextStore::GetIMENotificationRequests() tries to return notification requests for focused text store.  However, if there is sEnabledTextStore, all notifications will be sent for it.  Therefore, TSFTextStore::GetIMENotificationRequests() should return notifications for sEnabledTextStore without checking focused text store in the thread manager.

For example, we try to keep active composition even if we're being inactivated because Windows steals focus from us when our main process becomes busy but user may want to continue to compose the composition after our process becomes available.

Additionally, if TSFTextStore::GetIMENotificationRequests() doesn't return IMENotificationRequests::NOTIFY_DURING_DEACTIVE, sEnabledTextStore will be broken by NOTIFY_IME_OF_BLUR which will be sent by IMEStateManager::OnChangeFocusInternal().  However, when we're being activated, NOTIFY_IME_OF_FOCUS won't be notified because focused remote process keeps having IMEContentObserver.  Therefore, sEnabledTextStore won't be recreated and IME becomes unavailable.

Therefore, while sEnabledTextStore is not nullptr, TSFTextStore::GetIMENotificationRequests() needs all notifications even if it loses focus in the thread manager.

MozReview-Commit-ID: CC6gJIpHxUO

--HG--
extra : rebase_source : 02559fe8fea81b4247ef27043fc1d995981a9ba4
2017-08-02 18:30:16 +09:00
Masayuki Nakano 253c8f2129 Bug 1361132 TSFTextStore::GetSelection() shouldn't return if it runs on Win10 Anniversary Update or later r=m_kato
This is remaining cases of bug 1312302.  TSF may set focus to context when it receives focus related message.  In such case, TSF tries to retrieve selection but TSFTextStore::GetSelection() returns E_FAIL due to still not initialized, TSF crashes.

This patch moves the hack to TSFTextStore::GetSelection() and restrict to work only on problematic versions of Windows 10.

MozReview-Commit-ID: 6cTiZ4HCO18

--HG--
extra : rebase_source : 733377be55d52c43ef90d6e949cb851cf4c6dcb2
2017-06-22 20:07:10 +09:00
Masayuki Nakano 8c4d9cfa43 Bug 1372560 TSFTextStore should cache compartment for keyboard open/close r=m_kato
TSFTextStore::GetIMEOpenState() may be called a lot.  Therefore, TSFTextStore should cache the compartment until shutting down.

MozReview-Commit-ID: 2jz8zQMBHRS

--HG--
extra : rebase_source : b322bcae129c73d7fdd1de080d525dbd6f34e6f8
2017-06-14 15:37:41 +09:00
Masayuki Nakano d4b010860a Bug 1369696 - part 2: TSFTextStore::sMessagePump should be QIed from TSFTextStore::sThreadMgr at first use r=m_kato
sMessagePump is necessary only when WinUtils::(Get|Peek)Message() retrieves a message from the queue.  Therefore, we can put off to initialize it until then.

MozReview-Commit-ID: ByMJk6AIw1r

--HG--
extra : rebase_source : e826fcd6e67b2b1599b31dda44140c1e7218da5a
2017-06-13 19:38:03 +09:00
Masayuki Nakano a55bce7294 Bug 1369696 - part 1: TSFTextStore::sKeystrokeMgr should be QIed from TSFTextStore::sThreadMgr at first use r=m_kato
sKeystrokeMgr is required only when WM_KEYDOWN or WM_KEYUP message are received.  So, we can put off to initialize sKeystrokeMgr until then.

MozReview-Commit-ID: JsLeM0SYXG6

--HG--
extra : rebase_source : 766479689ec7739433b146fa5c0d7985fd6fc866
2017-06-13 19:04:43 +09:00
Masayuki Nakano feda1c6a47 Bug 1372516 - TSFStaticSink should compare GUID rather than name when checking active TIP r=m_kato
TIP name may be localed on some locales of Windows.  Additionally, names may be updated in the future releases.  So, it's safer to use GUID rather than name when TSFStaticSink checks active TIP is a specific one.

MozReview-Commit-ID: 6HNePZV7kgJ

--HG--
extra : rebase_source : 9d77c3124fc5ebeb82b9af1c13ae73633d9de4b8
2017-06-13 18:36:21 +09:00
Masayuki Nakano e3147efdde Bug 1372483 - Get rid of the hack for Easy Changjei from TSFTextStore since it isn't available on Firefox anymore r=m_kato
Easy Changjei, a Traditional Chinese IME, isn't available on Firefox because:

* The vendor has gone and nobody keeps maintaining it.
* It crashes at first key press since it was built with older Visual Studio and depends on the version's CRT.

Therefore, we don't need to support it anymore.

MozReview-Commit-ID: LjyAvWsrlJ1

--HG--
extra : rebase_source : 481c4fdd5bbd6ed9984a101226f5232da9705430
2017-06-14 14:20:27 +09:00
Masayuki Nakano 9ced384db5 Bug 1369694 Create TSFPrefs class and make it cache each pref at first use r=m_kato
Getting all prefs for TSFTextStore during initializing may make damage to start up performance.

So, each one should be retrieved when the one is actually necessary.

This patch creates TSFPrefs (I like better to name it TSFPreferences, but such long name isn't better when calling long name methods.) and implemented by simple macro.

MozReview-Commit-ID: A01LEAW4E7i

--HG--
extra : rebase_source : c471059c486c357eb270a7ea2ed1c5a07dd74e83
2017-06-10 04:19:27 +09:00
Masayuki Nakano 24bfe124f4 Bug 1369695 Creating ITfInputProcessorProfiles and TSFStaticSink when they are used at first time r=m_kato
ITfProcessorProfiles are used by a debug method TSFTextStore::CurrentKeyboardLayoutHasIME() and TSFStaticSink (when it's initialized).  However, TSFStaticSink isn't necessary until when TSFTextStore needs to hack something for specific IME or notifying IMEHandler of active TIP change.  So, we can put off to create the instance of ITfInputProcessorProfiles and TSFStaticSink.

MozReview-Commit-ID: KcrqUbqz1do

--HG--
extra : rebase_source : f1821b782c6cd316a8f234a17ee3c92114547041
2017-06-08 23:55:57 +09:00
Masayuki Nakano e25479050a Bug 1369697 Create ITfDisplayAttributeMgr and ITfCategoryMgr when TSFTextStore::GetDisplayAttribute() needs to use them at first time r=m_kato
Creating them may be expensive due to allocating them in the heap.  So, let's put off to create them when first use.

MozReview-Commit-ID: HDgijJo7brU

--HG--
extra : rebase_source : 9e4e68bd048185fe38fd98bef9b5711e86f68999
2017-06-08 20:51:50 +09:00
Masayuki Nakano f6dd08693e Bug 1367692 - Make IMEHandler not restore default IMC unless legacy IMM-IME is active. r=m_kato
TIPs (and normal keyboard layouts) don't need IMC on focused window.  So, in most environment, it's not necessary to restore default IMC of focused window.

Therefore, this patch makes IMEHandler not restore default IMC unless legacy IMM-IME is active and disassociate IMC from focused window when IMM-IME isn't active.

However, this is risky change.  Therefore, the new behavior is disabled in default settings.  On the other hand, we need the new behavior only when MS-IME for Japanese is active on Win10.  Therefore, this patch adds a pref to enable/disable the hack and make it true in the default settings.

MozReview-Commit-ID: KAVxVT9CrsW
2017-06-07 11:42:27 +09:00
Masayuki Nakano 6421357e7a Bug 1368318 Call TSFTextStore::ThinksHavingFocus() before clearing sEnabledTextStore since the method refers it r=m_kato
MozReview-Commit-ID: GdALZTWioNW

--HG--
extra : rebase_source : 66491f98c906ffe9cdd5bbc4558f86f75e0343cc
2017-05-29 12:18:11 +09:00