Commit Graph

208 Commits

Author SHA1 Message Date
Masayuki Nakano
0789f7b595 Bug 1217700 part.1 nsIWidget should return reference to IMENotificationRequests r=m_kato
IMEContentObserver may need to change notifications to send when TextInputProcessor begins input transaction.  In current design, IMEContentObserver needs to retrieve IMENotificationRequests at every change.  However, if nsIWidget returns a reference to its IMENotificationRequests, IMEContentObserver can call it only once.

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

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

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

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

MozReview-Commit-ID: 2SW3moONTOX

--HG--
extra : rebase_source : d2634ada6c33dbf7a966fadb68608411ee24bfab
2017-04-15 01:35:58 +09:00
Masatoshi Kimura
7e1158fd16 Bug 1356023 - Remove nsIScreenManager.systemDefaultScale. r=jfkthame
MozReview-Commit-ID: 6Ha8XrJBSiU

--HG--
extra : rebase_source : a83a64acf01dc9d1a0593c0ddbff76f74809a79b
2017-04-13 07:20:35 +09:00
Wes Kocher
514e230373 Merge inbound to central, a=merge 2017-04-13 17:24:01 -07:00
Kartikaya Gupta
b4341d2689 Merge m-c to graphics
MozReview-Commit-ID: EGaA6e4loBM
2017-04-13 11:08:02 -04:00
sotaro
a4ee7fc52d Bug 1354434 - Update PuppetWidget::Paint() as to handle WebRenderLayerManager r=mattwoodrow 2017-04-11 15:12:35 +09:00
vincentliu
bd43511f7f Bug 1343475 - Add labeling for Dispatch in PuppetWidget::Invalidate(). r=smaug 2017-04-13 13:46:28 +08:00
Masayuki Nakano
61ce5526c6 Bug 1296220 Rename nsIMEUpdatePreference to mozilla::widget::IMEUpdatePreference r=m_kato
MozReview-Commit-ID: 2rIXTlwA6my

--HG--
extra : rebase_source : a51be3edd717092738c2b5e8ccc4f60540712bfd
2017-04-11 21:24:55 +09:00
Sotaro Ikeda
1b3f1e93ba Bug 1353958 - Add Gpu process reset handling for QuantumRender. r=kats
MozReview-Commit-ID: 6ZkB1ezyWlK
2017-04-06 12:56:10 -04:00
Kartikaya Gupta
6c77e5ee0c Bug 1351777 - Use a BasicLayerManager in the content process if the corresponding parent-side layer manager isn't connected to the compositor. r=dvander
There are scenarios where we have a TabParent in the UI process hooked up to
a PuppetWidget with a BasicLayerManager. Webextensions fall into this category.
In this scenario, the parent-side layer manager is not hooked up to
the compositor (that is, there is no entry in the CompositorBridge layer tree
state map for the layers id). However, the content-side still ends up creating
a ClientLayerManager or a WebRenderLayerManager, which expects the layers id to
be registered in the compositor. This results in brokenness (in the case of the
ClientLayerManager/PLayerTransaction) or crashes (in the case of WebRenderLayerManager/
PWebRenderBridge). Instead, this patch changes this scenario to have the content
process use a BasicLayerManager which seems safer.

MozReview-Commit-ID: 3f80aZrRrmD

--HG--
extra : rebase_source : 10ec78dd7daf1c1c889929f0d79e0b75675b4b05
2017-03-31 11:43:21 -04:00
Kartikaya Gupta
042789f2a8 Bug 1351384 - Stop using the CompositorOptions to check if WebRender is enabled. r=dvander
I suspect that the PuppetWidget is trying to create the layer manager after
it has been connected to a TabChild but before the TabChild has populated the
CompositorOptions. This results in the PuppetWidget effectively getting an
uninitialized value for the CompositorOptions, and so it sometimes randomly
creates a WebRenderLayerManager, later resulting in a crash.

It seems like exposing the potentially-uninitialized CompositorOptions from
TabChild like this is a bad idea, so I'm removing that API and using the more
reliable gfxVars in PuppetWidget. This is fine for WebRender purposes because
we no longer care to allow having WR compositors co-exist with non-WR
compositors.

