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

21085 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 2c0c609d8a Bug 1303273 part.7 Hide UniCharsAndModifiers::mLength and make its type size_t r=m_kato
MozReview-Commit-ID: 7QLdmgopOwG

--HG--
extra : rebase_source : 89d077c20edab65ac7c2c637b2cda94b6d1ab30d
2016-10-07 13:39:15 +09:00
Masayuki Nakano c20c0f333a Bug 1303273 part.6 Hide UniCharsAndModifiers::mModifiers r=m_kato
MozReview-Commit-ID: 9KKN5mlJadg

--HG--
extra : rebase_source : a3109eca884b3795f4a069bc5c694d1f495ef86b
2016-10-07 13:25:40 +09:00
Masayuki Nakano 0d6b0439b4 Bug 1303273 part.5 UniCharsAndModifiers should hide mChars r=m_kato
Now, we have an security issue.  mCommittedCharsAndModifiers may be initialized with multiple WM_(SYS)CHAR messages.  However, if it's generated by odd (or malicious) middleware, mCommittedCharsAndModifiers may be overflown because it has only fixed array.  For fixing this issue, first, we should hide the members for making the users not depend on the design of UniCharsAndModifiers.

This patch changes UniCharsAndModifiers to a class and hiding mChars and adding |CharAt() const|.

MozReview-Commit-ID: 5EjrIhmCdE4

--HG--
extra : rebase_source : a3dc68998f5f177582addd8587c4da86b2d17b3b
2016-10-07 12:04:49 +09:00
Masayuki Nakano ae437d0a9a Bug 1303273 part.4 Add automated tests for bug 1293505, bug 1307703 and bug 1297985 r=m_kato
Now, NativeKey respects following WM_CHAR message.  Therefore, we can create a test for bug 1293505 which a function key causes a printable character.

Additionally, bug 1307703 is now fixed by the previous patch.  So, let's add automated test for it too.

Finally, now, I found a way to test with some keyboard layouts which are not available on old Windows.  Therefore, we should add automated tests for bug 1297985 too.

MozReview-Commit-ID: IqCEPbPYrcQ

--HG--
extra : rebase_source : 451d0264f1180cae7d7035a498f1c13416d53246
2016-10-07 11:42:20 +09:00
Masayuki Nakano 8c926d5f82 Bug 1303273 part.3 Dispatch eKeyPress events without NativeKey::HandleCharMessage() when it handles WM_(SYS)KEYDOWN message and there are following WM_(SYS)CHAR messages which includes non-control character r=m_kato
This patch creates NativeKey::DispatchKeyPressEventsWithRetrievedCharMessages() for dispatching eKeyPress event with mCommittedCharsAndModifiers when it stores following printable WM_(SYS)CHAR messages.

Using loop for dispatching eKeyPress event for every WM_(SYS)CHAR message is wrong because WidgetKeyboardEvent::mKeyValue is initialized with mCommittedCharsAndModifiers and it causes TextEventDispatcher dispatching multiple eKeyPress events at every call of MaybeDispatchKeypressEvents().  Therefore, if mKeyValue is "^^", eKeyPress event is dispatched 4 times --for the first message, eKeyPress events are fired for each "^" and for the second message, eKeyPress events are fired again for each "^"--.  Therefore, when it handles WM_(SYS)KEYDOWN and it causes inputting one or more printable characters, it's the easiest way not to use HandleCharMessage().

The new method calls TextEventDispatcher::MaybeDispatchKeypressEvents() only once and it requests to call the callback method with new argument of MaybeDispatchKeypressEvents() when it needs to dispatch 2 or more eKeyPress events.  Then, NativeKey::WillDispatchKeyboardEvent() can set each eKeyPress event to raw information of the message and proper modifier state.

With this change, we can dispatch multiple eKeyPress events with retrieved WM_(SYS)CHAR message information rather than retrieved information from active keyboard layout.  Therefore, NeedsToHandleWithoutFollowingCharMessages() doesn't return true even when mCommittedCharsAndModifiers stores two or more characters.

FYI: there is a bug in test_keycodes.xul. That is, Alt+'A' of Greek keyboard layout should cause WM_SYSCHAR with a corresponding Greek character but ASCII characters are specified.  Therefore, this patch includes the fix of these bugs

MozReview-Commit-ID: JVm7ZJVug0O

--HG--
extra : rebase_source : 414ecbe2c01c53f294d1346414b1a289aa0abfe8
2016-10-06 20:52:03 +09:00
Masayuki Nakano 642d448ca7 Bug 1303273 part.2 KeyboardLayout::InitNativeKey() should initialize aNativeKey.mCommittedCharsAndModifiers with following WM_CHAR or WM_SYSCHAR messages which are not providing a control character r=m_kato
First, mCommittedCharsAndModifiers should be initialized with following char messages because the messages could be different from the information of current keyboard layout.

So, this patch guarantees that mCommittedCharsAndModifiers are same as the user expected when there is one or more WM_CHAR or WM_SYSCHAR messages.

MozReview-Commit-ID: I5Ack0xccoL

--HG--
extra : rebase_source : e4c7af75fd200f30ec52b53dc05f49ae8887c6f0
2016-10-07 11:36:34 +09:00
Masayuki Nakano add7eea556 Bug 1303273 part.1 KeyboardLayout::IsSysKey() should check MODIFIER_ALT as a bit flag r=m_kato
This is a simple mistake and blocks following patchs' automated tests.

For example, when Alt+Shift+foo doesn't cause text, this returns false even though it should return true.

