Commit Graph

262 Commits

Author SHA1 Message Date
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ryan Hunt
2226bcc8a3 Bug 1504220 - Move ScrollableLayerGuid, ViewID, ZoomConstraints from FrameMetrics.h r=botond
This commit attempts to lower the pain of modifying FrameMetrics.h.

It looks like most includes really only want ViewID or
ScrollableLayerGuid, so this commit factors them out into a separate
header. In the process FrameMetrics::ViewID is changed to
ScrollableLayerGuid::ViewID, which personally seems like a better
place for it now that we have RepaintRequest. Unfortunately that
requires a lot of places to be updated.

After this commit there are still a couple of major places that
FrameMetrics is included.
 * nsDisplayList.h
 * nsIScrollableFrame.h
 * Layers.h

Those are going to be more tricky or impossible to fix so they're
not in this commit.

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

--HG--
rename : gfx/layers/FrameMetrics.h => gfx/layers/ScrollableLayerGuid.h
rename : gfx/layers/FrameMetrics.h => gfx/layers/ZoomConstraints.h
extra : rebase_source : 29ac79f91460a181bf7437af5c371207e22858e2
extra : source : c2e70e531075493fc6e374dcec862827f0bc6e77
2018-11-01 15:15:46 -05:00
Jim Chen
4c2a810a62 Bug 1498352 - Apply root resolution when sending mouse events from child to parent; r=kats
Because the root resolution is conceptually at the parent/child process
boundary, when sending mouse events from child to the parent, we need to
apply that resolution to the mouse coordinates.

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

--HG--
extra : moz-landing-system : lando
2018-10-18 16:43:40 +00:00
Masayuki Nakano
d5f33c6b5a Bug 1495978 - Make PuppetWidget::StartPluginIME() restore cross process dispatching state of given keyboard event instance after sending it to the main process synchronously r=m_kato
PuppetWidget::StartPluginIME() calls TabChild::SendStartPluginIME()
with given WidgetKeyboardEvent instance.  Then, the keyboard event
will be marked as "posted to remote process" by
ParamTraits<mozilla::WidgetEvent>::Write().  However, the method
sends back the keyboard event to the main process synchronously.
So, we don't want the event is treated as "posted" since the
flag is used to check whether current process handles posted event
*before* the remote process or not.

So, PuppetWidget::StartPluginIME() should restore the cross process
dispatching state with calling
WidgetEvent::ResetCrossProcessDispatchingState().  Unfortunately,
this also clears propagation state of the event too if the event
has already been posted to a remote process and is waiting reply
from the remote process.  This shouldn't occur in content
process, however, we should check it with MOZ_ASSERT() for
detecting regressions.

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

--HG--
extra : moz-landing-system : lando
2018-10-09 01:29:42 +00:00
Hiroyuki Ikezoe
5f958f80c7 Bug 1486971 - Test for dynamically change of the prefers-reduced-motion setting on MacOSX. r=froydnj,mstange
The framework to simulate the setting change works as following;

 - nsIDOMWindowUtils.setPrefersReducedMotion() calls an IPC function which ends
   up calling nsChildView::SetPrefersReducedMotion() in the parent process

 - nsChildView::SetPrefersReducedMotion() sets the given value into
   nsLookAndFeel::mPrefersReducedMotionCached just like we set the value queried
   via NSWorkspace.accessibilityDisplayShouldReduceMotion in the parent process
   and send a notification which is the same notification MacOSX sends when the
   system setting changed

 - Normally the cached value is cleared before quering new values since the
   cache value is stale, but in this case the value is up-to-date one, so
   nsChildView::SetPrefersReducedMotion() tells that we don't need to clear the
   cache, and nsIDOMWindowUtils.resetPrefersReducedMotion() resets that state
   of 'we don't need to clear the cache'

There are two test cases with the framework in this commit, one is just setting
the value and checking the value queried by window.matchMedia.  The other one is
receiving 'change' event and checking the value of the event target.