We may eventually want to remove the CompositorOptions entirely, but for now
the rest of the usage of it seems fine.

MozReview-Commit-ID: 6ekG8j1PskK

--HG--
extra : rebase_source : 0099e847ac356ca235969bcd81f47d65f49de2eb
2017-03-28 16:40:24 -04:00
Kan-Ru Chen
8ba424eabb Bug 1194751 - Part 6. Use mozilla::widget::ScreenManager in content process. r=mconley
This is the most important part of the patch series. It removes the
PScreenManager protocol and use ScreenManager directly in the content
processes.

Initial and subsequent updates are sent via PContent::RefreshScreens.
struct ScreenDetails are kept to serialize Screen over IPC.

nsIScreenManager::ScreenForNativeWidget is removed because
nsIWidget::GetWidgetScreen can replace it. nsIScreen::GetId is removed
because it's not useful for the more general Screen class.

MozReview-Commit-ID: 5dJO3isgBuQ

--HG--
extra : rebase_source : 06aa4e4fd56e2b2af1e7483aee7c0cc7f35bdb97
2017-03-09 19:30:26 +08:00
Kan-Ru Chen
be1eeb353b Bug 1194751 - Part 3. Remove unused nsIScreen::rotation attribute. r=jimm
It's only used by gonk. Remove it will make removing PScreenManager easier.

MozReview-Commit-ID: GCHonrz30xK

--HG--
extra : rebase_source : 73fbb4263b246d42cc38dd7a30edda9014953a97
2017-03-09 19:16:33 +08:00
Kan-Ru Chen
841c421ce8 Bug 1194751 - Part 1. Remove nsIScreenManager::GetNumberOfScreens. r=jimm
It's not used anywhere. Remove it will make removing PScreenManager
easier.

MozReview-Commit-ID: 5dn8kDhTZVl

--HG--
extra : rebase_source : 96b8ddb18deee94ca256bfa118b60ceacfd2d677
2017-03-09 19:16:24 +08:00
Jim Chen
53a1107cd1 Bug 1343075 - Use GeckoEditableSupport from PuppetWidget; r=masayuki r=rbarker r=snorp r=esawin
Bug 1343075 - 1a. Add TextEventDispatcherListener::GetIMEUpdatePreference; r=masayuki

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Bug 1343075 - 9. Update auto-generated bindings; r=me
2017-03-07 22:34:39 -05:00
George Wright
1899ab473c Bug 1338890 - Cache our tab behaviour instead of requesting it each time on a hot path r=smaug 2017-02-17 14:21:28 -05:00
Kartikaya Gupta
752898da60 Bug 1339097 - Allow PuppetWidget::GetLayerManager to return a layer manager even if it doesn't have a tabchild. r=dvander
MozReview-Commit-ID: Ee41WIUIC4U

--HG--
extra : rebase_source : 0e6bd742031e978d8954df321485054d4dc45824
2017-02-14 13:15:50 -05:00
David Anderson
a55e86f1b5 Give browser-process PuppetWidgets a BasicLayerManager. (bug 1287004, r=mattwoodrow) 2017-02-12 11:38:34 -08:00
Kartikaya Gupta
6580d884b2 Merge m-c to graphics
MozReview-Commit-ID: uU8MPphFqj
2017-02-02 13:38:51 -05:00
Kartikaya Gupta
eb1d639e68 Bug 1333122 - Use the CompositorOptions to determine the appropriate LayerManager to create for content-process tabs. r=dvander
MozReview-Commit-ID: AhEpuPa2heV
2017-01-24 08:03:08 -05:00
David Anderson
079406cb3b Make sure the last transaction is revoked when resetting content layer managers. (bug 1331548 part 3, r=mattwoodrow) 2017-02-01 23:52:48 -08:00
Kartikaya Gupta
90ff407202 Merge m-c to graphics
MozReview-Commit-ID: Gds3AlDHXgY
2017-01-20 10:07:40 -05:00
Kartikaya Gupta
1f97dac250 Back out 4 csets from bug 1326421 because of various test failures. r=backout 2017-01-13 17:07:59 -05:00
Kartikaya Gupta
5c7f3cb9dd Bug 1326421 - Have content processes create WebRenderLayerManagers if and only if the compositor being used is WebRender. r=dvander
Also guard against a scenario where RecvDocShellIsActive gets called before
we have the layers id for the tab. Because we need to have the compositor
options (which requires knowing the layers id) before we can create the layer
manager, we need to avoid calling GetLayerManager() before we have the options.

