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

2226 Коммитов

Автор SHA1 Сообщение Дата
Carsten "Tomcat" Book 6df735c3b7 Merge mozilla-central to autoland 2016-10-04 12:03:18 +02:00
Masayuki Nakano 6f3a61eba6 Bug 1305943 Don't consume following WM_SYSCHAR message for some key combinations which are reserved by the system r=m_kato
When key combination is reserved by the system, web apps shouldn't be able to consume the key events.  In such case, we've decided that we never expose the key events in web contents (including chrome contents).  Therefore, NativeKey stops dispatching keyboard events only for Alt+Space.

However, new code of the fix of bug 1300003 always consumes WM_SYSCHAR which follows WM_SYSKEYDOWN of Alt+Space.  This is the cause of bug 1305943.

For fixing this bug, NativeKey should have a helper method, IsReservedBySystem(), and when it returns true, it should do nothing when Handle*Message() is called and should not consume following WM_SYSCHAR messages at handling WM_*KEYDOWN.

Unfortunately, it's impossible to test this regression because nsDOMWindowUtils::SendNativeKeyEvent() may call nsIWidget::SynthesizeNativeKeyEvent() asynchronously.  See <https://dxr.mozilla.org/mozilla-central/source/dom/base/nsDOMWindowUtils.cpp#1105-1108>.  Therefore, it cannot return if it's consumed.

MozReview-Commit-ID: 9ABh2rYNkFs

--HG--
extra : rebase_source : 7416e45babccce3af795dc523f46dc00fdddc6c7
2016-09-30 17:32:34 +09:00
Masayuki Nakano e2d42463da Bug 1306549 part.10 Reorder member declaration of KeyboardLayout class r=m_kato
We usually declare class members with following order:

1. public members
2. private members
3. friends

However, current KeyboardLayout is declared with completely opposite order.  Let's use usual order for preventing mistakes.

MozReview-Commit-ID: LwOcEUbJzes

--HG--
extra : rebase_source : 828b5d14f1b38f46e4ae5244d15de68c4db6785c
2016-10-04 16:37:07 +09:00
Masayuki Nakano d2ec7a36c3 Bug 1306549 part.9 Create KeyboardLayout::IsInDeadKeySequence() which returns true while it's in a dead key sequence r=m_kato
Currently, checking if it's in dead key sequence directly refers mActiveDeadKey.  However, this isn't clear for most developers.  So, let's create a helper method, IsInDeadKeySequence(), and wrap the nonintuitive check.

MozReview-Commit-ID: 7qTer9R8Gfs

--HG--
extra : rebase_source : 6ecb20cc3f5e28cfcf41fb33df8603785288bdda
2016-09-30 15:55:51 +09:00
Masayuki Nakano 6a00ae82ee Bug 1306549 part.8 Get rid of |virtualKey| and |isKeyDown| from KeyboardLayout::InitNativeKey() and KeyboardLayout::MaybeInitNativeKeyAsDeadKey() r=m_kato
For preventing wrapping long lines, old KeyboardLayout::InitNativeKey() uses two variables |virtualKey| and |isKeyDown| which are never modified.  However, they may be not clear for some developers where they came from.  Additionally, preceding patches reduced a lot of users of them and indent level.  Therefore, even if we remove these variables, we don't need additional line breaks in most cases.  So, removing them is better for easier to understand.

MozReview-Commit-ID: 680bYVINPAE

--HG--
extra : rebase_source : 15f4398072ccfe659fc6d2ae95a3f13261efa5af
2016-09-30 15:40:40 +09:00
Masayuki Nakano 05ede9d10b Bug 1306549 part.7 Create KeyboardLayout::MaybeInitNativeKeyAsDeadKey() r=m_kato
This patch creates KeyboardLayout::MaybeInitNativeKeyAsDeadKey() for wrapping dead key handling code in KeyboardLayout::InitNativeKey().