MozReview-Commit-ID: 91L33vZhouT

--HG--
extra : rebase_source : be7d4e7ad670c1b03e6497c1c313c187ece80c1c
2016-10-11 13:00:45 +09:00
James Cheng 6e3e960784 Bug 1306219-Part2 Add utility function to invoke MediaDrm and MediaCrypto checking API. r=cpearce,jchen
MozReview-Commit-ID: FFDjmKQh2gP

--HG--
extra : rebase_source : 5ad9a90d78632c6bff6457a38efa7d41d1624992
2016-10-26 10:55:16 +08:00
Aryeh Gregor f0ca6ef4ca Bug 1271125 part 2 - Port editor mochitests that depend on ChromeUtils.js to mochitest-plain; r=masayuki
The change from ok() to is() in tests is so that the failure message is
more informative -- it now tells you the returned exception.

This commit omits test_contenteditable_text_input_handling.html because of test
failures that I haven't figured out.

MozReview-Commit-ID: 37cYlQlJZm7
2016-10-31 18:38:04 +02:00
Sebastian Hengst cdcc9e20da Bug 1304829 - rename RELEASE_BUILD to RELEASE_OR_BETA: main part. r=ted,Mossop
MozReview-Commit-ID: 1lCt0xTMV5O
2016-10-08 11:14:49 +02:00
Ryan VanderMeulen 38574eeac5 Merge m-c to inbound. a=merge 2016-10-07 09:44:29 -04:00
Ryan VanderMeulen 7ebb50e21d Merge inbound to m-c. a=merge 2016-10-07 09:42:25 -04:00
Nicolas Silva 9f87d72b3f Bug 1299860 - Don't use the compositor backend of a popup with ImageBridge and VRManager. r=Bas 2016-10-07 11:08:32 +02:00
Masayuki Nakano 0f3c94dc03 Bug 1307112 part.10 Clean up NativeKey::HandleCharMessage() r=m_kato
Now, NativeKey::HandleCharMessage() has almost same code, one is for dispatching eKeyPress event for non-printable keys or printable keys when one of Alt or Ctrl key is pressed, the other is for printable keys when Alt or Ctrl key is pressed.

The difference of them is, the former block removes Alt state and Ctrl state for handling AltGr key.  When AltGr key is pressed, both Alt and Ctrl state are true.  However, EditorBase treas keypress events whose altKey or ctrlKey is true as non-printable key event.  Therefore, we need to set these modifier state to false when AltGr key is pressed and the key causes some text.

Note that as far as we know, when a key press with AltGr doesn't cause any characters, WM_CHAR isn't generated.  Therefore, we don't need to check with complicated logic if the key event is actually inputting a character.

MozReview-Commit-ID: BRNWfICvkSm

--HG--
extra : rebase_source : 3b8a2aaeb4c53be1567f7a8d17dfef1af90406dd
2016-10-04 23:01:14 +09:00
Masayuki Nakano 69a96b6460 Bug 1307112 part.9 Get rid of remaining hacks for KeyboardEvent.charCode when Ctrl or Alt is pressed r=m_kato
Current shortcut key handling is really difference from what we did before struggling with "key hell".  Therefore, remaining hacks for charCode in NativeKey::HandleCharMessage() are not necessary because they are for old code.

MozReview-Commit-ID: 3hvsBOiJ6VV

--HG--
extra : rebase_source : 7387fc89930f9b15d5d01612eb4a7a5726924bcd
2016-10-04 22:21:49 +09:00
Masayuki Nakano 337db43f23 Bug 1307112 part.8 NativeKey::HandleCharMessage() shouldn't dispatch eKeyPress event when its message is inputting a control character r=m_kato
This patch makes NativeKey::HandleCharMessage() stop dispatching eKeyPress event when the message is inputting a control character.  NativeKey::HandleCharMessage() runs following cases:

1. WM_KEYDOWN followed by a WM_CHAR message whose wParam is not a control character causes inputting printable characters.
2. WM_CHAR message is received without WM_KEYDOWN message.

So, when HandleCharMessage() is called for a control character, it's unusual case.  E.g., another application sends only WM_CHAR message with a control character.

On the other hand, Gecko is the only browser which dispatches "keypress" event even if pressed printable key doesn't cause inputting any characters.  And such "keypress" event is used for shortcut key handling and some default action handling.  So, even if we stop dispatching eKeyPress event from HandleCharMessage(), it shouldn't affect most users.

Note that this patch does NOT change the behavior when the user inputs a control character with usual keyboard layout such as Ctrl+A of en-US keyboard layout because DispatchKeyPressEventsWithoutCharMessage() dispatches eKeyPress event in such cases.

This patch also adds a lot of tests with Ctrl or Alt state for detecting regressions.

MozReview-Commit-ID: KUNqTp7RDSc

--HG--
extra : rebase_source : f91e37b0b82a8e8a95444a08f6d3101f14fadc50
2016-10-05 15:18:00 +09:00
Masayuki Nakano 1c049b2afa Bug 1307112 part.7 Get rid of Enter and Backspace key hack in NativeKey class r=m_kato
Currently, Enter and Backspace keys are handled without following WM_(SYS)CHAR message.  However, older code needs hack for them for avoiding conflict with Ctrl+J vs. Ctrl+Enter, etc.

So, we can get rid of them now.  And when a keydown causes inputting a control character, NativeKey should handle it with keyboard layout (i.e., without following char message(s)).

MozReview-Commit-ID: 6bVuK0BzFbx