Note that to make this test works the patch for bug 1478212 is necessary since
the test runs in an iframe.

Depends on D5003

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

--HG--
extra : moz-landing-system : lando
2018-09-15 01:00:07 +00:00
Hiroyuki Ikezoe
61a6f8e3f2 Bug 1478576 - A mochitest for system font change notification. r=froydnj,jimm,karlt
The test case in this patch fails without the proper fix in the first patch
in this patch series.

In this patch two new nsIDOMWindowUtils APIs are introduced to change the
system font settins in tests.  Currently the APIs work only on GTK+ platform.

Also to work the test case properly we need to open a new XUL window because we
don't propagate font changes into descendant documents yet (bug 1478212).

MozReview-Commit-ID: 4OLxEkEuF8d

--HG--
extra : rebase_source : 683e64f07c4d8820e5499d8c15b90975618559b8
2018-08-07 11:58:36 +09:00
Nicolas Silva
43aaf84a4c Bug 1482795 - Fix the gfx memory pressure observer. r=sotaro 2018-08-14 21:10:11 +02:00
Nicolas Silva
03b39c61f2 Bug 1482109 - Use the generic memory pressure observer in PuppetWidget. r=sotaro 2018-08-10 17:15:18 +02:00
Andi-Bogdan Postelnicu
8cc8f8b517 Bug 1453795 - Widget - Initialize member fields in classes/ structures. r=jimm
--HG--
extra : rebase_source : 594fe9396c450401fab4c17e81a3333124f27f58
2018-06-15 17:48:51 +03:00
Jim Chen
594f82583c Bug 1466910 - 1. Forward more InputContext members through e10s; r=masayuki
Some InputContext members are not forwarded through
PBrowser::SetInputContext.

MozReview-Commit-ID: C1bGYq4w8zT

--HG--
extra : rebase_source : 1481f08c7593fe9dceb3b96bbfe480a1c58ecf9d
2018-06-19 16:31:24 -04:00
Makoto Kato
fb3fb140eb Bug 1456294 - Hook ImmAssociateContextEx. r=masayuki 2018-05-17 14:47:55 +09:00
Jan Henning
843d1912b1 Bug 1450314 - Remove unused parameters for memory-pressure notifications. r=gsvelto
"alloc-failure" is completely unused apart from the description text in nsI-
Memory.idl (and has been since before Firefox 17), while "lowering-priority" is
still being checked for in the PuppetWidget, but otherwise unused as well since
the feature using it was decommissioned in bug 1234176.

Since we're touching the PuppetWidget code anyway, we take the opportunity to
add a check for "low-memory-ongoing" instead, since similar as to how things
used to be with "lowering-priority", we want to drop the LayerManager's cached
resources only when receiving a real full memory-pressure event, but not for
subsequent ongoing notifications.

MozReview-Commit-ID: HL03SOU8axe

--HG--
extra : rebase_source : c988769df36d8d77f4770c71d5c5e0d75c3b99af
2018-05-06 13:17:11 +02:00
Sebastian Hengst
82f65475ee merge mozilla-central to autoland 2018-04-13 16:04:29 +03:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Alex Gaynor
4d30d44b55 Bug 1453016 - user safer enum serialization for gfx::SurfaceFormat in IPC; r=kats
MozReview-Commit-ID: Fhyg8e5lyW6

--HG--
extra : rebase_source : b6bba81a0ca586075517dc1f12e14ce32b5866be
2018-04-10 11:53:44 -04:00
Alex Gaynor
ee407135b4 Bug 1453397 - use ContiguousEnumSerializer for serialization of enums in IPC for IMEs; r=masayuki
MozReview-Commit-ID: Enfhhu2HnH5

--HG--
extra : rebase_source : 39d1e2f7fc111683e652e9b80c147521c923ff16
2018-04-11 12:26:33 -04:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Milan Sreckovic
bd27b86da3 Bug 1423559: Use BaseRect access methods instead of member variables in widget/ r=mstange
MozReview-Commit-ID: AqnztoUbsmk