This makes InitNativeKey() code simpler.  Now, any developers must be able to understand what InitNativeKey() does easier than before fixing this bug.

MozReview-Commit-ID: C59ESUXeTxU

--HG--
extra : rebase_source : c840a0544470ec4081e80c11e050d4dfedef4cad
2016-09-30 16:06:00 +09:00
Masayuki Nakano 022c2c76a7 Bug 1306549 part.6 Create KeyboardLayout::ActivateDeadKeyState() r=m_kato
There is DeactivateDeadKeyState() but not ActivateDeadKeyState().  There should be both of them and hides the dead key state management into them.

MozReview-Commit-ID: JvAPE5f2HVy

--HG--
extra : rebase_source : d7027a1a6b75c6859e79d651d3e9b0136cc09891
2016-09-16 19:09:12 +09:00
Masayuki Nakano c5efc36210 Bug 1306549 part.5 Create KeyboardLayout::GetCompositeChar() for wrapping VirtualKey::GetCompositeChar() r=m_kato
VirtualKey::GetCompositeChar() needs index of virtual keycode which may make around the caller messy.  So, KeyboardLayout::GetCompositeChar() should wrap it and KeyboardLayout::MaybeInitNativeKeyWithCompositeChar() should use it.

MozReview-Commit-ID: 8KLTJpCFZ8u

--HG--
extra : rebase_source : fd13c009330fd485c8cba30f469fc645b560c623
2016-09-16 18:54:48 +09:00
Masayuki Nakano da22fd3b2b Bug 1306549 part.4 Create KeyboardLayout::GetNativeUniCharsAndModifiers() for wrapping VirtualKey::GetNativeUniChars() r=m_kato
Similar to VirtualKey::GetUniChars(), VirtualKey::GetNativeUniChars() needs key index.  So, it should be wrapped by a new helper method, KeyboardLayout::GetNativeUniCharsAndModifiers(), and KeyboardEvent::InitNativeKey() should use this instead of accessing its member's GetNativeUniChars().

MozReview-Commit-ID: 7M9OlNF698Y

--HG--
extra : rebase_source : e19a5c99014a8f0a0ed7cc3a86fe0c4ee10cebb5
2016-09-16 18:38:53 +09:00
Masayuki Nakano 49ebeb51f0 Bug 1306549 part.3 KeyboardLayout::InitNativeKey() should use GetUniCharsAndModifiers() instead of using VirtualKey::GetUniChars() directly r=m_kato
When InitNativeKey() retrieves UniCharsAndModifiers for a key, it needs key index for the given virtual keycode.  Therefore, wrapping the code with GetUniCharsAndModifiers() makes InitNativeKey() code simpler since each call specifies the virtual keycode to the method instead of key index.

MozReview-Commit-ID: Azy8chXexaz

--HG--
extra : rebase_source : 98da43e7f542037f952206cd3db731f6cbb097e7
2016-09-16 18:22:12 +09:00
Masayuki Nakano 1559d32969 Bug 1306549 part.2 Create overload methods which take ModifierKeyState instead of VirtualKey::ShiftState r=m_kato
This patch gets rid of |shiftState| from KeyboardLayout::InitNativeKey() and make each caller clearer.  This must make other developers understand what modifier state is used at each call.

MozReview-Commit-ID: 6zydP1jkffv

--HG--
extra : rebase_source : ea1d5f49ea02812aa632bdbad871688879f2b401
2016-09-30 15:32:10 +09:00
Masayuki Nakano af0de6d7e8 Bug 1306549 part.1 KeyboardLayout::InitNativeKey() should use KeyboardLayout::IsDeadKey() r=m_kato
KeyboardLayout::InitNativeKey() is very messy because it handles a lot of cases without helper methods.

It's important to make it simpler implementation for preventing regressions caused by some patches which are written with misunderstanding.  So, let's rewrite the method with helper method.