--HG--
extra : rebase_source : 08ff45c1990ef8f3ed7703c69b2dc22e5f1dd6f5
2016-10-04 00:21:40 +09:00
Masayuki Nakano 151e2402f9 Bug 1307112 part.6 Get rid of char message argument from public NativeKey::HandleCharMessage() method r=m_kato
Currently, NativeKey::HandleCharMessage() is only a public method and it takes any char message.  However, when it's called outside of NativeKey, it should work only with NativeKey::mMsg.

Therefore, we should make current HandleCharMessage() a private method and create new overload method which doesn't take MSG as an argument.

MozReview-Commit-ID: LowV2FUmR3U

--HG--
extra : rebase_source : 271c61515752cf1ea56cf12c4f7ef6f1a90c9cac
2016-10-03 23:55:14 +09:00
Masayuki Nakano 2b007a1732 Bug 1307112 part.5 NativeKey should skip non-printable char messages when it initializes mCommittedCharsAndModifiers with following char messages r=m_kato
NativeKey shouldn't include characters which are provided by WM_SYSCHAR message or WM_DEADCHAR message into mCommittedCharsAndModifiers.

MozReview-Commit-ID: Ax1BmO5wTy0

--HG--
extra : rebase_source : 5d7d1735a783213f7c6a47cca0cadb1d4c5104c0
2016-10-03 18:20:29 +09:00
Masayuki Nakano b445cf93ba Bug 1307112 part.4 Rename NativeKey::IsFollowedByNonControlCharMessage() to IsFollowedByPrintableCharMessage() r=m_kato
For consistency with IsPrintableCharMessage(), IsFollowedByNonControlCharMessage() should be renamed to IsFollowedByPrintableCharMessage().

MozReview-Commit-ID: CBJFPO4FZej

--HG--
extra : rebase_source : f5d677743be35a3bb5fca35e7658e907aa46dbcb
2016-10-03 18:07:33 +09:00
Masayuki Nakano 432f317b32 Bug 1307112 part.3 NativeKey::IsFollowedByNonControlCharMessage() should return true when one of following char messages is a printable char message r=m_kato
Currently, NativeKey::IsFollowedByNonControlCharMessage() returns true only when the first char message is a printable char message.  Although, I don't know actual cases coming printable WM_CHAR message after non-printable char message, i.e.,

1. WM_SYSCHAR or WM_DEADCHAR
2. WM_CHAR for a printable character

or

1. WM_CHAR with a non-printable character (a control character)
2. WM_CHAR with a printable character

, we should make it return true because when one or more characters are being inputted, we should ignore non-printable char messages and handle printable char messages in the path handling text input.

MozReview-Commit-ID: 1v7v5mCRFCP

--HG--
extra : rebase_source : f82f7b77376450168bad34be031164ecf7338621
2016-10-03 18:03:46 +09:00
Masayuki Nakano b8a5c9fef9 Bug 1307112 part.2 Create NativeKey::IsPrintableCharMessage() which returns true when given message is WM_CHAR and inputting a printable character r=m_kato
MozReview-Commit-ID: 7f74273Ogo5

--HG--
extra : rebase_source : 860b01320a7f02f9bebea570be43c5c508fd4f41
2016-10-03 17:52:41 +09:00
Masayuki Nakano 4bbcc90d42 Bug 1307112 part.1 Rename NativeKey::IsPrintableCharMessage() to IsCharOrSysCharMessage() r=m_kato
Currently, NativeKey::IsPrintableCharMessage() returns true if given message is WM_CHAR or WM_SYSCHAR.  However, WM_SYSCHAR never causes inputting any character and even if WM_CHAR has a control character (i.e., non-printable character), it returns true.

MozReview-Commit-ID: IoU5F06WImz

--HG--
extra : rebase_source : c48f424f3d2960e6e9ceaa6d2fb09952ca634c3f
2016-10-03 17:45:03 +09:00
Markus Stange ea5fd38d00 Bug 1293324 - Release widgets from a runnable instead of from an objective C 'performAfterDelay' timer. r=Ehsan
This guarantees that the runnable will be processed before shutdown leak checking.

MozReview-Commit-ID: B89AcDUWb3y

--HG--
extra : rebase_source : bfbd311fba367c1856cc5d972e6e999ccd4de1ac
2016-10-06 23:34:14 -04:00
Jim Mathies cf37bc5e58 Bug 1295596 - Remove release asserts from nsBaseWidget::AddChild associated with existing sibling checks. r=bsmedberg
MozReview-Commit-ID: CjIdIWP5nI1
2016-10-06 08:43:38 -05:00
Benjamin Smedberg b251dfc1b5 Bug 1290766 - Return the scroll capture information from the PPluginWidget Create method, instead of using a separate asynchronous method which is delivered later and may race with fast shutdown. r=billm
MozReview-Commit-ID: JJA1VaIuDxL

--HG--
extra : rebase_source : 13a97843b3f2dbfd66478d5ba41e2365dd94a11f
2016-10-05 11:36:26 -04:00
David Major fcbab1c99e Bug 1307812: Re-work IsEmptyMSG() to avoid taking the address of a temporary. r=masayuki
--HG--
extra : rebase_source : 2d5c3223f56165b3059c9c75cd8ecdeef0e7ce34
2016-10-06 09:22:18 -05:00
Carsten "Tomcat" Book 2a026d93ba Backed out changeset 9fbc16390ef7 (bug 1299860) for bustage on a CLOSED TREE 2016-10-06 17:04:40 +02:00
Nicolas Silva f10342b425 Bug 1299860 - Don't use the compositor backend of a popup with ImageBridge and VRManager. r=Bas 2016-10-06 16:39:56 +02:00
Jim Chen bfe19431c6 Bug 1305498 - Refactor notification code to be more concise; r=sebastian
Bug 1305498 - 1. Remove NotificationClient task queue; r=sebastian

