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

55 Коммитов

Автор SHA1 Сообщение Дата
Makoto Kato af8450a188 Bug 1654146 - Clean up InputContext logging. r=masayuki
Actually, altough TSF and IMEStateManager have the logging for InputContext,
I would like to use common logging code using `ToString.h`.

Differential Revision: https://phabricator.services.mozilla.com/D84287
2020-07-21 08:12:04 +00:00
Jonathan Watt 5039526672 Bug 1634154. Make `widget/gtk` buildable outside of `unified-build` environment. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D73123
2020-05-01 03:02:13 +00:00
Makoto Kato 833d15a69d Bug 1617778 - Use ToString.h to share text and selection change logging. r=masayuki
It is useful to use ToString.h to log text and selection change instead of
adding it each source code. Actually, there is same code in
IMEContentObserver and widget.

Also, mozilla namespace is required since this conflicts with
WinModifierKeyState.h.

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

--HG--
extra : moz-landing-system : lando
2020-02-28 04:45:05 +00:00
Makoto Kato 6aaa810233 Bug 1577685 - Move some utility functions from IMEStateManager to widget. r=masayuki
I would like to log `IMEState` and `InputContextAction`in widget. But this
utilities are in `IMEStateManager`, so I would like to move it to widget
by using `mozilla/ToString.h`.

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

--HG--
extra : moz-landing-system : lando
2019-08-30 05:56:58 +00:00
Makoto Kato 8b306f551d Bug 1556103 - Part 1. Add long press action when setting focus. r=masayuki
Actually, long tap can set focus.  But since it uses `nsIFocusManager::FLAG_BYMOUSE` flag, we cannot recognize whether setting focus is by long tap or not.

So I would like to add new flag `FLAG_BYLONGPRESS` and `CAUSE_LONGPRESS` that are by long tap.

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

--HG--
extra : moz-landing-system : lando
2019-06-28 00:39:45 +00:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09: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
Henri Sivonen 89ca07c012 Bug 1487341 - Make Truncate(), SetLength() and Capacity() more efficient by keeping memcpying to the minimum. r=froydnj
MozReview-Commit-ID: 2LeRrWcN8vF

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

--HG--
extra : moz-landing-system : lando
2018-09-17 09:45:02 +00:00
Andi-Bogdan Postelnicu 8cc8f8b517 Bug 1453795 - Widget - Initialize member fields in classes/ structures. r=jimm
--HG--
extra : rebase_source : 594fe9396c450401fab4c17e81a3333124f27f58
2018-06-15 17:48:51 +03:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02: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
Eugen Sawin ff53849afe Bug 1428371 - Add missing member initialization in InputContext. r=masayuki
--HG--
extra : rebase_source : 69d3d28135f12ab7fdc42719813a2b533834ceff
2018-01-05 08:28:00 -05:00
Eric Rahm 07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
James Willcox e1181af857 Bug 1409113 - Add nsIPresShell::HasHandledUserInput() status to InputContext r=masayuki
MozReview-Commit-ID: 60x35NKEzhA
2017-11-22 10:09:06 -06:00
Masayuki Nakano 93977460e2 Bug 1406446 - part 1: InputContextAction should treat focus change during handling a user input as caused by user input even if it's caused by JS r=smaug
Currently, widget doesn't show VKB when input context change is caused by JS.
However, if it's caused by an event handler of a user input, user may expect
to open VKB.  For example, if a touch event in fake editor causes moving
focus to actual editable node, user expect to show VKB.

Therefore, InputContextAction should declare two causes.  One is unknown but
occurred during handling non-keyboard event.  The other is unknown but occurred
during handling keyboard event.

However, EventStateManager doesn't have an API to check if it's being handling
a keyboard event.  Therefore, this patch adds it first.
AutoHandlingUserInputStatePusher sends event type to StartHandlingUserInput()
and StopHandlingUserInput() of EventStateManager and sUserKeyboardEventDepth
manages the number of nested keyboard event handling.  Therefore,
EventStateManager::IsHandlingKeyboardInput() can return if it's handling a
keyboard event.

IMEStateManager uses this new API to adjust the cause of changes of input
context.