First, this patch make InitNativeKey() use IsDeadKey() instead of referring the table because calling IsDeadKey() is easier to understand.

MozReview-Commit-ID: DtN9qoh7Gz7

--HG--
extra : rebase_source : 8e769c1c88bfe646940491c111de609dbf53eeec
2016-09-16 17:24:39 +09:00
Stone Shih 2df4b9dc8d Bug 1299195 - [Pointer Events] Filter double click event (input source=touch) to prevent dispatching extra mousedown and pointerdown events to content. r=kats
--HG--
rename : gfx/layers/apz/test/mochitest/test_bug1285070.html => gfx/layers/apz/test/mochitest/test_group_pointerevents.html
extra : rebase_source : cc47f2ead72bf332faac2b5a76b45036e5085937
2016-09-20 10:48:11 +08:00
David Anderson 56cd5719ee Fix vsync sometimes not firing after the GPU process crashes. (bug 1305628, r=mattwoodrow) 2016-09-30 01:23:52 -07:00
Kartikaya Gupta d0ea79dc37 Bug 1300203 - Ensure that sLastMouseMovePoint is updated even for touch-induced WM_MOUSEMOVE messages. r=jimm
MozReview-Commit-ID: 4qsjdL5iXVR
2016-09-29 15:15:00 -04:00
Carsten "Tomcat" Book 572e74ee99 merge mozilla-inbound to mozilla-central a=merge 2016-09-28 15:56:33 +02:00
Masayuki Nakano 2e184aba98 Bug 1305355 part.2 TSFTextStore shouldn't append any ranges when composition string is empty r=m_kato
TSFTextStore 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: Iu8IWwEOxaf

--HG--
extra : rebase_source : 70b56c6d4caee309615170aee70f28d8c3eb7d92
2016-09-26 17:12:34 +09:00
Sebastian Hengst a026f5edf9 Backed out changeset 7bcb0c169466 (bug 1305628) for crashing with mozilla::OffTheBooksMutex::Lock. r=backout 2016-09-27 23:21:47 +02:00
Aaron Klotz 96c052cf1f Bug 1304883: Modify mscom::MainThreadInvoker and Win32 widget to use atomic boolean to flag pending APCs; r=jimm
MozReview-Commit-ID: 7fXoDkBEd2V

--HG--
extra : rebase_source : 1960f9bf8294bfea15209554dd7fdc0ce1df5dcc
2016-09-22 15:07:01 -06:00
David Anderson ea061497c3 Fix vsync sometimes not firing after the GPU process crashes. (bug 1305628, r=mattwoodrow) 2016-09-27 13:15:55 -07:00
George Wright 865f4251ec Bug 1304360 - Add Windows 7 w/Intel drivers less than or equal to build ID 1749 to the blocklist for D3D9 layers r=milan 2016-09-27 16:10:02 -04:00
Masayuki Nakano caa4d59b38 Bug 1302956 part.2 NativeKey shouldn't handle char message if it's created during another instance is trying to remove a char message from the queue r=m_kato
When NativeKey tries to remove a char message from the queue, another NativeKey instance might be created due to odd API hook or something.  In such case, the old instance should handle the received message and the new instance should do nothing for keeping the order of message handling.

This patch makes:

* NativeKey::GetFollowingCharMsg() store removing char message to mRemovingMsg before calling PeekMessage() with PM_REMOVE.
* NativeKey::InitWithChar() set the old instance's mReceivedMsg to the received char message and do nothing even if HandleCharMessage() is called later.
* NativeKey::GetFollowingCharMsg() return received char message if mReceivedMsg is set during a call of PeekMessage().

MozReview-Commit-ID: KXYW0GgC9AY

--HG--
extra : rebase_source : 08472dec28e93450cd04a367843c1511cb812a9c
2016-09-23 16:40:01 +09:00
Masayuki Nakano bf273c667a Bug 1302956 part.1 NativeKey should store latest instance with sLatestInstance r=m_kato
For detecting nested creation of NativeKey instances, NativeKey should manage the latest instance with sLastestInstance for the other instances and previous instance with mLastInstance.