--HG--
extra : rebase_source : 76a232a08b42ed73b4922c03bc0f2e9d1769203b
2018-01-10 11:14:16 -05:00
Masayuki Nakano
8418b1b497 Bug 1420849 - Make PuppetWidget discard composition events after requesting commit composition and synthesizing eCommitComposition event until new eCompositionStart event comes r=m_kato
When ContentCacheInParent::RequestIMEToCommitComposition() returns true,
the remote process will synthesize eCompositionCommit event.  This causes
destroying TextComposition event in the remote process (by
IMEStateManager::DispatchCompositionEvent()).  Then,
IMEStateManager::DispatchCompositionEvent() will recreate new TextComposition
instance when it receives new composition event.  Then, it may request
to commit composition to the main process via PuppetWidget accidentally.

So, after PuppetWidget::RequestIMEToCommitComposition() synthesizes
eCompositionCommit, PuppetWidget should discard following composition events
until it receives eCompositionStart since they are unnecessary for the content
and they are for the old composition, i.e., outdated events.

MozReview-Commit-ID: BNRcoYxABpd

--HG--
extra : rebase_source : caea469afeed8cc373aeca33199ac0d570052569
2017-11-27 20:34:01 +09:00
Kartikaya Gupta
22471e0b18 Bug 1419868 - Fix some inconsistent naming r=mystor
The property in question is the offset from the content process to the
chrome process, but it gets called various things for historical
reasons. Let's be consistent and just call it the chrome offset
everywhere.

Also, in some places this was needlessly getting turned into a
nsIntPoint via ToUnknownPoint(), only to be turned back into a
LayoutDeviceIntPoint at all the use sites. So this patch also updates
some function signatures to avoid the needless conversion.

No functional changes.

MozReview-Commit-ID: AuhEUfa64Uj

--HG--
extra : rebase_source : 20e1895fefd944f98307a8437f977252ee2c3185
2017-11-22 14:21:37 -05:00
Masayuki Nakano
c4f2acf2f3 Bug 1405832 - part 2: TextComposition::RequestToCommit() should request IME to commit or cancel composition only when it hasn't been request it yet and hasn't received commit event yet r=m_kato
According to the log in crash reports, eCompositionCommitRequestHandled is
sent to ContentCacheInParent twice or more for a composition.  This causes
breaking mPendingCompositionCount and mPendingEventsNeedingAck management.

Currently, nsIWidget::NotifyIME() should be called only by
TextComposition::RequestToCommit().  Therefore, the method should manage if
it should request it actually.  If the composition has already received
eCompositionCommit(AsIs) event, it shouldn't request it because parent process
may have already stated new composition and it shouldn't be broken by request
for old composition.

MozReview-Commit-ID: 2ekSa6EIeRP

--HG--
extra : rebase_source : d23aa29ce7871e83b99cec8c15aff0c580e08fb4
2017-11-20 22:59:04 +09:00
Nika Layzell
a7666fd8fe Bug 1418048 - Add a callback-based Send API to async returning IPDL methods, r=billm
Currently if you write an async IPDL method which has a return value, we expose
a SendXXX method which returns a MozPromise. This MozPromise can then be
->Then-ed to run code when it is resolved or rejected.

Unfortunately, using this API loses ordering guarantees which IPDL provides.
MozPromise::Then takes an event target, which the resolve runnable is dispatched
to. This means that the resolve callback's code doesn't have any ordering
guarantees relative to the processing of other IPC messages coming over the same
protocol.

This adds a new overload to SendXXX with two additional arguments, a lambda
callback which is called if the call succeeds, and a lambda callback which is
called if the call fails. These will be called in order with other IPC messages
sent over the same protocol.