Not sure why we needed a task queue for NotificationClient actions. The
actions all go through IPC and are non-blocking, so it's perfectly fine
to perform them off of whatever thread we're on.

Bug 1305498 - 2. Integrate NotificationHandler et al into NotificationCllient; r=sebastian

There's no reason to have NotificationHandler, AppNotificationClient,
and ServiceNotificationClient all separate from the base
NotificationClient class. This patch adds the functionality of
those three classes to NotificationClient.

The notifications hash map is changed from a ConcurrentHashMap to a
regular HashMap with synchronization because I think the use case here
doesn't warrant the added performance and overhead of ConcurrentHashMap.

NotificationService is changed to match the new NotificationClient. Now
the only job for NotificationService is to set a notification as
foreground, rather than to manage all notifications like before.

NotificationHandler, AppNotificationClient, and
ServiceNotificationClient will be removed in a later patch.

Bug 1305498 - 3. Set NotificationListener in GeckoApplication; r=sebastian

Set NotificationListener once in GeckoApplication.onCreate, instead of
spreading it out in GeckoApp, BrowserApp, and GeckoService. This is
possible because there's no longer a distinction between
AppNotificationClient and ServiceNotificationClient in the new,
consolidated NotificationClient.

Bug 1305498 - 4. Remove obsolete notification classes; r=sebastian

Remove AppNotificationClient, ServiceNotificationClient, and
NotificationHandler, now that they've all been replaced by the new,
consolidated NotificationClient.

Bug 1305498 - 5. Use NotificationReceiver for web notification callbacks; r=sebastian

Previously, web notification callbacks went to GeckoApp directly, but
that presented some problems such as not being able to implement the
on-close callback, because we don't want to launch GeckoApp when the
notification is closed by swiping. This patch makes us use
NotificationReceiver for callbacks, and let NotificationReceiver launch
GeckoApp if necessary.

Bug 1305498 - 6. Don't keep notification cookie in native code; r=sebastian

Keep the notification cookie a single location (in the notification
intent itself), and simplify the native notification handling code.

Bug 1305498 - 7. Use NotificationReceiver for persistent notifications; r=sebastian

Currently, persistent notification callbacks go through a different code
path, but it'd be more consistent and correct to let persistent
notification callbacks go through NotificationReceiver as well.

This takes care of some housekeeping work that was missing for
persistent notifications, such as deleting the mNotifications entry when
the notification is closed.
2016-10-05 21:52:32 -04:00
Wes Kocher b4e6b8fba5 Merge m-c to autoland, a=merge 2016-10-04 17:42:48 -07:00
Wes Kocher 5a2fb874ca Merge inbound to central, a=merge 2016-10-04 17:32:01 -07:00
Tom Schuster 774a8bf34d Bug 1302163 - Change code to use SprintfLiteral instead of snprintf. r=ehsan 2016-10-04 17:57:51 +02:00
Carsten "Tomcat" Book 6df735c3b7 Merge mozilla-central to autoland 2016-10-04 12:03:18 +02:00
Phil Ringnalda 155ef02c4f Backed out changeset 64c6e5121479 (bug 1033483) for unexpected "Recursive GetService!" assertions
CLOSED TREE
2016-10-03 20:29:27 -07:00
Stone Shih ce7f1ca7af Bug 1292063 - Part 3: Add mComposedInNativeAnonymousContent to determine which events can cross the boundary of native anonymous content. r=smaug
--HG--
extra : rebase_source : 6b3fcc52b2a099944cc1a0427a36624394fb3b2e
2016-09-12 18:15:16 +08:00
Stone Shih d76caea5e4 Bug 1292063 - Part 1: Add Event.composed. r=smaug
--HG--
extra : rebase_source : 105f9cfddb083d48d3da25fa13bf9a3b4c2637f6
2016-08-31 11:16:11 +08:00
Kartikaya Gupta 1320fdc1a4 Bug 1307522 - Delete a bunch of classes and related goop no longer used now that JPZ is gone. r=snorp
MozReview-Commit-ID: Jq6xJEO0u9x

--HG--
extra : rebase_source : 3ae338de85676c8c846b393661ce319f3dde86c3
2016-10-04 14:41:13 -04: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
Enes Goktas 032c476db6 Bug 1302855 - Fold browsercomps into xul; r=bsmedberg
MozReview-Commit-ID: 8oaVngXFfh3

--HG--
extra : rebase_source : 2f5e770d04bd3f75778f242e3866b141df5bbff4
2016-09-27 19:54:37 -07:00
Jim Chen a60e069206 Bug 1306083 - 3. Remove obsolete code from AndroidBridge; r=snorp
Remove the global layer client object from AndroidBridge, now that it's
no longer used. Also remove other associated calls that are no longer
used.
2016-10-03 12:26:00 -04:00
Jim Chen 26526e7e66 Bug 1306083 - 2. Pass in window object for nsIAndroidBridge calls; r=snorp
Make contentDocumentChanged and isContentDocumentDisplayed calls require
the caller to pass in a window object, so that we can get the widget and
GeckoLayerClient from the window object. This way these calls no longer
depend on having a global layer client in AndroidBridge.
2016-10-03 12:26:00 -04:00
Jim Chen 3587a0edd6 Bug 1306083 - 1. Use AndroidCompositorWidget to access GeckoLayerClient; r=kats
Add AndroidCompositorWidget to act as the intermediary between gfx code
and GeckoLayerClient, in place of AndroidBridge. AndroidCompositorWidget
currently inherits from InProcessCompositorWidget, but when Android
eventually supports OOP compositing, it will be made to inherit from
CompositorWidget directly.
2016-10-03 12:26:00 -04:00
Makoto Kato c220f608ad Bug 1033483 - Send bidi keyboard Information on direction-changed signal. r=karlt
Using direction-changed signal, we detect keyboard change for bidi.