MozReview-Commit-ID: BFZ0cr1640S

--HG--
extra : rebase_source : e2439a21f5984c6246283924c2013038c734ae2a
2016-09-15 17:02:30 +09:00
Masayuki Nakano c4106a36a9 Bug 1297013 part.3 Make NativeKey log its behavior r=m_kato
MozReview-Commit-ID: 6ksuMFMxQdM

--HG--
extra : rebase_source : 28f04d8e5d33c018a8bcda7d8ae1a84da07eaeb9
2016-09-21 13:29:34 +09:00
Masayuki Nakano 92ba10120f Bug 1297013 part.1 Implement ToString(const MSG&) for logging key related message with detail r=m_kato
For logging message, we should have better log text generator for MSG.

Then, we can improve the note of crash reports which is appended in NativeKey::GetFollowingCharMessage().

MozReview-Commit-ID: 4sbZJaWFH2o

--HG--
extra : rebase_source : bbc3101a78e4e2aa8b5eb0f68cd6f3605ba924f6
2016-08-26 20:52:25 +09:00
Masayuki Nakano eac959a338 Bug 1300003 part.6 NativeKey shouldn't try to dispatch plugin events for removed char messages when mWidget won't dispatch plugin events r=m_kato
Currently, NativeKey::DispatchPluginEventsAndDiscardsCharMessages() calls nsWindowBase::DispatchPluginEvent() and nsWindowBase::DispatchPluginEvent() does nothing when windowless plugin doesn't have focus.  However, this is unclear when other developers read the code of DispatchPluginEventsAndDiscardsCharMessages() and it causes unnecessary virtual calls.  So, it should try to dispatch plugin events only when a windowless plugin has focus.

For making the check safer, nsWindowBase should expose the method to check it as ShouldDispatchPluginEvent().  Unfortunately, we cannot mark this method as const due to PluginHasFocus() needs to be not const method, though.  Then, for loops in DispatchPluginEventsAndDiscardsCharMessages() should check it at each try.

This change helps to log the behavior (working on bug 1297013) without noise.

Additionally, this patch renames the method to MaybeDispatchPluginEventsForRemovedCharMessages() because it doesn't remove any char messages anymore.

MozReview-Commit-ID: F14Lcx47M6U

--HG--
extra : rebase_source : 64b6da75590c99299f75358023844762198136d6
2016-09-15 00:16:18 +09:00
Masayuki Nakano 050c1b4088 Bug 1300003 part.5 Remove odd WM_CHAR messages which are caused by ATOK or WXG (both of them are Japanese IME) r=m_kato
NativeKey removes odd WM_CHAR messages which are caused by ATOK or WXG if the user tries to do "Kakutei-Undo" (meaning "undo the last commit") after dispatching eKeyDown event.

However, NativeKey should remove them from the queue first because there are some problems:

* If focus is moved during dispatching an eKeyDown event, we'll fail to remove the messages from the queue.
* If dispatching eKeyDown advance native event loop due to entering to a modal loop or dosing synchronous XHR, the message pattern is broken before removing the odd messages from the queue.

After removing the odd char messages, NativeKey should store them with mRemovedOddCharMsgs because NativeKey needs to dispatch them to focused windowless plugin.

Note that this patch also fixes a bug of the loop to remove the odd WM_CHAR messages.  Old code removes only one WM_CHAR messages, but we need to remove all WM_CHAR messages before WM_KEYUP.  This must be a regression.

MozReview-Commit-ID: I60bcIx2SFS