MozReview-Commit-ID: FZHJJaSDoZy
2017-11-20 17:55:32 -05:00
sotaro
bce40231ea Bug 1390741 - Use BasicCompositor if widget type does not support acceleration r=aosmond,kats 2017-11-03 16:38:34 +09:00
sotaro
e037507a09 Bug 1391262 - Do not use remote LayerManager when its initialization fails r=dvander 2017-10-13 23:32:36 +09:00
Sebastian Hengst
748a976761 Backed out changeset 3dd22fb8666c (bug 1391262) for frequently asserting in mochitests on Windows 10 x64 debug, often in devtools/client/shared/webpack/shims/test/test_clipboard.html. r=backout
--HG--
extra : rebase_source : 7794852d1d7e96dde59dd21bbb95eb81395e7416
2017-10-11 13:02:15 +02:00
sotaro
64faafc973 Bug 1391262 - Do not use remote LayerManager when its initialization fails r=dvander 2017-10-11 10:33:57 +09:00
Nicholas Nethercote
ebf1cb320b Bug 1400148 - Don't use -1 to represent an unset nsCursor. r=karlt.
Because UBSan complains about casting -1:

> runtime error: load of value 4294967295, which is not a valid value for type 'nsCursor'

--HG--
extra : rebase_source : 037a96700228ea0d427afa7c25c40490c701cdc4
2017-09-15 14:34:37 +10:00
Henry Chang
25f77bb74d Bug 1349255 - Part 1: Make PBrowser.NotifyIMEFocus async to avoid UI jank. r=kanru,masayuki
Telemetry and some performance profiles show that Msg_NotifyIMEFocus can take
a few seconds to complete, and jank the browser. With bug 1217700, it removes
the necessity of sync Msg_NotifyIMEFocus, so in this patch we make this async
for performance improvement.

MozReview-Commit-ID: 15eUwMJ2Q7H

--HG--
extra : rebase_source : b463e6e881ca5ebec00d0f76e29ca103059b3ddd
2017-05-08 19:07:56 +08:00
Michael Layzell
76fb615887 Bug 1384238 - Annotate BHR hangs which occur while there is a pending input event, r=smaug
MozReview-Commit-ID: HRPMw2IfEKB
2017-08-15 16:36:28 -04:00
Jan Henning
34bb1f8a36 Bug 1266683 - Part 2 - Add private browsing mode info to InputContext. r=masayuki
Android now supports telling an IME that it shouldn't store user-entered content into it's dictionary/language model/etc. and we want to automatically enable this in private browsing.

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

MozReview-Commit-ID: DsxjC4Ma7DR

--HG--
extra : rebase_source : f0940cb40170ab32cf5a172d07a61d083427be8a
2017-07-30 19:45:03 +02:00
Masayuki Nakano
333068f586 Bug 1384027 - part2: Move PuppetWidget::NotifyIMEInternal() implementation to PuppetWidget::NotifyIME() which is a method of TextEventDispatcherListener, not nsIWidget r=m_kato
nsIWidget::NotifyIME() should call only TextEventDispatcher::NotifyIME() if it's necessary.  Then, TextEventDispatcher::NotifyIME() calls TextEventDispatcherListener::NotifyIME() if it's necessary.  E.g., requests to IME are necessary only for TextInputProcessor or native IME handler because the composition is only owned by one of them.  However, notifications are necessary for both of them since focused editor contents and its focus state are shared.

So, it doesn't need to call nsBaseWidget::NotifyIMEInternal() if all NotifyIMEInternal() implementations are moved to proper TextEventDispatcherListener::NotifyIME().  Currently, nsBaseWidget::NotifyIMEInternal() is implemented only by PuppetWidget.  It sends notifications and requests to the parent process for native IME.  Therefore, we can move NotifyIMEInternal() implementation to TextEventDispatcherListener::NotifyIME() which is implemented by PuppetWidget.

This patch moves PuppetWidget::NotifyIMEInternal() implementation to PuppetWidget::NotifyIME() of TextEventDispatcherListener class, not of nsIWidget and removes NotifyIMEInternal() completely.

