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

216 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 5345065a53 Bug 1388647 - part2: Make IMEInputHandler of Cocoa widget handle request to commit/cancel composition synchronously r=m_kato
When Gecko started to support Cocoa widget, we needed to use NSInputManager.
That allowed applications to access only focused IME context.  Therefore, commit
composition request handler for Cocoa is designed as handling asynchronosly if
it's requested when the window is not active or is being inactivated.

Additionally, the asynchronous handling isn't perfect.  We hit some MOZ_ASSERT()
now in some places.  E.g., in SelectedRange(), it doesn't assume that it's
called during deactive.

On the other hand, NSInputManager was alreay obsolete and we already stopped using it
(bug 810225).  Instead, we're using NSTextInputContext and it allows applications
to access IME anytime.  Therefore, if we make IMEInputHandler handles commit/cancel
composition requests synchronsly, that behaves same as the other platforms.  So, we
can get rid of macOS specific issue completely.

MozReview-Commit-ID: X7aWmGq95x

--HG--
extra : rebase_source : a472a03e3ef6f424fe73c2d438b8326bed80278d
2017-08-09 18:41:19 +09:00
Kartikaya Gupta ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Masayuki Nakano c8d5ce8e59 Bug 1333459 - part4: Make EventStateManager resets "waiting reply from remote process" when the focused content isn't in remote process r=smaug
On macOS, we fall back eKeyPress event to native menu.  Therefore, widget always requests a reply from remote process because it's difficult to check if the eKeyPress event will be sent to a remote process actually.  If it's not sent to any remote processes, PresShell needs to dispatch the event into the DOM tree.  Additionally, even if it's marked as "waiting reply from remote process", it needs to dispatch the DOM event in the main process first because we need to check if the key combination is reserved by chrome (if it's reserved, the eKeyPress event shouldn't be fired in the remote process).

Therefore, this patch makes EventStateManager::PreHandleEvent() resets the state when focused content isn't in any remote processes and the event's propagation hasn't been stopped.

Additionally, this patch makes PresShell::HandleEventInternal() checks WidgetEvent::PropgationStopped() with WidgetEvent::IsWaitingReplyFromRemoteProcess() before dispatching the event into the DOM tree.

MozReview-Commit-ID: FmgL3rCuQ8y

--HG--
extra : rebase_source : aa8d6b924fc78d1d9dd35a35c92976c35c758657
2017-07-21 17:22:08 +09:00
Bill McCloskey 224d56eb18 Bug 1377222 - Eliminate nsITimer::InitWithFuncCallback in favor of InitWithNamedFuncCallback (r=froydnj)
MozReview-Commit-ID: 9zN9aAd7daA
2017-07-03 16:19:56 -07:00
Masayuki Nakano 3bf2045197 Bug 1376417 - part1: IMEInputHandler should notify Cocoa of layout change with [NSTextInputContext invalidateCharacterCoordinates] r=m_kato
I found invalidateCharacterCoordinates in NSTextInputContext. It's available 10.6 and later.

Calling this API does NOT make visible candidate window follow window move nor something to change layout, though. But we should call it.

MozReview-Commit-ID: KbllLDwlMOz

--HG--
extra : rebase_source : 175377bf7dd703dcd304ffbb8648e350080c07fc
2017-06-29 16:03:57 +09:00
Nicholas Nethercote fe9268c4cd Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsAFlatString  --> nsString
- nsAFlatCString --> nsCString

--HG--
extra : rebase_source : b37350642c58a85a08363df2e7c610873faa6e41
2017-06-20 19:19:05 +10:00
Stephen A Pohl 99336e02ef Bug 429824: Properly forward native OSX events to the native menu bar if they haven't been handled by the child process in e10s. r=mstange,masayuki 2017-05-15 22:59:35 -04:00
Masayuki Nakano 3456c02e0a Bug 1358958 part.2 Implement TextInputHandler::InsertNewline() to handle "insertNewline:" command r=m_kato
Due to bug 1358958, simply inserting a line breaker with composition events doesn't work as expected in HTML editor.  Therefore, we need to dispatch "fake" Enter keypress event even if it's not handling Enter key actually or shouldn't dispatch keypress event anymore.