Finally, InputContextAction::IsUserInput() is renamed to IsHandlingUserInput()
for consistency with EventStateManager and starts to return true when the
input context change is caused by script while it's handling a user input.

MozReview-Commit-ID: 5JsLqdqeGah

--HG--
extra : rebase_source : 9fcf7687d1bf90eeebbf6eac62d4488ff64b083c
2017-10-24 02:46:15 +09:00
Masayuki Nakano 7f281b641d Bug 1403026 - Make IMEStateManager release all string buffer of its static members at XPCOM shutdown r=smaug
IMEStateManager has a static instance of InputContext which has some nsString
instances.  Then, their members will be released after XPCOM shutdown and
that is detected as unexpected destruction.

Therefore, IMEStateManager should release them by itself at XPCOM shutdown.
Using nsTSubstring::SetCapacity(0) is the simplest way to release only the
string buffers.

MozReview-Commit-ID: LMrQxQF9xPn

--HG--
extra : rebase_source : 7cbaf19b76be8db083c10270d0ee436a1c061ea2
2017-09-28 17:31:29 +09:00
James Willcox 216f3c6511 Bug 1400878 - Don't show keyboard on Android unless the user caused it r=jchen
MozReview-Commit-ID: KURh08X4Q4U
2017-09-20 14:48:00 -05:00
Henry Chang 25f77bb74d Bug 1349255 - Part 1: Make PBrowser.NotifyIMEFocus async to avoid UI jank. r=kanru,masayuki
Telemetry and some performance profiles show that Msg_NotifyIMEFocus can take
a few seconds to complete, and jank the browser. With bug 1217700, it removes
the necessity of sync Msg_NotifyIMEFocus, so in this patch we make this async
for performance improvement.

MozReview-Commit-ID: 15eUwMJ2Q7H