MozReview-Commit-ID: 1MKdhvUJobD
2017-01-13 15:16:52 -05:00
Kartikaya Gupta
5e2e8f8f8e Merge m-c to graphics
MozReview-Commit-ID: 5ovnMmSOiZX
2017-01-09 10:18:37 -05:00
Masayuki Nakano
3227a842d7 Bug 1332195 part.2 Fix some nits of event handlers in TabChild, TabParent and PuppetWidget r=smaug
This patch fixes:

* some long lines
* some odd indent
* wrapping one line blocks with {}
* removing B2G specific block

in event handlers in TabChild, TabParent and PuppetWidget.

MozReview-Commit-ID: 6xMsNEDA5nv

--HG--
extra : rebase_source : 7f5ff8830842af9338085a31ac4b40d6c1fb91fe
2017-01-19 17:57:20 +09:00
Masayuki Nakano
4db09a4429 Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
MozReview-Commit-ID: 2c7cbOigwfU

--HG--
extra : rebase_source : 61ab34ac7c680d68edf3773905ae4bb264045916
2017-01-19 17:27:15 +09:00
Kartikaya Gupta
4233ee5fec Merge m-c to graphics
MozReview-Commit-ID: E0Sr26LKcZx
2016-12-21 10:16:15 -05:00
Kartikaya Gupta
108f572510 Merge m-c to graphics
MozReview-Commit-ID: 6ocpYm7MBCV
2016-12-19 13:35:32 -05:00
Nicholas Nethercote
523bee37b8 Bug 1325234 (part 9) - Remove remaining NS_IMETHOD_ occurrences from nsIWidget. r=mstange.
|virtual T| is clearer than |NS_IMETHOD_(T)|.

--HG--
extra : rebase_source : 9c8f423d7a89782a4d790a50e137071271086eed
2016-12-21 15:27:20 +11:00
Nicholas Nethercote
bf4a843d70 Bug 1325234 (part 8) - Streamline nsIWidget::DispatchEvent. r=jimm.
This patch changes it from |NS_IMETHOD| to |virtual nsresult| because some
callsites are checked and some aren't.

--HG--
extra : rebase_source : dd98266bce0a7583863908b6f04729a6e403b721
2016-12-21 11:18:40 +11:00
Nicholas Nethercote
ea1e2ca6ce Bug 1325234 (part 5) - Streamline nsIWidget::SetCursor (both versions). r=jimm.
This patch changes one from |NS_IMETHOD| to |virtual nsresult| and the other to
|virtual void|.

--HG--
extra : rebase_source : 55af71c01dc75d6bf7c63191e9cfabc9f5368ffa
2016-12-21 11:13:08 +11:00
Nicholas Nethercote
0eaecf55da Bug 1325234 (part 4) - Streamline nsIWidget::{SetFocus,SetNonClientMargins}(). r=mstange.
This patch changes them from |NS_IMETHOD| to |virtual nsresult|.

--HG--
extra : rebase_source : 5e54c2fd340c393b33c9e1dcf20a80fe2f41b2f4
2016-12-21 11:13:08 +11:00
Nicholas Nethercote
da5978a842 Bug 1325234 (part 3) - Streamline nsIWidget::Show(). r=mstange.
This patch changes it from |NS_IMETHOD| to |virtual void|. The return value was
only checked in one low-value assertion and one other place where the check had
no useful effect (in nsCocoaWindow::HideWindowChrome()).

--HG--
extra : rebase_source : f6671e9e0e10ee18fb32f8b1c83f1e64c3d97e67
2016-12-21 11:12:54 +11:00
Nicholas Nethercote
e2d9e4ed68 Bug 1325234 (part 2) - Streamline nsIWidget::Invalidate(). r=jimm.
This patch changes it from |NS_IMETHOD| to |virtual void|. The return value was
only checked in one low-value assertion so I decided it wasn't needed.