The method tries to dispatch Enter keypress event.  If it's handling Enter key press actually and can dispatch keypress event normally, it dispatches Enter keypress event as-is.  Otherwise, it tries to dispatch "fake" Enter keypress.  It doesn't have Control, Option and Command key state for emulating to insert a line breaker.  Additionally, its code value is not set to "Enter" because the fake key event isn't a physical key event.

If it cannot dispatch Enter keypress event, it dispatches composition events to insert "\n" even though it won't work in HTML editor.

MozReview-Commit-ID: 7AsJLKS8Tgz

--HG--
extra : rebase_source : 03a8628fd35eff404792691de0d2600f11ef1614
2017-04-27 21:44:58 +09:00
Masayuki Nakano e12339e622 Bug 1358958 part.1 Don't consume command when neither keydown nor keypress event was consumed r=m_kato
When typing Enter key when active keyboard layout is Korean IME and it has composition string, the composition string is committed and then, "insertNewline:" command is sent. However, TextInputHandler::DoCommandBySelector() consumes the command because the key event has already modified the composition string.

This patch makes TextInputHandler::DoCommandBySelector() consume the command if it's not handling keydown or neither dispatched keydown event nor dispatched keypress event (if it does) is consumed. Therefore, insertNewline:sender of nsChildView will be called later, then, it causes inserting a line break with a set of composition events.

MozReview-Commit-ID: Afr1FKZbUtL

--HG--
extra : rebase_source : 0c43986907553750b63bed0c95b3d5aaa1b16bea
2017-04-26 20:39:13 +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 87d8470a52 Bug 1347073 Get rid of UIEvent.isChar since it's not initialized properly on most platforms and the other browsers don't support this r=smaug
UIEvent.isChar is not supported by the other browsers and the value isn't initialized any platforms except on macOS. So, the value isn't useful and we have no reason to keep it.

MozReview-Commit-ID: 4BLpo88gSZj

--HG--
extra : rebase_source : ca950f8cb618a0cadc99ba4c80b5a8df94a20f27
2017-03-14 18:29:39 +09:00
Jim Chen 53a1107cd1 Bug 1343075 - Use GeckoEditableSupport from PuppetWidget; r=masayuki r=rbarker r=snorp r=esawin
Bug 1343075 - 1a. Add TextEventDispatcherListener::GetIMEUpdatePreference; r=masayuki

Add a GetIMEUpdatePreference method to TextEventDispatcherListener to
optionally control which IME notifications are received by NotifyIME.
This patch also makes nsBaseWidget forward its GetIMEUpdatePreference
call to the widget's native TextEventDispatcherListener.

Bug 1343075 - 1b. Implement GetIMEUpdatePreference for all TextEventDispatcherListener; r=masayuki

This patch implements GetIMEUpdatePreference for all
TextEventDispatcherListener implementations, by moving previous
implementations of nsIWidget::GetIMEUpdatePreference.

Bug 1343075 - 2. Allow setting a PuppetWidget's native TextEventDispatcherListener; r=masayuki

In PuppetWidget, add getter and setter for the widget's native
TextEventDispatcherListener. This allows overriding of PuppetWidget's
default IME handling. For example, on Android, the PuppetWidget's native
TextEventDispatcherListener will communicate directly with Java IME code
in the main process.

Bug 1343075 - 3. Add AIDL interface for main process; r=rbarker

Add AIDL definition and implementation for an interface for the main
process that child processes can access.

Bug 1343075 - 4. Set Gecko thread JNIEnv for child process; r=snorp

Add a JNIEnv* parameter to XRE_SetAndroidChildFds, which is used to set
the Gecko thread JNIEnv for child processes. XRE_SetAndroidChildFds is
the only Android-specific entry point for child processes, so I think
it's the most logical place to initialize JNI.

Bug 1343075 - 5. Support multiple remote GeckoEditableChild; r=esawin

Support remote GeckoEditableChild instances that are created in the
content processes and connect to the parent process GeckoEditableParent
through binders.