When system uses fcitx's IM and ibus's arabic keyboard layout, this signal might fire often when switing layout and gdk_keymap_get_direction might return invalid bidi infromation.  But I think that this is rare issue.  Most users don't use Firefox Arabic version (it means that bidi.browser.ui = true) with ibus arabic layout and fcitx CJK IM.  Since there is no GTK3 API to get current IM module, I cannot find workaround for this.

MozReview-Commit-ID: DL8uUXJFWYz

--HG--
extra : rebase_source : 18b7d5c84f48acd62fa14e21a67b711106fb7d63
2016-07-08 16:18:40 +09:00
Markus Stange 5f8c7d9f79 Bug 1306332 - Don't set a maximum size on the native window if SetSizeConstraints is called with magical "unconstrained" values. r=karlt
MozReview-Commit-ID: DdHrNjmxHQJ

--HG--
extra : rebase_source : 23df78e62082691ce9a73535a24114c91c365dfe
2016-10-03 15:29:34 -04: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
Phil Ringnalda 400813c30b Merge m-i to m-c, a=merge 2016-09-30 23:24:52 -07:00
Milan Sreckovic 80890cacbd Bug 1306383: The top level window logic for the OS X is different. r=dvander
MozReview-Commit-ID: KP5C9LuITkx

--HG--
extra : rebase_source : b78332208aabfa14d7ab93774eb83a31d6b43b14
2016-09-29 13:14:11 -04:00
Kirk Steuber ad4b55af1f Bug 1206133 - Add popuppositioning state and popuppositioned event to improve arrow panel position handling. r=enndeakin
MozReview-Commit-ID: Dh1npORCQ6J

--HG--
extra : rebase_source : 5df6076561a746791c44d249afa31009d0e1b30a
2016-08-16 15:33:05 -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
Kartikaya Gupta 1d5a942431 Bug 1300421 - Back out 4 csets from bug 1288760 for regressing event coordinate reporting. r=jfkthame
MozReview-Commit-ID: AJ2PkSfYCpv
2016-09-29 10:20:52 -04:00
Kartikaya Gupta cf44e08da9 Bug 1302736 - Fire click events with a clickCount of 2 when the user does a double-tap gesture with double taps not allowed. r=botond
MozReview-Commit-ID: 5qxHMoHXDXh
2016-09-29 10:05:25 -04:00
Carsten "Tomcat" Book 5b45193594 merge mozilla-inbound to mozilla-central a=merge 2016-09-29 11:44:58 +02:00
Jonathan Kingston 8f10491335 Bug 1302157 - Remove images-in-menu and images-in-button code (& associated icons) since it's deprecated in GTK. r=bz,dholbert
MozReview-Commit-ID: IIj8PvgdaRp

--HG--
extra : rebase_source : 21eca47872a073b382c10fe84464fac8fafd6179
2016-09-29 00:22:32 +01:00
Jim Chen dc65b25659 Bug 1305271 - 3. Use @JNITarget for Distribution.getDistributionDirectories; r=snorp
Distribution.getDistributionDirectories is currently annotated with
@WrapForJNI, but because it's used from JS through JNI.jsm, the
@JNITarget annotation is more appropriate.
2016-09-28 23:49:25 -04:00
Jim Chen 3f0f41aeb3 Bug 1305271 - 2. Add and use jni::IsFennec() for Fennec-only code; r=snorp
Add jni::IsFennec() that returns whether we're in a Fennec environment
(defined as the presence of the GeckoApp class). Then, add
jni::IsFennec() checks to places where we use JNI for Fennec-only classes.
2016-09-28 23:49:25 -04:00
Jim Chen 39ed66e9ec Bug 1305271 - 1. Move GetClassGlobalRef out of AndroidBridge; r=snorp
Move GetClassGlobalRef in AndroidBridge to GetClassRef in jni/Utils. The
new function now returns a local reference instead of a global
reference.
2016-09-28 23:49:25 -04:00
Ryan Hunt 7f1aff0d5c Bug 1304199 - Fix nsWindow::GetNativeData called with bad value. r=erahm
MozReview-Commit-ID: EwvoZCkmliH