--HG--
extra : rebase_source : 19d0e70d9f39e6d0476c62def5e0a2dc1e0ab444
2016-09-14 16:20:53 +09:00
Masayuki Nakano c0ad8a8fb2 Bug 1300003 part.4 Remove NativeKey::mIsFollowedByNonControlCharMessage because calling NativeKey::IsFollowedByNonControlCharMessage() is enough fast r=m_kato
NativeKey is now removing and storing following char messages when it's created for a keydown message.  Therefore, IsFollowedByNonControlCharMessage() just refers the stored messages and it's enough fast.  So, we can get rid of mIsFollowedByNonControlCharMessage.

MozReview-Commit-ID: 542A2sHNXeC

--HG--
extra : rebase_source : e748c9855c3cf2d45609f94f9ccc8d43d29dc447
2016-09-05 21:47:58 +09:00
Masayuki Nakano 308955d236 Bug 1300003 part.3 NativeKey::GetFollowingCharMessage() should always remove following WM_CHAR message r=m_kato
GetFollowingCharMessage() is now called only when removing following char message.  Therefore, it does not need to have the optional argument indicating if removing the found message.

MozReview-Commit-ID: 7P39wyfSC1

--HG--
extra : rebase_source : a38bb961df1bc03adc21295bc39e4e9c16e864f2
2016-09-05 21:41:48 +09:00
Masayuki Nakano 6934d7ed93 Bug 1300003 part.2 Don't continue to dispatch eKeyPress event at handling WM_KEYDOWN or following WM_CHAR messages if focused window is changed during dispatching an event r=m_kato
While dispatching an event, focused widget may be changed.  In such case, NativeKey shouldn't continue to dispatch remaining events (eKeyPress events) for preventing to dispatch to input text in unexpected website.

MozReview-Commit-ID: 7geuqks0LQK

--HG--
extra : rebase_source : 3e6c82e1eb0e27115fe93b1a3b4a155914fd06f7
2016-09-05 18:56:34 +09:00
Masayuki Nakano af43a9e1dc Bug 1300003 part.1 NativeKey should remove following char messages before dispatching a keydown event r=m_kato
In some cases, we may receive following char message of WM_*KEYDOWN *during* dispatching an eKeyDown event. In such case, NativeKey shouldn't dispatch eKeyPress event twice (one is caused by receiving WM_*CHAR message, the other is caused by post dispatching eKeyDown event code).

This patch makes NativeKey consume following WM_*CHAR messages before dispatching eKeyDown.  Therefore, the former case will never occur.

For doing that, NativeKey stores following WM_*CHAR messages in mFollowingCharMsgs and uses it when it needs to dispatch eKeyPress events for each WM_*CHAR message.

MozReview-Commit-ID: 6QNvlwVVlTz

--HG--
extra : rebase_source : c33b5a1ac503326d51ef78f4f8a09c9a63df7871
2016-09-15 00:02:15 +09:00
Masayuki Nakano b8318c87fb Bug 1300937 part.4 NativeKey::GetScanCodeWithExtendedFlag() should return 0xE0XX even on WinXP or WinServer2003 r=m_kato
For safety, NativeKey::GetScanCodeWithExtendedFlag() returns without extended flag on WinXP and WinServer2003 because ::MapVirtualKeyEx() API doesn't support extend key conversion.

However, extended scan code is available even on them when lParam has 0x1000000 especially when it computes KeyboardEvent.code value.  Therefore, it should return with 0xE000 for extended keys on any versions of Windows.

Note that NativeKey::ComputeVirtualKeyCodeFromScanCodeEx() wraps ::MapVirtualKeyEx() API.  It checks if the API is not available for the result of NativeKey::GetScanCodeWithExtendedFlag().  So, returning extended scan code from NativeKey::GetScanCodeWithExtendedFlag() is safe.

MozReview-Commit-ID: D2RrHxPI9ET