Support having multiple GeckoEditableChild instances in GeckoEditable by
keeping track of which child is currently focused, and only allow
calls to/from the focused child by using access tokens.

Bug 1343075 - 6. Add method to get GeckoEditableParent instance; r=esawin

Add IProcessManager.getEditableParent, which a content process can call
to get the GeckoEditableParent instance that corresponds to a given
content process tab, from the main process.

Bug 1343075 - 7. Support GeckoEditableSupport in content processes; r=esawin

Support creating and running GeckoEditableSupport attached to a
PuppetWidget in content processes.

Because we don't know PuppetWidget's lifetime as well as nsWindow's,
when attached to PuppetWidget, we need to attach/detach our native
object on focus/blur, respectively.

Bug 1343075 - 8. Connect GeckoEditableSupport on PuppetWidget creation; r=esawin

Listen to the "tab-child-created" notification and attach our content
process GeckoEditableSupport to the new PuppetWidget.

Bug 1343075 - 9. Update auto-generated bindings; r=me
2017-03-07 22:34:39 -05:00
Masayuki Nakano 944a1927bb Bug 1342865 When Control key is pressed and InsertText() isn't called on macOS, its KeyboardEvent.key value should be characters which are inputted by the key without Control key state r=m_kato
Because of conforming to UI Events KeyboardEvent key Values, when some modifier keys cause not inputting character, the KeyboardEvent.key value should be computed with removing all modifier state except glyph modifier keys.

When Control key is pressed, Cocoa fires odd key events typically.  For example, characters isn't computed with same logic of UI Events KeyboardEvent key Values especially when Option key is pressed (see adding testcases for the detail).

Therefore, this patch makes TISInputSourceWrapper::InitKeyEvent() ignore both characters and charactersIgnoringModifiers at computing KeyboardEvent.key value when Control key is pressed and InsertText() isn't called.

On the other hand, this patch does NOT touch the path to compute KeyboardEvent.key when Command key is pressed.  It should be changed in different bug because Command key behavior isn't so simple.

MozReview-Commit-ID: dMHgUEOnQw

--HG--
extra : rebase_source : 7a67c98d2bf6ca38c7e6ae9dcbad01020d9cea31
2017-03-01 10:58:55 +09:00
Masayuki Nakano f00486c493 Bug 1263302 Swap kVK_ISO_Section and kVK_ANSI_Grave key code values of ISO keyboard at computing KeyboardEvent.code value because macOS sends them as swapped r=m_kato
macOS oddly sends kVK_ISO_Section instead of kVK_ANSI_Grave when user types left key of Key1 only when the connected keyboard is ISO keyboard. On the other hand, macOS sends kVK_ANSI_Grave instead of kVK_ISO_Section when user types left key of KeyZ only when the connected keyboard is ISO keyboard.  So, macOS swapps their key code values only when ISO keyboard is connected.

So, we should treat them as swapped when we compute KeyboardEvent.code value since Chromium treates them as swapped only when computing KeyboardEvent.code value too.

MozReview-Commit-ID: BYeFedydyR5

--HG--
extra : rebase_source : c3bf2a9fefe0e3e98a1955e829243f8fd7d1041a
2017-02-27 18:04:30 +09:00
Masayuki Nakano 96d0076840 Bug 1341960 TextInputHandler shouldn't ignore InsertText() calls even if TextInputHandler has already dispatched keypress events and/or composition events for the key down but InsertText() is called again for inserting printable text r=m_kato
Korean IME and some other simple IME may not use marked text at composing text.  Such IME modifies composing character with InsertText() with aReplacementRange.  Then, when
 user types new character, such IME may replace the previous character with a call of InsertText() with aReplacementRange and insert the next character with additional call of InsertText() without aReplacementRange.

In this case, InsertText() ignores the call when the native keydown event is already caused composition events.  However, we need to allow to dispatch keypress event for supporting to insert text even in such case.

This patch checks if inserting text is printable.  If it's not a printable character such as U+000A at pressing Enter, keeping current behavior.  Otherwise, dispatching keypress event instead.

MozReview-Commit-ID: 5NcCgXfvniO