With this change, handling order is changed.  Old behavior is, TextEventDispatcher::NotifyIME() calls TextEventDispatcherListener::NotifyIME() before handling NOTIFY_IME_OF_FOCUS and then, nsBaseWidget::NotifyIME() sends the notification to the parent process.  However, new behavior is, the notification is sent before TextEventDispatcher::NotifyIME() handles NOTIFY_IME_OF_FOCUS.  Therefore, with new handling order, TextEventDispatcher can have IME notification requests after setting focus correctly.  Additionally, TextEventDispatcher for PuppetWidget updates the notification requests at every event dispatch via TextEventDispatcher::BeginInputTransactionInternal() by the previous patch.

So, with those patches, IMEContentObserver can refer actual IME notification requests correctly even after we'll make focus notification to async message.

MozReview-Commit-ID: JwdQ68BjTXL

--HG--
extra : rebase_source : fbc7e311d83aab3b38fdd5c1b5c24d85458eb77b
2017-07-26 00:09:41 +09:00
Masayuki Nakano
e7a9572555 Bug 1384027 - part1: PuppetWidget should have TextEventDispatcher like nsIWidget instance in the parent process r=m_kato
In the parent process, every nsIWidget instance like nsWindow has TextEventDispatcher instance after dispatching a keyboard event or a composition event.  Then, TextEventDispatcher manages whether there is composition and handles NotifyIME.  However, PuppetWidget doesn't have it unless it synthesizes keyboard events or composition events for tests.
This causes PuppetWidget implementing nsIWidget::NotifyIME() with nsBaseWidget::NotifyIMEInternal() which is a virtual method only implemented by PuppetWidget.  For consistent implementation around here, we should move NotifyIMEInternal() implementation to TextEventDispatcherListener::NotifyIME() which is called by TextEventDispatcher::NotifyIME().  Then, PuppetWidget can handle NotifyIME() easier.

This patch creates TextEventDispatcher::BeginInputTransactionFor() which takes pointer to a dispatching event and pointer to PuppetWidget.  It emulates each corresponding event dispatcher method for managing composing state and begins input transaction for the dispatching event.

Unfortunately, this implementation is ugly due to duplicated code.  However, this is enough for now.  When we need to make TextEventDispatcher manage more states, we should add methods which are shared by both BeginInputTransactionFor() and event dispatcher method.

MozReview-Commit-ID: GeP028luZjR

--HG--
extra : rebase_source : ce71ce4d7ba52aeb12bff2c403c9a6df47ea3a11
2017-07-25 23:27:31 +09:00
Bevis Tseng
a7505864a8 Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm
--HG--
extra : rebase_source : 11319e568a51d16754a6a9990f76c35c86c2bda7
2017-07-26 16:13:35 +08:00
Samael Wang
e90e4d4b15 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
MozReview-Commit-ID: GlDMNecWp3j

--HG--
extra : rebase_source : 1f8573df8845c100172f41febc5a84bbcd069769
2017-05-19 18:20:18 +08:00
Andrew Osmond
094c212d54 Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats 2017-07-18 09:35:07 -04:00
Carsten "Tomcat" Book
5f00ae3a8b merge mozilla-inbound to mozilla-central a=merge 2017-06-29 15:47:04 +02:00
Carsten "Tomcat" Book
257a632d4b Merge mozilla-central to autoland on a CLOSED TREE 2017-06-28 16:33:00 +02:00
Carsten "Tomcat" Book
6365f16e57 Backed out changeset a1e773337202 (bug 1350633) 2017-06-28 15:52:01 +02:00
Masayuki Nakano
71bb543ee5 Bug 1376424 - part1: TabChild should notify TabParent of "request to commit composition" handled r=m_kato
The problem is, only when requesting IME to commit or cancel composition is handled synchronously, TabParent does not send the dispatched eCompositionCommit(AsIs) event to the remote process.  Therefore, TabParent (and ContentCacheInParent) never receives  the message from the remote process.