--HG--
extra : rebase_source : 51f277e8331eb7ad109c3227ac1fe73f6de48105
2016-09-16 10:17:44 +09:00
Masayuki Nakano 05960c4ff6 Bug 1300937 part.2 Automated tests which synthesize native key events on Windows should specify scan code value explicitly r=smaug
On Windows, some keys are called "extended key".  Their scan code include 0xE000.  For example, Enter key in standard position is 0x001C but Numpad's Enter key is 0xE01C.  Unfortunately, both of them cause same virtual keycode value, VK_RETURN.  Therefore, currently, nsIDOMWindowUtils.sendNativeKey() can synthesize only one native key event of them (only non-extended key's event).  Additionally, MapVirtualKeyEx() API with MAPVK_VK_TO_VSC (even with MAPVK_VK_TO_VSC_EX) don't return extended scancode value as expected.

For solving these issues, we should include scan code value to the virtual keycode value at calling sendNativeKey().

Fortunately, virtual keycode value on Windows is 0 ~ 255 (0x00 ~ 0xFF) but aNativeKeyCode of sendNativeKey() is int32_t.  So, we can use upper 16 bit for specifying scan code.

This patch explicitly specifies scan code value at defining WIN_VK_* in NativeKeyCodes.js.  Additionally, this patch duplicates native virtual keycode definition for Home, End, Insert, Delete, PageUp, PageDown, ArrowUp, ArrowLeft, ArrowDown, ArrowRight and Enter as WIN_VK_* and WIN_VK_NUMPAD_*.  This makes automated tests can specify both positions' keys explicitly.

Finally, this patch adds some tests to test_keycodes.xul for testing KeyboardEvent.code value of those keys in both positions.

MozReview-Commit-ID: 8n1rQ71dilg

--HG--
extra : rebase_source : 8215e56ba1ed9fc54c04eb7ca037b12c3ced5c1b
2016-09-13 19:38:23 +09:00
Xidorn Quan bd57d227da Bug 888781 part 2 - Scale cursor with the window scale on Windows. r=jimm
MozReview-Commit-ID: C9LZpJF98mQ

--HG--
extra : rebase_source : 34791db2d6f511e07070ae5391106eb66d0ef2cd
2016-09-19 10:35:48 +10:00
Xidorn Quan f9678375c6 Bug 888781 part 1 - Use cached default scale in GetDefaultScaleInternal of Windows. r=jimm
MozReview-Commit-ID: Ebm7h3h2mrg

--HG--
extra : rebase_source : e37ddbfca0eee4a7ba04121709f93048b0aab899
2016-09-19 10:35:12 +10:00
Thomas Wisniewski e2d5d5425f Bug 1302937 - Remove -moz-mac-lion-theme. r=mstange 2016-09-16 14:42:19 -04:00
Nicolas Silva 79bb9f5c0e Bug 1284837 - Disallow implicit conversions from float to integer when creating. r=botond 2016-09-16 17:49:39 +02:00
Nathan Froyd 5f3f5ad1d7 Bug 1296746 - followup - fix silly typo; r=bustage 2016-09-14 19:53:59 -04:00
Nathan Froyd bb7f2dc621 Bug 1296746 - explicitly ignore the result of Send{Observe,Unobserve}Vsync in CompositorWidgetParent; r=jimm 2016-09-14 19:28:26 -04:00
Makoto Kato 4dd22032fa Bug 1300140 - Return error when IME attribute array doesn't have valid. r=masayuki
MozReview-Commit-ID: 2paKhQNSR11

--HG--
extra : rebase_source : 407622cc47defcb34cbbe87734d95a96ce66cf14
2016-09-14 11:09:00 +09:00
Makoto Kato fe2967b415 Bug 1300143 - Set length before accessing array even if array capacity has enougth size. r=masayuki
MozReview-Commit-ID: F5IoXBOnouc

--HG--
extra : rebase_source : f6dde2d1efad1d26c2c6c22e54142cf21105db8c
2016-09-14 11:07:19 +09:00
Carsten "Tomcat" Book c81bda3e2d Merge mozilla-central to autoland 2016-09-09 12:19:59 +02:00
Gerald Squelart f4bed109c8 Bug 1301615 - Restrict block from bug 1267970 to win10 - r=kentuckyfriedtakahe
MozReview-Commit-ID: ElERUckchnn