--HG--
extra : rebase_source : f05db8655d623880cb658cef144d1e9fcdce8a2a
2017-02-23 11:45:13 +09:00
Tom Tromey 5f8f360823 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
2016-12-15 20:16:31 -07:00
Masayuki Nakano 5442d350f3 Bug 1337739 Create an enum eKeyLocation* for avoiding to use nsIDOMKeyEvent::DOM_KEY_LOCATION_* r=smaug
Currently, we use alias NS_VK_* for WidgetKeyboardEvent::mKeyCode.  Similarly, we should create alias enum for nsIDOMKeyEvent::DOM_KEY_LOCATION_*.  Then, we can reduce the length and avoid to include nsIDOMKeyEvent in some cpp files.

MozReview-Commit-ID: 5cs4zQ061Lc

--HG--
extra : rebase_source : e6a6edd27718b9e3d4a40b07902d029791876999
2017-02-08 21:04:22 +09:00
Masayuki Nakano 6cf6789c7b Bug 1334594 Call NSTextInputClient's insertText:replacementRange: instead of NSTextInput's insertText: from IMEInputHandler::SendCommittedText() r=m_kato
Bug 1180564 dropped NSTextInput protocl implementation from ChildView but IMEInputHandler::SendCommittedText() still calls it via mView.  Therefore, it fails to commit composition in widget level.  Instead, we it should call insertText:replacementRange: of NSTextInputClient protocol.

Additionally, this patch adds a last resort path. If calling insertText:replacementRange: didn't commit composition in widget level, it calls TextInputHandler::InsertText() directly.

MozReview-Commit-ID: BZZypBqC0Mx

--HG--
extra : rebase_source : bef5612a933db3211400e9d8bd2848690de2d2e5
2017-02-07 19:03:14 +09:00
Nicholas Nethercote a8699ee61d Bug 1325234 (part 1) - Streamline nsIWidget::NotifyIME. r=jimm.
This patch changes it from |NS_IMETHOD| to |virtual nsresult|. The callsites
were a mix of checked and unchecked so using |MOZ_MUST_USE| didn't feel
appropriate.

--HG--
extra : rebase_source : 471ca43dcd565ddd1761d01df344c30e4e04a9ec
2016-12-20 09:55:30 +11:00
Masayuki Nakano a028890899 Bug 1317906 When a key press causes a call of InsertText(), it shouldn't mark keypress as consumed but instead, should mark InsertText() caused composition r=m_kato
Currently, when InsertText() which is caused by a key press causes committing composition, it consumes keypress event.  However, Korean 2-set IME calls InsertText() two times when there is composition and key press causes inserting another character next to the composition.  In this case, current design ignores second InsertText() becuase keypress event is already consumed by the first InsertText() call.

For solving this issue safely, InsertText() should mark current key event as "dispatched composition event". Then, following InsertText() calls should cause composition events instead of keypress events since following event order is too odd:

1. keydown (currently not dispatched by TextEventDisaptcher)
2. compositionupdate
3. compositionend
4. keypress
5. keyup

with the new design this becomes:

1. keydown (currently not dispatched by TextEventDispatcher)
2. compositionupdate
3. compositionend
4. compositionstart
5. compositionupdate
6. compositionend
7. keyup

This is similar to Chromium, although, Chromium includes the second InsertText() call into the first composition, we need to fix it later due to risky.

MozReview-Commit-ID: GL42cU2WIL0

--HG--
extra : rebase_source : 2063c56166f6c9ccee25a74e1d29f94daa6b159c
2016-11-17 13:35:21 +09:00
Masayuki Nakano dfec2203fe Bug 1312649 part.2 IMEInputHandler::GetVaildAttributesForMarkedText() should return non-empty array r=m_kato
Vietnamese Telex perhaps referes this result and change its behavior. When typying something, Telex starts composition on Chrome but may not behave so on Gecko.

Fortunately, Chromium just returns some attributes when validAttributesForMarkedText: of NSTextInputClient [1] but it doesn't return these styles when attributedSubstringForProposedRange: of NSTextInputClient is called (always returns non-styled plain text) [2].  Therefore, this patch does not touch IMEInputHandler::GetAttributedSubstringFromRange().