--HG--
extra : rebase_source : b463e6e881ca5ebec00d0f76e29ca103059b3ddd
2017-05-08 19:07:56 +08:00
Milan Sreckovic 5c01b5706c Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in image/*. r=aosmond
MozReview-Commit-ID: 8gyxxLziVe7

--HG--
extra : rebase_source : c79e81e10c54106645539c590bf81a03a300a909
2017-08-14 08:29:56 -04:00
Jan Henning 34bb1f8a36 Bug 1266683 - Part 2 - Add private browsing mode info to InputContext. r=masayuki
Android now supports telling an IME that it shouldn't store user-entered content into it's dictionary/language model/etc. and we want to automatically enable this in private browsing.

As the code that handles input on Android doesn't have any notion of tabs (and therefore of the difference between normal and private tabs), the best way to get that info across is to retrieve it directly within the IMEStateManager from the corresponding document and store it in the inputContext, which is then passed to Java for Fennec to handle.
Implementing this within Gecko also has the benefit that this part of the code can be used by other platforms as well should they want to support similar features in the future.

MozReview-Commit-ID: DsxjC4Ma7DR

--HG--
extra : rebase_source : f0940cb40170ab32cf5a172d07a61d083427be8a
2017-07-30 19:45:03 +02:00
Masayuki Nakano c726abb366 Bug 1377672 - part2: IMEStateManager::SetIMEState() should set input context with proper origin information r=m_kato
Currently, IMEStateManager always sets input context as set by current process even when it needs to adjust IME state when a tab parent for current focused IME process is removed.  Then, input context for the widget is marked as for main process but the widget still have IME focus of a remote process.

For fixing this mismatch, IMEStateManager should set ORIGIN_CONTENT even when the tab parent is being destroyed.

MozReview-Commit-ID: C10YOAtkET4

--HG--
extra : source : 9430d123b19e0ac551c6048bb044fcfa22d13e45
2017-07-03 12:28:10 +09:00
Masayuki Nakano dfc463ea5b Bug 1310454 part 2 - TSFTextStore::SetInputContext() should do nothing when it's called for initializing native IME context when a widget is created r=m_kato
On Windows, when nsWindow is created, IMEHandler::InitInputContext() is called.  Then, it calls TSFTextStore::SetInputContext().  However, at least for now, TSFTextStore needs to do nothing until the widget gets focus.

MozReview-Commit-ID: HBafHEUSCtd

--HG--
extra : rebase_source : 5c21e0f81dbc9b644965f7df42da1b6314b58a26
2017-05-19 15:52:59 +09:00
Masayuki Nakano 7b52d07cd2 Bug 1217700 part.2 IMEContentObserver should observe all possible notifications and check if it should be notified when it occurs r=m_kato
IMEContentObserver can store pointer of IMENotificationRequests of its mWidget.  Therefore, it can check the requests dynamically when it receives content change or layout change.

This patch makes IMEContentObserver stores IMENotificationRequests as pointer and check it at every change notification received.  Additionally, notification request may be changed due to focus move or something.  Therefore, this patch makes IMEContentObserver and IMEContentObserver::IMENotificationSender() check if the notifications are still necessary.

MozReview-Commit-ID: 2uU2wN15D8v

--HG--
extra : rebase_source : 6086e0293343632df43087c767ad00521e764476
2017-04-13 14:32:12 +09:00
Masayuki Nakano 0789f7b595 Bug 1217700 part.1 nsIWidget should return reference to IMENotificationRequests r=m_kato
IMEContentObserver may need to change notifications to send when TextInputProcessor begins input transaction.  In current design, IMEContentObserver needs to retrieve IMENotificationRequests at every change.  However, if nsIWidget returns a reference to its IMENotificationRequests, IMEContentObserver can call it only once.

For that purpose, this patch changes nsIWidget::GetIMENotificationRequests() to nsIWidget::IMENotificationRequestsRef() and make it return |const IMENotificationRequests&|.  However, if the lifetime of the instance of IMENotificationRequest is shorter than the widget instance's, it's dangerous.  Therefore, it always returns TextEventDispatcher::mIMENotificationRequests.  TextEventDispatcher's lifetime is longer than the widget.  Therefore, this guarantees the lifetime.

On the other hand, widget needs to update TextEventDispatcher::mIMENotificationRequests before calls of nsIWidget::IMENotificationRequestsRef().  Therefore, this patch makes TextEventDispatcher update proper IMENotificationRequests when it gets focus or starts new input transaction and clear mIMENotificationRequests when it loses focus.

Note that TextEventDispatcher gets proper requests both from native text event dispatcher listener (typically, implemented by native IME handler class) and TextInputProcessor when TextInputProcessor has input transaction because even if TextInputProcessor overrides native IME, native IME still needs to know the content changes since they may get new input transaction after that.

However, there may not be native IME handler in content process.  If it runs in Android, PuppetWidget may have native IME handler because widget directly handles IME in e10s mode for Android.  Otherwise, native IME handler is in its parent process.  So, if TextInputHandler has input transaction in content process, PuppetWidget needs to behave as native event handler.  Therefore, this patch makes PuppetWidget inherit TextEventDispatcherListener and implements PuppetWidget::IMENotificationRequestsRef().

MozReview-Commit-ID: 2SW3moONTOX

--HG--
extra : rebase_source : d2634ada6c33dbf7a966fadb68608411ee24bfab
2017-04-15 01:35:58 +09:00
Masayuki Nakano 61ce5526c6 Bug 1296220 Rename nsIMEUpdatePreference to mozilla::widget::IMEUpdatePreference r=m_kato
MozReview-Commit-ID: 2rIXTlwA6my

--HG--
extra : rebase_source : a51be3edd717092738c2b5e8ccc4f60540712bfd
2017-04-11 21:24:55 +09:00
Masayuki Nakano ef2fb8753d Bug 1282669 Get rid of nsIMEUpdatePreference::DontNotifyChangesCausedByComposition() r=m_kato
I think that we can drop nsIMEUpdatePreference::DontNotifyChangesCausedByComposition(), i.e., nsIMEUpdatePreference::NOTIFY_CHANGES_CAUSED_BY_COMPOSITION because it's now used only by TSFTextStore but TSFTextStore ignores if SelectionChangeDataBase::mCausedByComposition or TextChangeDataBase::mCausedOnlyByComposition is true (for supporting async changes in e10s mode).  So, only issue is, dropping the flag might cause increasing computing TextChangeData cost during composition in TSF mode.  However, now, it's already enough fast and even if it'd cause performance regression, we could add a hack with TextComposition's offset information.  Therefore, we don't need to worry about the performance regression so seriously.

MozReview-Commit-ID: HNT3G4isONj

--HG--
extra : rebase_source : 164231023aa2a17ceab94d92fb49ba0a00dab429
2016-06-28 16:51:59 +09:00
Masayuki Nakano e1d8dafcd9 Bug 1282668 Get rid of nsIMEUpdatePreference::NOTIFY_SELECTION_CHANGE r=m_kato
Currently, all widgets request selection change notifications to IMEContentObserver.  Additionally, IMEContentObserver needs to listen selection changes for caching latest selection for eQuerySelectedText.  Therefore, it doesn't make sense to keep defining nsIMEUpdatePreference::NOTIFY_SELECTION_CHANGE.

If widgets didn't need selection change notifications, they could just ignore the unnecessary notifications.

Note that all widgets don't need selection change notifications if a plugin has focus and IMEContentObserver cannot observe selection changes in the plugin.  Therefore, if IMEContentObserver is initialized with a plugin, it shouldn't listen selection changes (and doesn't need to notify widgets of selection changes).

MozReview-Commit-ID: FOVFFgA2nOz

--HG--
extra : rebase_source : 3e16d5023835f99f82934e754d2e7db70474f9ee
2016-06-28 15:23:12 +09:00
Masayuki Nakano 54e57600e1 Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.

This patch makes TextComposition use IMEContentObserver to send the notification.  However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).

If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR.  So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.

On the other hand, we're buggy if composition events are fired in non-active window.  Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.

MozReview-Commit-ID: 7Q0ZsJTh4hX

--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 22:14:41 +09:00
Masayuki Nakano e67330e0b4 Bug 1275906 part.1 Rename NOTIFY_IME_OF_COMPOSITION_UPDATE to NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED r=m_kato
It's not clear to me what NOTIFY_IME_OF_COMPOSITION_UPDATE means only from the name. For making the name clearer, this patch renames it to NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED and add some explanation to the definition.

MozReview-Commit-ID: 8ySYCNJ1Ytz

--HG--
extra : rebase_source : 3331b8f48e8b460c7f9b088064dcda9488f3403c
2016-05-31 11:39:15 +09:00
Masayuki Nakano a58a540708 Bug 1251063 PuppetWidget should cache InputContext which is set with SetInputContext() and use it in GetInputContext() only when it is the widget which has active input context in the process r=smaug
PuppetWidget::GetInputContext() needs to communicate with its parent process with synchronous IPC. This is very expensive for focus move.

Currently, IMEStateManager uses nsIWidget::GetInputContext() only for checking the IME enabled state.  Therefore, it's enough to cache input context when nsIWidget::SetInputContext() is called.  Then, we can avoid to communicate with synchronous IPC with PuppetWidget::GetInputContext() in most cases.

This patch makes IMEStateManager stores the last widget which sets input context.  When PuppetWidget uses its input context cache, it should check if it is the last widget to set input context with IMEStateManager since an input context may be shared with other widgets and another one may have update the input context.  I.e., PuppetWidget's input context cache may be already outdated after IMEStateManager sets input context with another widget.

This patch gives up to support retrieving IME open state from child process. However, perhaps, this is not necessary for everybody including add-on developers because the only user of IME open state in child process is nsIDOMWindowUtils. So, add-ons can send IME open state from chrome process instead.  If this decision is wrong, unfortunately, we should support it again in another bug.  It's easy to support with creating another nsIWidget::GetInputContext() or adding additional argument to it.

MozReview-Commit-ID: B2d2CCTsPKj

--HG--
extra : rebase_source : 4117330ba7871753176da960063b612e96f11752
2016-05-28 11:27:56 +09:00
Gijs Kruitbosch b499a37faf Bug 1239744 - no longer automatically show an on-screen keyboard for programmatic focus changes, tidy up osk logic in IMEHandler, r=masayuki
--HG--
extra : rebase_source : 013c2759f4faca65ed3de79ca1d7f0b97e6375cb
2016-02-09 19:39:55 +00:00
Makoto Kato ba11a89326 Bug 1243268 - Support ImmSetCandidateWindow(CFS_EXCLUDE) on plugin process. r=masayuki 2016-02-02 17:05:56 +09:00
Masayuki Nakano 05ae69e6a5 Bug 1242331 part.4 Add TextChangeDataBase::mIncludingChangesWithoutComposition r=smaug 2016-01-28 13:28:54 +09:00
Masayuki Nakano 1e9d12bfdb Bug 1242331 part.3 Rename TextChangeDataBase::mOccurredDuringComposition to mIncludingChangesDuringComposition r=smaug 2016-01-28 13:28:53 +09:00
Masayuki Nakano 26c28dca6c Bug 1242331 part.2 Rename TextChangeDataBase::mCausedByComposition to mCausedOnlyByComposition r=smaug 2016-01-28 13:28:53 +09:00
Masayuki Nakano 430cba8f7f Bug 1242331 part.1 Remove unused methods of IMENotification r=smaug 2016-01-28 13:28:53 +09:00
Masayuki Nakano 6c313126b6 Bug 1234120 part.1 IMEHandler should request all notifications which are requested by either IMMHander or TSFTextStore when IMM is available in TSF mode r=m_kato 2015-12-22 14:58:48 +09:00
Carsten "Tomcat" Book b25476080d merge mozilla-inbound to mozilla-central a=merge 2015-12-11 11:38:17 +01:00
Masayuki Nakano da7a2f4f8d Bug 1179632 part.2 WidgetCompositionEvent should store NativeIMEContext which caused the event and PuppetWidget should store it for GetNativeIMEContext() r=smaug, sr=smaug 2015-12-11 15:15:57 +09:00
Masayuki Nakano 6cad726628 Bug 1179632 part.1 native IME context should not be stored in InputContext but should be able to retrieve with nsIWidget::GetNativeData() r=smaug 2015-12-11 15:15:57 +09:00
Gijs Kruitbosch 297357597f Bug 1224605 - also show the OSK when tapping in focused inputs, r=masayuki
--HG--
extra : commitid : Dk5EQ4MMs4X
extra : rebase_source : 3bfa3f930a95904d2b179b58f3735f2e1cae1dc0
2015-12-08 09:56:27 -05:00
Gijs Kruitbosch aaf54987f1 Bug 1221947 - part 2: add TOUCH cause to IME Handling and use it to avoid checking for a keyboard, r=masayuki
--HG--
extra : commitid : 210bhfz78Nm
extra : rebase_source : a3ee068abd8cb0fc2c83be7d5e5442bf74979ecd
extra : histedit_source : 29daad4b99ad4d41663cc026983dffa7449029dc
2015-11-12 16:36:19 +00:00
Chris Peterson a11badd07b Bug 1219139 - Fix -Wimplicit-fallthrough warnings in dom/events and widget/IMEData.h. r=masayuki
widget/IMEData.h:428:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels

dom/events/EventStateManager.cpp:601:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:654:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:714:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:1239:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:3045:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:4173:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
2015-10-26 20:46:27 -07:00
Masayuki Nakano 35aa5312ba Bug 1184890 part.1 SelectionChangeDataBase and TextChangeDataBase should have a flag which indicates whether the change occurred during composition or not r=smaug 2015-10-27 07:21:37 +09:00
Masayuki Nakano c985d88dab Bug 1203364 IMEContentObserver should notify IME of selection change with the latest change reason r=smaug 2015-09-14 23:28:43 +09:00
Masayuki Nakano 1a4e1c06f7 Bug 1200980 part.3 IMEContentObserver should use its selection cache at handling NS_QUERY_SELECTED_TEXT r=smaug 2015-09-08 12:54:14 +09:00
Masayuki Nakano 6ecfef2cde Bug 895274 part.5 Rename NS_EVENT_NULL to eVoidEvent r=smaug 2015-08-29 08:58:26 +09:00
Masayuki Nakano 0d22745cda Bug 895274 part.3 Make the enum of event messages a named enum IGNORE IDL r=smaug 2015-08-26 21:56:59 +09:00
Masayuki Nakano 733d9feaed Bug 1198594 The copy constructor of IMENotification should initialize mMessage before calling Assign() r=smaug 2015-08-26 20:01:05 +09:00