--HG--
extra : rebase_source : b86d70a41e2238b90a6be8652fd4e31203add84f
2016-09-21 12:39:00 -04:00
Carsten "Tomcat" Book 572e74ee99 merge mozilla-inbound to mozilla-central a=merge 2016-09-28 15:56:33 +02:00
Alexandre Lissy 07037f896b Bug 1305655 - Decouple Gonk TextureForwarder and CompositableForwarder (followup bug 1281456) r=nical
MozReview-Commit-ID: 1sUiqnFEPdx
2016-09-28 07:04:13 +02: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
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
Xidorn Quan 52de92c14c Bug 1304692 - Make puppet widget get coordinate rounding from parent. r=smaug
MozReview-Commit-ID: A3ornUMDmt8
2016-09-27 16:37:07 +10: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
Carsten "Tomcat" Book ceb8695fd3 Merge mozilla-central to mozilla-inbound 2016-09-27 11:26:17 +02:00
Carsten "Tomcat" Book 5bdd2876ae merge mozilla-inbound to mozilla-central a=merge 2016-09-27 11:21:25 +02:00
Matt Woodrow 55f506db9f Bug 1281456 - Decouple TextureForwarder and CompositableForwarder. r=gw280 2016-09-27 16:22:20 +13:00
Kartikaya Gupta cb429d93ab Bug 1298886 - Convert the PinchGestureInput span fields from float to ParentLayerCoord. r=botond
MozReview-Commit-ID: 1Odp9ml6reK
2016-09-24 09:46:01 -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
James Cheng cb9968ef9d Bug 1304258 - Part1 - Add Util Method to Create JNI Array Object. r=jchen
MozReview-Commit-ID: INXNelhQzuR

--HG--
extra : transplant_source : %1F%A3%E1%E3/%B7%5Em%D7%0F%CA%1Ah%B5%16U%9Bn%89U
2016-09-23 14:33:01 +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
Xidorn Quan 73cb8d2d09 Bug 898984 - Part 2: Support surrogate pair in XUL cropped element. r=jfkthame 2013-08-11 03:41:00 +09:00
Carsten "Tomcat" Book a65e4225ef merge mozilla-inbound to mozilla-central a=merge 2016-09-23 12:05:53 +02: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 97735168f1 Bug 1297013 part.2 Implement some helper methods to log constants related to event handling r=smaug
This patch implements some helper methods to log constants related to event handling.

ToString(KeyNameIndex) and ToString(CodeNameIndex) converts the enum itmes to human readable string.  They use WidgetKeyboardEvent's helper class which returns Unicode text.  Therefore, this need to convert from UTF16 to UTF8.  That's the reason why these methods don't return |const char*|.

GetDOMKeyCodeName(uint32_t) returns DOM keycode name if it's defined.  Otherwise, returns hexadecimal value.  For generating switch-case statement, VirtualKeyCodeList.h shouldn't include ",".  Therefore, this patch removes "," from VirtualKeyCodeList.h and append it at defining NS_DEFINE_VK.  Additionally, the last item of enum and array should not end with ",".  Therefore, this adds dummy last item at each of them.  Finally, some of the keyCode values are shared between 2 keys.  Therefore, it needs to support NS_DISALLOW_SAME_KEYCODE for switch-case generator.  See the comment in the file for more detail.

GetModifiersName(Modifiers) returns all modifier names included in the given value.

MozReview-Commit-ID: 9i2ftFOTpDn

--HG--
extra : rebase_source : 458a4d28624dc10dd4454f2e7708d746d1fcb045
2016-09-15 00:48:47 +09:00
Jim Chen e4e57ddb6e Bug 1304145 - 6. Update auto-generated bindings; r=me 2016-09-22 16:38:20 -04:00
Jim Chen ae3538f775 Bug 1304145 - 2. Change GeckoAppShell's notification interface; r=nalexander
Instead of using NotificationClient directly from GeckoAppShell, add a
NotificationListener interface, which NotificationClient would
implement. This isolates NotificationClient (and the notification
package) from GeckoAppShell and lets us move the notification package to
Fennec. It also makes a cleaner interface for GeckoView consumers to
implement notification support.
2016-09-22 16:38:19 -04:00
Kartikaya Gupta 0e04f56656 Bug 1304729 - When transitioning from a pinch to a pan, make sure we start the pan with the correct coordinates. r=botond
MozReview-Commit-ID: CC4gPT2jubR
2016-09-22 14:54:01 -04: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
Kilik Kuo dc3bf0fbf7 Bug 1302331 - [Part2] Make CryptoInfo as an argument for method CodecProxy.input. r=jchen,jolin
MozReview-Commit-ID: JeqNNixbRvv

--HG--
extra : rebase_source : c99d875c2a992b098dc4e34d0831f4bb6f8ac7e4
2016-09-22 14:07:56 +08:00
Carsten "Tomcat" Book 4f900773f5 merge mozilla-inbound to mozilla-central a=merge 2016-09-21 12:03:31 +02:00
Iris Hsiao c82aa62cec Backed out changeset cf43cacdb262 (bug 1294232) for XPCShell failures
CLOSED TREE
2016-09-21 14:24:26 +08:00
Umesh Panchaksharaiah 056d5a6135 Bug 1301629 - Fix incorrect parameter name in comments. r=ettseng
--HG--
extra : rebase_source : a45c6c9641ceb70301e8bcd957a3e21c95aef423
2016-09-14 19:57:20 +02:00
Jim Chen 27143e4fba Bug 1303806 - 3. Update sources to reflect new bindings; r=snorp r=nalexander
Update #includes to use new headers if necessary. Also remove a couple
of functions in AndroidBridge to clean up the code.
2016-09-20 17:42:08 -04:00
Jim Chen fc338f45cf Bug 1303806 - 2. Update auto-generated bindings; r=me 2016-09-20 17:42:08 -04:00
Carsten "Tomcat" Book 17d545681a Merge mozilla-central to mozilla-inbound 2016-09-20 12:02:20 +02:00
Carsten "Tomcat" Book 8910ca900f merge mozilla-inbound to mozilla-central a=merge 2016-09-20 12:01:29 +02:00
David Anderson 5a103daad2 Fix root scroll delta overrides when APZ is out-of-process. (bug 1303820, r=kats) 2016-09-19 19:22:26 -07:00
Carsten "Tomcat" Book 026552c22f merge mozilla-inbound to mozilla-central a=merge 2016-09-19 12:14:36 +02:00
Thomas Wisniewski e2d5d5425f Bug 1302937 - Remove -moz-mac-lion-theme. r=mstange 2016-09-16 14:42:19 -04:00
Tanuja Sawant 50e09326b3 Bug 1285940 - Remove code to disambiguate overloads that is no longer necessary. r=botond
MozReview-Commit-ID: 5fBkxmGP1Cr