*1 <7d85f23cb0/content/browser/renderer_host/render_widget_host_view_mac.mm (2936)>
*2 <7d85f23cb0/content/browser/renderer_host/render_widget_host_view_mac.mm (3036)>

MozReview-Commit-ID: 1gPIiu4Qbud

--HG--
extra : rebase_source : 5336eea303ee157959941dcc4bda2a0931f1f532
2016-11-07 16:19:41 +09:00
Masayuki Nakano 5ddcf36aa2 Bug 1312649 part.1 TextInputHandler::InsertText() should dispatch composition events instead of keypress events when it replaces a range which is different from current selection r=m_kato
Vietnamese Telex IME handles Backspace key immediately after inputting a word even when there is no marked text.  At this time, it tries to replace the word with specific string.  In such case, our editor shouldn't remove anything at handling the Backspace keypress event.

For avoiding this issue, InserText() should dispatch a set of composition for inserting the specified text into the range.  Then, editor won't perform any action of the key.

Additionally, when a Backspace keydown tries to remove the last character of the word, Telex removes it with a composition.  At this time, it creates dummy marked text "a" and make it empty later. So, in this case, InsertText() won't be called, therefore, we need to consume the Backspace keypress when SetMarkedText() is called for preventing removing the previous character of the word.

MozReview-Commit-ID: LfeEHDWn0cZ