--HG--
extra : rebase_source : 231d3ad6a6a3f7b981921d1a9827a37b28a7e0ce
2016-09-09 17:01:00 +10:00
Aaron Klotz 23956d09e2 Bug 1301184: Notify the profiler and hang monitor when we're executing APCs; r=jimm
MozReview-Commit-ID: B4nTiAf9GNk
2016-09-06 14:39:37 -06:00
Jonathan Kew 99d8332346 Bug 1289143 - Apply the appropriate scaling to window edges when processing WM_NCCALCSIZE for a window on a secondary screen with non-system DPI. r=emk 2016-09-06 17:53:50 +01:00
Chih-Yi Leu 3e3fd845b4 Bug 1299757 - Only use build id for Intel blocklist entry 'FEATURE_FAILURE_BUG_594877'. r=ethlin, r=milan 2016-09-05 01:03:00 +02:00
Chih-Yi Leu 9a2500bfb6 Bug 1295902 - Only use build id for Intel blocklist entry 'FEATURE_FAILURE_BUG_1203199_1'. r=ethlin 2016-08-31 20:34:00 +02:00
Masayuki Nakano 45df2cd377 Bug 1300319 part.1 NativeKey::IsControlChar() should return true when the char is 0x7F (control character, DELETE) r=m_kato
Ctrl+Backspace causes WM_CHAR for control character DELETE.  However, NativeKey::IsControlChar() doesn't treat it as a control character.  Therefore, NativeKey treats Backspace key as a printable character.

MozReview-Commit-ID: 29V45CNp8kW

--HG--
extra : rebase_source : 6656d884addf8b49dfa7c12d0b2c8d0543493c4f
2016-09-05 12:51:49 +09:00
Masayuki Nakano 8a11a75b19 Bug 1297985 part.2 KeyboardLayout should handle a composite character produced by 2 dead keys r=m_kato
On some keyboard layouts, a key sequence, a dead key -> another dead key, may produce a composite character instead of two base characters for each key.  For example, with "Russian - Mnemonic" keyboard layout on Win 8 or later, both 's' and 'c' are dead keys but key sequence, 's' -> 'c', produces a Unicode character.

For solving this issue, this patch fixes 2 bugs:

First, KeyboardLayout::GetDeadKeyCombinations() doesn't add dead key entry if 2nd key is a dead key (::ToUnicodeEx() returns -1).  In such case, it should add a dead key entry with the first character which is produced when only the 2nd key is pressed (the character is called as "base character" and used for index of the dead key table).

Next, KeyboardLayout::InitNativeKey() should check if 2nd dead key press produces a composite character.  If it's produced, it should initialize given NativeKey with the composite character.  Otherwise, it should initialize with base characters of each key.  This patch does it with KeyboardLayout::MaybeInitNativeKeyWithCompositeChar().

Finally, we should add automated test for this. However, unfortunately, it's not available on Win7 and our infra is still using Win7 for running automated tests.  Therefore, this patch doesn't include new automated tests.

MozReview-Commit-ID: G1DrfkHKNcK

--HG--
extra : rebase_source : 6ff4278d594a26a0908464b1e603a0a7ee2b3b38
2016-09-01 17:29:11 +09:00
Masayuki Nakano af458c6eea Bug 1297985 part.1 Log KeybordLayout::LoadLayout() to help developers to understand what data is created r=m_kato
It's difficult to understand what data is created by KeyboardLayout::LoadLayout().  So, for understanding what data is created, let's add logging code into it.

MozReview-Commit-ID: CelxyVpGn5f

--HG--
extra : rebase_source : fd8f15a42c4c2b4c1f1079184060c6e5f796ac5a
2016-09-01 17:32:14 +09:00