--HG--
extra : amend_source : b6c0917ef257f39ee707836d46d60b5d00364bad
2016-09-17 13:38:11 +05:30
Bill McCloskey 50c44c717c Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap) 2016-09-16 20:35:11 -07:00
Karl Tomlinson 31bcc62a8b bug 1301194 don't modify the direction when fetching a cached style context if no direction is explicitly requested r=stransky+263117
This is important for RTL locales which are drawn with explicit direction but
measured with no direction.

MozReview-Commit-ID: C4k5vgpKggD

--HG--
extra : rebase_source : 6fc3c6dae296d8dabe189361481b12a17e75dcc6
2016-09-07 21:18:27 +12:00
Karl Tomlinson 6b22cee582 bug 1301194 be more careful to only invalidate style context when state changes r=stransky+263117
Previously oldState differed from aStateFlags just because it contained
direction flags.

MozReview-Commit-ID: DuGpHdt9EuX

--HG--
extra : rebase_source : 05a06d130a51c7a1830804254ec87c6697ade4a8
2016-09-08 10:12:55 +12:00
Andrew Comminos 003ca59831 Bug 1294232 - Refactor blocklisting on Linux to support the downloadable blocklist. r=jrmuizel
MozReview-Commit-ID: ESJY9kkqXR8

--HG--
extra : rebase_source : 93a2794de72c53e7414e22e342940e48cf4da84c
2016-08-04 17:02:14 -04: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
Carsten "Tomcat" Book 79ec7bf1c3 Merge mozilla-central to autoland 2016-09-20 12:05:52 +02:00
Makoto Kato 4a28a26c93 Bug 1302980 - Don't reset IME context on preedit_end. r=masayuki
You know, when Korean IME commits string, then it sometimes set next preedit string.  So reseting context causes that next preedit string is committed.

So we shouldn't reset IME context with preedit_end.

MozReview-Commit-ID: CZJJvYjcrKY

--HG--
extra : rebase_source : d7e2e80930355794a40466c68fe22e43e7164d72
2016-09-16 18:00:25 +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 0cf4a632e5 Bug 1300937 part.3 NativeKeyCodes.js should specify scan code to WIN_VK_ABNT_C1 explicitly for avoiding (perhaps) a bug of MapVirtualKeyEx() API r=smaug
Unfortunately, MapVirtualKeyEx() doesn't compute ABNT C1's scan code from its virtual keycode, 0xC1.  Therefore, NativeKeyCodes.js should specify 0x0056 explicitly.  Fortunately, this key in physical keyboard always generates the scan code value with any keyboard layouts.  Therefore, this can test new regressions as expected.

FYI: ABNT C1 key is a key in Brazilian keyboard.  It's at between "ShiftLeft" and "KeyZ".

MozReview-Commit-ID: GmpnFKOsnKD

--HG--
extra : rebase_source : 197b249740056e5c4b7c6f3b556f91f50a838d52
2016-09-13 19:55:29 +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
Masayuki Nakano 1042db50c8 Bug 1300937 part.1 Check KeyboardEvent.key and KeyboardEvent.code in test_keycodes.xul r=smaug
MozReview-Commit-ID: AntOqvmTCcW

--HG--
extra : rebase_source : a223980232f1c5bf03b3dc5685afe2990e5dc893
2016-09-13 21:48:45 +09:00
David Anderson f2cfe86ef2 Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
--HG--
extra : rebase_source : ea92ecc5738e830a86f3b323d262f3537afe4534
2016-09-20 01:19:32 -07:00
David Anderson a03cd76c24 Recreate widget compositors when the GPU process dies. (bug 1300936 part 2, r=mattwoodrow)
--HG--
extra : rebase_source : 8b6770bcad64a21001efd5d75f0502672282fcab
2016-09-20 01:16:03 -07: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
Wes Kocher 0677d5dc43 Merge m-c to inbound, a=merge 2016-09-16 14:35:12 -07:00
Jim Chen fbee7a5cf3 Bug 1291375 - 6. Move Fennec JNI headers; r=snorp
Move Fennec-specific JNI headers to widget/android/fennec.