This patch makes TabChild notifies TabParent of eCompositionCommitRequestHandled special event message after TabChild dispatches eCompositionCommit into the DOM tree.  Then, ContentCacheInParent should decrease mPendingCompositionCount and mPendingEventsNeedingAck as usual composition event messages.

MozReview-Commit-ID: 7ec5HPiE687

--HG--
extra : rebase_source : a9366abf6f8feec2d6ac639fd37f5b5c6ddd9586
2017-06-27 23:41:12 +09:00
Michael Layzell
3c82b8c224 Bug 1350633 - Remove the Msg_GetWidgetNativeData sync IPC, r=billm, r=jimm
MozReview-Commit-ID: Bql29wgVDZ5
2017-06-27 16:24:48 -04:00
Michael Layzell
17143c4e93 Bug 1350633 - Remove the Msg_GetWidgetNativeData sync IPC, r=billm, r=jimm
MozReview-Commit-ID: Bql29wgVDZ5
2017-06-28 12:25:32 -04:00
Wes Kocher
0439cd545d Backed out changeset 36d662fbab77 (bug 1350633) for failures in test_group_mouseevents.html a=backout
MozReview-Commit-ID: Gh9eflBppgq
2017-06-21 17:12:20 -07:00
Michael Layzell
f02a75cf86 Bug 1350633 - Remove the Msg_GetWidgetNativeData sync IPC, r=billm, r=jimm
MozReview-Commit-ID: Bql29wgVDZ5
2017-06-21 14:23:16 -04:00
Sebastian Hengst
e8cca2e7cf Backed out changeset 956306ea34f3 (bug 1350633) 2017-06-16 22:20:32 +02:00
Michael Layzell
6648f5c781 Bug 1350633 - Remove the Msg_GetWidgetNativeData sync IPC, r=billm, r=jimm
MozReview-Commit-ID: Bql29wgVDZ5
2017-06-16 14:59:35 -04:00
Mike Conley
a667d4ec7d Bug 1360946 - Consider a SetDocShellIsActive message a 'pending input event' so it can interrupt reflow. r=bz
MozReview-Commit-ID: 9tV1MFAtim4

--HG--
extra : rebase_source : 7230274a34900896237e2ccc89d1d94ecd9757e1
2017-05-26 18:27:45 -04:00
Karl Tomlinson
f527ef33ed bug 1341186 don't treat synth mouse moves as pending user input r=bz
Synth mouse move events are triggered by layout changes, which should
not interrupt reflow.

MozReview-Commit-ID: 5VFJFOXH3BB

--HG--
extra : rebase_source : ac976b508fac0aa661b75c630c55528d518ec52f
2017-02-13 15:08:14 +13:00
Ehsan Akhgari
1040ee9f65 Bug 1347035 - Store the maximum touch points for each tab child on the object instead of querying it synchronously from the parent actor when neeeded; r=smaug ipc-r=kanru 2017-05-23 17:00:09 -04:00
Masayuki Nakano
85a1d561a2 Bug 1339543 part 6 PBrowser::RequestNativeKeyBindings() should retrieves edit commands only for specified type r=smaug
PBrowser::RequestNativeKeyBindings() is used only when somebody tries to
execute native key bindings for synthesized keyboard events.  Therefore, it
doesn't need to retrieve edit commands for all editor types.  Instead, it
should take the editor type and just return the edit commands for it.

MozReview-Commit-ID: HF4Gz99SBQP

--HG--
extra : rebase_source : e332d2ef5ae36949a9a362d8f95c5d427c9812e7
2017-05-19 18:46:02 +09:00
Masayuki Nakano
5c5c82abc8 Bug 1339543 part 5 Remove unnecessary stuff from PuppetWidget r=smaug
MozReview-Commit-ID: 17dbDG1Fqwb

--HG--
extra : rebase_source : 9e1c849791d4b0e7bf132dd2d6a1628103664887
2017-05-17 20:46:47 +09:00