--HG--
extra : rebase_source : 4753262ef16bc3875754ae38e966d8512947ad89
2016-11-07 10:30:05 +09:00
Masayuki Nakano bd146a2e1e Bug 1310565 TextInputHandler shouldn't dispatch a composition events when a key press causes 2 or more characters r=m_kato
TextInputHandler::InsertText() dispatches a set of composition events when a key press causes 2 or more characters (Note that InsertText() is typically called only when IME is available because it's called via [NSResponder interpretKeyEvents]).  However, this is different from the behavior of Windows.  On Windows, NativeKey dispatches two ore more eKeyPress events in this case.

So, for consistency between platforms, TextInputHandler should dispatch eKeyPress events in such case.

MozReview-Commit-ID: EMvaL7sklKf

--HG--
extra : rebase_source : 0309d32d692a2394f53cd59216c6e774068e452b
2016-10-18 15:26:54 +09:00
Masayuki Nakano 6ca17cf78c Bug 1309515 part.2 TextInputHandler::InsertText() should consume current key event when it dispatches composition events r=m_kato
The cause of bug 1309515 is, HandleKeyDownEvent() dispatches eKeyPress events even after InsertText() dispatches composition events via InsertTextAsCommittingComposition().

Therefore, this patch consumes the current key event after dispatching composition events.

Note that for consistency with Windows, InsertText() should use eKeyPress events rather than composition events at least in this case.  However, changing the behavior has some risk.  So, we should fix this bug with the safest hack for uplift.

MozReview-Commit-ID: 7FYR5N2lATe

--HG--
extra : rebase_source : 4485bd76a68567e8c20a84c2fbca78c626f592c5
2016-10-13 13:18:58 +09:00
Masayuki Nakano d7f167f262 Bug 1309515 part.1 Add automated tests for Arabic - PC keyboard layout which can input 2 characters with a key press r=m_kato
MozReview-Commit-ID: GAEIklrf6H0

--HG--
extra : rebase_source : c365e19e8b8e6a878924ad264be3c78fcc4cbb3a
2016-10-14 12:06:30 +09:00
Masayuki Nakano 14f07fdf2d Bug 1305355 part.3 IMEInputHandler shouldn't append any ranges when composition string is empty r=m_kato
IMEInputHandler shouldn't append any ranges to dispatch empty composition event since empty clause information may make TextComposition confused.  Additionally, it doesn't need to append caret range because CompositionTransaction always sets caret at start of composition when the composition string is empty.

MozReview-Commit-ID: FkLWePXZGJf

--HG--
extra : rebase_source : ede2687618ca072b40ba6d21861f1fc97296c416
2016-09-26 17:19:30 +09:00
Xidorn Quan 73cb8d2d09 Bug 898984 - Part 2: Support surrogate pair in XUL cropped element. r=jfkthame 2013-08-11 03:41:00 +09:00
Michael Layzell e67b01fcd0 Bug 1018486 - Part 3: Changes in widget/cocoa/, r=mstange
MozReview-Commit-ID: DhvanRhe9XE
2016-09-07 10:50:38 -04:00
Makoto Kato fee4513fab Bug 1298562 - Use %u instead of %llu for uint32_t. r=masayuki
MozReview-Commit-ID: EF1G77Y30ws

--HG--
extra : rebase_source : 9016ce035194f70d45d0179032ba3baacd73bb5a
2016-08-27 16:09:29 +09:00
Masayuki Nakano c3e9f6adc0 Bug 1296578 IMEInputHandler should use insertion point relative query content events during composition r=m_kato
Start offset of composition string is fixed when composition string becomes non-empty in focused editor. In other words, until composition string is fixed, composition start offset may be changed from selection start offset at dispatching compositionstart event.  Especially, in e10s mode, pending keyboard events usually change composition start offset.

So, while there is composition, IMEHandler should use query events querying text rect or text content relative to actual start offset of composition string because native IME believes composition string at selection selection start when starting composition in the main process.

MozReview-Commit-ID: 3hinwozl9Ow

--HG--
extra : rebase_source : 4b79dd4f53aa51edfc78ff08c07a710160a8de01
2016-08-19 21:51:54 +09:00
Masayuki Nakano a527fb31f9 Bug 1284422 part.4 Fix odd indent of MOZ_LOG() in TextInputHandler.mm r=m_kato
MozReview-Commit-ID: 4ua3yoSgAJv

--HG--
extra : rebase_source : da3d2f847227b3ff6c354f9db0e6b774d1932429
2016-07-05 18:38:53 +09:00
Masayuki Nakano f53ea998ce Bug 1280053 TextInputHandler should initialize WidgetKeyboardEvent without already handled characters r=m_kato
TextInputHandler may dispatch keypress events after InsertText() is called if there was composition and it's committed by "current" keydown event. In that case, [NSEvent characters] may have the committing string.  For example, when Opt+e of US keyboard layout started composition, Cmd+v causes committing the "`" character and pasting the clipboard text. Then, the "v" key's keydown event's |characters| is "`v". So, after InsertText() is called with "`", TextInputHandler shouldn't dispatch keypress event for "`" again. I.e., the KeyboardEvent.key value should be "v" rather than "`v".

For solving this issue, TextInputHandlerBase::AutoInsertStringClearer which is created at every InsertText() call should store the inserted string to TextInputHandlerBase::KeyEventState. However, for making the implemntation simpler, it should recode only when the inserting string is actually a part of [mKeyEvent characters]. Then, TextInputHandlerBase::KeyEventState can compute unhandled insert string at initializing WidgetKeyboardEvent.

So, finally, TextInputHandlerBase::InitKeyEvent() should be called via TextInputHandlerBase::KeyEventState::InitKeyEvent(). This ensures that all key events which may cause InsertText() calls are always initialized with unhandled string.

MozReview-Commit-ID: A9o8o9pV2XV

--HG--
extra : rebase_source : d99e9ab7633f45069d0a3940cc2b2b5ad859ea05
2016-06-19 01:13:16 +09:00
Masayuki Nakano 9b89c75f4d Bug 1280355 part.2 TextInputHandler should use LazyLogModule instead of PR_NewLogModule() r=m_kato
For making TextInputHandler MOZ_LOG* environment variables aware, TextInputHandler should use LazyLogModule.

MozReview-Commit-ID: 9La229BFaJ1

--HG--
extra : rebase_source : f18f689ea6522f3300c5411bcd9e49d4c31143e4
2016-06-16 17:14:34 +09:00
Masayuki Nakano a39783f70c Bug 1280355 part.1 TISInputSourceWrapper::CurrentInputSource() should create the static instance when it's called r=m_kato
This is preparation. TISInputSourceWrapper is created before starting XPCOM, however, when its first instance is created, TextInputHandler.mm tries to log all keyboard layouts and IMEs which are installed into the system. This would be problem if it uses LazyLogModule because it's initialized at starting XPCOM.

MozReview-Commit-ID: DWz8TylL175

--HG--
extra : rebase_source : f377530f6325d6fcf8f90be5d6856972e9d312e5
2016-06-16 17:00:38 +09:00
Masayuki Nakano 46e33a611c Bug 1279170 TextInputHandler::InsertText() should set keypress event's .key value property when it replaces specified range with a character r=m_kato
TextEventDispatcher::MaybeDispatchKeypressEvents() dispatches keypress events with passed event's mKeyNameIndex and mKeyValue values. I.e., setting mCharCode doesn't make sense in this case. Similarly, mKeyCode value is also ignored (overwritten by 0) if it's printable key's key event (mKeyNameIndex == KEY_NAME_INDEX_USE_STRING).

MozReview-Commit-ID: bdBQOlVKTs

--HG--
extra : rebase_source : 0786fb72ce8cc5468bbf3d4d1e5cadaa4586837e
2016-06-16 12:11:01 +09:00
Masayuki Nakano 77a20b523d Bug 1270985 Hide mouse cursor in native keydown event handler if Command key isn't pressed r=m_kato
Currently, TextInputHandler::DispatchEvent() isn't used for WidgetKeyboardEvent nor WidgetCompositionEvent since TextEventDispatcher directly uses nsIWidget::DispatchEvent().  Therefore, old code hiding mouse cursor at dispatching eKeyPress event is never run in current mozilla-central since TextInputHandler dispatches eKeyPress events via TextEventDispatcher.

Additionally, it's not enough to hide mouse cursor only when widget dispatches eKeyPress events because if IME starts composition, eKeyPress event won't be fired until finishing the composition. So, I think that we should hide mouse cursor at receiving native keydown events.  The event handler receives keydown events before IME handles them.  Additionally, modifier key events which won't cause eKeyPress events are not using native keydown event handler, fortunately.  So, I believe that it's the best place to do it.

MozReview-Commit-ID: 9dnpiVEV2Lx

--HG--
extra : rebase_source : fd42be85f93fed9e38eeece2cbdbfb7ad45555ba
2016-06-08 14:37:51 +09:00
Masayuki Nakano 258c1f97d6 Bug 1277756 part.7 Rename TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT to TextRangeType::eSelectedClause r=smaug
MozReview-Commit-ID: GyRYWzfeWrm

--HG--
extra : rebase_source : 8bebacaf675ec4a3cf91cfd434d07beeb7fb1567
2016-06-03 19:15:21 +09:00
Masayuki Nakano 3fa2003d17 Bug 1277756 part.6 Rename TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT to TextRangeType::eConvertedClause r=smaug
MozReview-Commit-ID: 3mexBm278As

--HG--
extra : rebase_source : ef363b0ac50396631e9b145b7e869330509fe259
2016-06-03 19:05:32 +09:00
Masayuki Nakano 98f069e029 Bug 1277756 part.5 Rename TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT to TextRangeType::eSelectedRawClause r=smaug
MozReview-Commit-ID: MbG4siLb4Q

--HG--
extra : rebase_source : 23c20c55c3936dc6af5f57414ef7630003480275
2016-06-03 18:57:21 +09:00
Masayuki Nakano f4254e7f7f Bug 1277756 part.4 Rename TextRangeType::NS_TEXTRANGE_RAWINPUT to TextRangeType::eRawClause r=smaug
MozReview-Commit-ID: KLC1VPiYTdz

--HG--
extra : rebase_source : 3f750e526bb04b26ed66d2c0fada14e7d5b43d73
2016-06-03 18:48:37 +09:00
Masayuki Nakano 6b5425853a Bug 1277756 part.3 Rename TextRangeType::NS_TEXTRANGE_CARETPOSITION to TextRangeType::eCaret r=smaug
MozReview-Commit-ID: CaqmOSxYYU7

--HG--
extra : rebase_source : 5820d491b97be7899150516d05f1426e74dab5b5
2016-06-03 18:40:06 +09:00
Masayuki Nakano 4fc95828b6 Bug 1277756 part.1 Make anonymous enum for NS_TEXTRANGE_* to an enum class named "TextRangeType" r=smaug
For making our code clearer by the stronger type check, we should change the anonymous enum for NS_TEXTRANGE_* to enum class whose name is "TextRangeType" and whose type is "RawTextRangeType" which is an alias of uint8_t.

Additionally, this also adds some utility methods for them.

Note that some lines which are changed by this patch become over 80 characters but it will be fixed by the following patches.

MozReview-Commit-ID: 76izA1WqTkp

--HG--
extra : rebase_source : 27cd8cc8f7f8e82055dbfe82aba94c02beda5fa4
2016-06-04 09:49:21 +09:00
Makoto Kato 100757988a Bug 1276948 - Remove IMEInputHandler::ConversationIdentifier. r=masayuki
This method is for old NSTextInput API and unused now.

MozReview-Commit-ID: thcbEExH58

--HG--
extra : rebase_source : 7d9f665d867366990c5aac5a54555cc2c3483828
2016-05-31 23:18:04 +09:00
Makoto Kato 3cc2e4b00e Bug 1177943 - Part 1. Add LookUpDictionary method to widget. r=masayuki
I would like to add new method to look up dictionary.

MozReview-Commit-ID: Jqk0OelezVF
2016-04-04 17:14:36 +09:00
Makoto Kato 687cbeffb5 Bug 1260091 - Move using SendBidiKeyboardNotify to WidgetUtils. r=masayuki
For e10s, we send Bidi keyboard information to content process.  We should add utility method to share it for all platforms.

MozReview-Commit-ID: JJX26OivQvt

--HG--
extra : rebase_source : fe6d000080e3fa993a27d570c703e93f23439520
2016-05-19 17:47:49 +09:00
Masayuki Nakano 1252a7bf75 Bug 1254755 part.5 Rename WidgetKeyboardEvent::isChar to WidgetKeyboardEvent::mIsChar r=smaug
MozReview-Commit-ID: 58mri5IP3dV

--HG--
extra : rebase_source : fadfc0eb40c2ea9a3a60ba54b0ae7c5cae94f96e
2016-05-12 18:31:05 +09:00
Masayuki Nakano e2fb1c839c Bug 1254755 part.4 Rename WidgetKeyboardEvent::location to WidgetKeyboardEvent::mLocation r=smaug
MozReview-Commit-ID: CjT7izri6Vq

--HG--
extra : rebase_source : 1e82d581b8bf1cce3d3154402f3bb435f7a004f6
2016-05-12 18:17:22 +09:00
Masayuki Nakano 7bfa8a21fa Bug 1254755 part.3 Rename WidgetKeyboardEvent::alternativeCharCodes to WidgetKeyboardEvent::mAlternativeCharCodes r=smaug
MozReview-Commit-ID: 26K8ZxzavfB

--HG--
extra : rebase_source : 5f74e58a784bae2ed626c0c9f7c992228dcff1be
2016-05-12 17:57:21 +09:00
Masayuki Nakano 8a70a17c6a Bug 1254755 part.2 Rename WidgetKeyboardEvent::charCode to WidgetKeyboardEvent::mCharCode r=smaug
And mCharCode shouldn't be compared with NS_VK_*, nsIDOMKeyEvent::DOM_VK_*. Additionally, when it's compared with a character constant, cast isn't necessary.

MozReview-Commit-ID: JMT614copjG

--HG--
extra : rebase_source : 69ee3c589e5a71c814ec9a40ac3aab39c789c11d
2016-05-13 16:06:18 +09:00
Masayuki Nakano 3359bad586 Bug 1254755 part.1 Rename WidgetKeyboardEvent::keyCode to WidgetKeyboardEvent::mKeyCode r=smaug
And also WidgetKeyboardEvent::mKeyCode should be compared with NS_VK_* rather than nsIDOMKeyEvent::DOM_VK_*.

MozReview-Commit-ID: IKjQ1nr8XYe

--HG--
extra : rebase_source : 83125cd2523f6b70759f621470aad23b00aae8ae
2016-05-12 17:13:49 +09:00