--HG--
rename : widget/android/MemoryMonitor.h => widget/android/fennec/MemoryMonitor.h
rename : widget/android/Telemetry.h => widget/android/fennec/Telemetry.h
rename : widget/android/ThumbnailHelper.h => widget/android/fennec/ThumbnailHelper.h
2016-09-16 15:13:48 -04:00
Jim Chen 8e0ad67a7a Bug 1291375 - 5. Use Fennec bindings where needed; r=snorp
Switch include statements from GeckoView bindings to Fennec bindings
where needed.
2016-09-16 15:13:48 -04:00
Jim Chen 396eaa38e0 Bug 1291375 - 4. Update auto-generated bindings; r=me 2016-09-16 15:13:48 -04:00
Jim Chen cabea0c515 Bug 1291375 - 3. Separate Fennec JNI binding generation; r=nalexander r=snorp
Separate compiled JARs into GECKOVIEW_JARS and FENNEC_JARS, and run
AnnotationProcessor separately on each set. The GeckoView bindings are
put into widget/android/GeneratedJNI* (same as before), while the
Fennec-specific bindings are put into widget/android/fennec/FennecJNI*.
2016-09-16 15:13:48 -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
Masayuki Nakano c09c84b7eb Bug 1138159 Don't reset IM context at selection change when there is no composition and hasn't retrieved surrounding text after last selection change r=m_kato
ibus-pinyin has a bug.  When application calls gtk_im_context_reset(), which means selection is changed in application, ibus-pinyin sents a set of composition signals with empty commit string.  Therefore, selecting text causes removing it.

For preventing it but not breaking the other IMEs which use surrounding text, we should give up to call gtk_im_context_reset() if IME hasn't retrieved surrounding text after the last selection change.  Not having retrieved surrounding text means that the IME doesn't have any cache of contents.  Therefore, not calling gtk_im_context_reset() at selection change must be safe for such IMEs.

MozReview-Commit-ID: 5cbIZjpd7zN

--HG--
extra : rebase_source : 6010b3e055d66ebd2ed50f9b3ee8ff2330d3c6ab
2016-09-15 22:36:23 +09:00
Carsten "Tomcat" Book 31fdf0df86 Backed out changeset 6a8bf7596f42 (bug 1300937) for m-oth test failures
--HG--
extra : rebase_source : 187813acb705820a33bddf1cffcd8d22754fe785
2016-09-15 17:04:33 +02:00
Carsten "Tomcat" Book 915d632972 Backed out changeset be88a60abb7a (bug 1300937)
--HG--
extra : rebase_source : 19b90e94e16547a7a718a7c4c2f587e64fbe4b7a
2016-09-15 17:04:16 +02:00
Carsten "Tomcat" Book 9ce8c3febe Backed out changeset e94d6d577103 (bug 1300937)
--HG--
extra : rebase_source : 4d10055ca5e6f67a3e085d7ea06dc4eae90eace3
2016-09-15 17:04:14 +02:00
Carsten "Tomcat" Book 08b3e66490 Merge mozilla-central to autoland 2016-09-15 12:08:47 +02:00
Carsten "Tomcat" Book 25a074d342 merge mozilla-inbound to mozilla-central a=merge 2016-09-15 11:59:50 +02:00
Alexandre Lissy f6ee6d53f2 Bug 1302641 - Update ImageBridgeChild::GetSingleton() use after 1298938 r=nical
MozReview-Commit-ID: Cs7xUcPnPoz
2016-09-14 19:01:21 +02:00
Jim Chen c51900d074 Bug 1258470 - 3. Small optimizations in ThumbnailHelper; r=nalexander
This patch includes a small memory optimization of using ArrayList and
`volatile int` for storing the pending thumbnails list and pending
width, instead of using LinkedList and AtomicInteger, respectively.

The patch also fixes a possible race condition due to calling
processNextThumbnail outside of a lock. Now it must be called inside a
lock and its name is changed to reflect that.
2016-09-14 12:43:36 -04: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
Kartikaya Gupta 05d91128f8 Bug 1289432 - Introduce a skeleton QueuedInput class. r=botond
Note that this patch makes the InputData hierarchy polymorphic.

MozReview-Commit-ID: HrZ2KhHeDoy
2016-09-14 07:54:36 -04:00
Masayuki Nakano ca5214b9da Bug 1300937 part.3 NativeKeyCodes.js should specify scan code to WIN_VK_ABNT_C1 explicitly for avoiding (perhaps) a bug of MapVirtualKeyEx() API r=smaug
Unfortunately, MapVirtualKeyEx() doesn't compute ABNT C1's scan code from its virtual keycode, 0xC1.  Therefore, NativeKeyCodes.js should specify 0x0056 explicitly.  Fortunately, this key in physical keyboard always generates the scan code value with any keyboard layouts.  Therefore, this can test new regressions as expected.

FYI: ABNT C1 key is a key in Brazilian keyboard.  It's at between "ShiftLeft" and "KeyZ".

MozReview-Commit-ID: GmpnFKOsnKD

--HG--
extra : rebase_source : 37f78552a1ebba6f61c38add0138b84ddef36c3e
2016-09-13 19:55:29 +09:00
Masayuki Nakano e8eae5c2a2 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 : 0f4bb9193aa06cd7985590636b77a6e2a71ac2e4
2016-09-13 19:38:23 +09:00
Masayuki Nakano 748c42b18b Bug 1300937 part.1 Check KeyboardEvent.key and KeyboardEvent.code in test_keycodes.xul r=smaug
MozReview-Commit-ID: AntOqvmTCcW

--HG--
extra : rebase_source : 7f5a550cf7e3464f1d568f9cc30ec2bc97a31c55
2016-09-13 21:48:45 +09:00
Phil Ringnalda 7fc271e5f5 Backed out changeset 663cde4dd044 (bug 1287004) for crashes [@ XGetWindowAttributes]
CLOSED TREE
2016-09-13 21:06:19 -07:00
Bill McCloskey a430c0ac5b Bug 1287004 - Give PuppetWidgets in parent process a compositor bridge (r=mattwoodrow) 2016-09-13 20:06:44 -07: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
Mason Chang 200e76f295 Bug 1302240 - Report content backend to telemetry. r=dvander 2016-09-12 16:23:28 -07:00