--HG--
extra : rebase_source : 3523d9a086cf98c40d237d777f5dd471af0d7465
2016-12-20 09:55:32 +11:00
sotaro
cb00bc0288 Bug 1320284 - Remove some MOZ_ENABLE_WEBRENDER r=nical? 2016-12-15 14:05:38 +09:00
Kartikaya Gupta
dd70fb88f4 Merge m-c to graphics
MozReview-Commit-ID: C13IwWOpf64
2016-12-14 09:32:38 -05:00
Kartikaya Gupta
7383fcbb4a Merge m-c to graphics
MozReview-Commit-ID: KhxBqJbwxv8
2016-12-06 23:45:24 -05:00
sotaro
8726336a39 Bug 1320284 - Switch WebRender by Pref r=nical? 2016-12-04 17:40:52 +09:00
Andrew McCreight
fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd
826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight
e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
Nicholas Nethercote
a28c8f38b2 Bug 1299335 (part 7) - Streamline nsIWidget::{Move,Resize}. r=mstange.
This patch changes them from |NS_IMETHOD| to |virtual void| because every
implementation of these functions always returns |NS_OK|.

--HG--
extra : rebase_source : 6207df5a46aeb6b8aaa0f697447a51bc6a6dc366
2016-12-19 20:54:03 +11:00
Nicholas Nethercote
4f95087c90 Bug 1299335 (part 5) - Streamline nsIWidget::StartPluginIME. r=mstange.
This patch changes it from |NS_IMETHOD| to |virtual MOZ_MUST_USE nsresult|.

--HG--
extra : rebase_source : cd17e3c00c6c183d898f83e020861720b199775a
2016-12-16 10:55:18 +11:00
Mozilla Graphics Team
9cc9061246 Bug 1317774 - Add non-gfx code needed to use WebRender in gecko. r=gfx
This completes the migration of code from the github branch to the graphics
project repo. At this point all webrender-related code should be disabled
unless --enable-webrender is provided in the mozconfig.

MozReview-Commit-ID: Dea8rxM6UPL
2016-11-16 08:54:51 -05:00
Jessica Jong
8b1856afb0 Bug 1321245 - Request native key bindings for delayed keypress events. r=smaug
--HG--
extra : rebase_source : c273efdca1731a5b09b01c5848b7a34fd1a71e43
2016-12-02 00:41:00 -05:00
Mike Conley
bb166e23a8 Bug 1323586 - Drop reference to previous widget listener in PuppetWidget when showing after having been hidden. r=tnikkel
The previously attached widget listener is used mainly so that we can
continue to show the previous page until the next one is ready enough
to display properly (to avoid a "flashing" effect). When the PuppetWidget
is made visible after having been hidden (perhaps during a tab switch),
the previously attached widget listener is not useful. It's actually
harmful, since PuppetWidget::Paint will attempt to paint that old
widget listener, which is not possible, since it's detatched from
a widget, so we end up not painting a frame.

MozReview-Commit-ID: LJfKzepqguE

--HG--
extra : rebase_source : 60596bf63ad5fd8c2e1f1e84cb7d3dc1be8e0887
2016-12-16 15:54:49 -05:00
Kartikaya Gupta
7e39a2bc59 Bug 1315974 - When creating the widget layer manager, don't assume it will always be a ClientLayerManager. r=mattwoodrow
MozReview-Commit-ID: 8r037jdHJ0E

--HG--
extra : rebase_source : 5f0e406ea6eb497b72f40054ba50cf64a6bd7dfb
2016-11-08 10:42:26 -05:00
Kartikaya Gupta
57f37706cc Bug 1315477 - Add a AsBasicLayerManager() function and use instead of static_casts. r=mattwoodrow
MozReview-Commit-ID: DV6XZBEXw85

--HG--
extra : rebase_source : b82f2ea2d073292c2a9514ba8a4c2d0c8397d90a
2016-11-07 11:38:45 -05: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
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