Commit Graph

634 Commits

Author SHA1 Message Date
Botond Ballo
cade60817b Bug 1773256 - Use ProjectPoint when transforming coordinates from parent to child in BrowserParent. r=tnikkel
This patch also backs out the incorrect fix for bug 1745834
(see comment 12 on the bug for an explanation).

Differential Revision: https://phabricator.services.mozilla.com/D149321
2022-06-15 05:29:52 +00:00
Emilio Cobos Álvarez
bcabeab0f8 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 15:01:52 +00:00
Norisz Fay
994a679882 Backed out changeset da5c71190673 (bug 1773813) for causing build bustages CLOSED TREE 2022-06-14 15:13:58 +03:00
Emilio Cobos Álvarez
bbb4f4acce Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 11:37:25 +00:00
James Teh
7aaf528219 Bug 1772332: Don't return a destroyed DocAccessibleParent in BrowserParent::GetTopLevelDocAccessible. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D148873
2022-06-13 21:54:13 +00:00
Nika Layzell
a4a6fe3798 Bug 1773088 - Part 2: Stop requiring an actor to serialize StructuredCloneData over IPC, r=asuth
This is largely a straightforward find and replace of various methods, with the
unnecessary arguments removed and compiler errors fixed.

Differential Revision: https://phabricator.services.mozilla.com/D148532
2022-06-08 15:24:27 +00:00
Masayuki Nakano
243a3b9e44 Bug 1772634 - part 2: Make BrowserParent::RecvSynthesizeNativeTouchPoint relax in the responsive design mode r=smaug
It's used by the DevTools to emulate touch events from mouse events in the
responsive design mode.  Therefore, we should make it accept IPC messages
even if it's not in the automation mode, but it's in the responsive design mode.

Differential Revision: https://phabricator.services.mozilla.com/D148365
2022-06-06 14:30:42 +00:00
Masayuki Nakano
98b4f88856 Bug 1772634 - part 1: Make BrowserParent::RecvSynthesizeNativeMouseMove relax r=smaug
This is used by in the normal mode (i.e., not in the automation mode) to
emulate a hover at locking or unlocking a pointer capture.  If it'd be possible,
we should make it handle only in the remote process, but for now, we should
make it relax for safer fix in the branches.  I think that it's acceptable
because synthesizing only native mousemove events is safer than the other events.

Differential Revision: https://phabricator.services.mozilla.com/D148364
2022-06-06 14:30:42 +00:00
Masayuki Nakano
c5a966e2bc Bug 1763634 - part 2: Make BrowserParent verify whether replied keyboard events are what it sent r=smaug
For making this, `BrowserParent` (temporarily) store sent keyboard events which
wants reply from the remote process.  Then, when it gets a reply event received,
it compares whether the event data is broken or not.

Differential Revision: https://phabricator.services.mozilla.com/D145944
2022-06-02 23:50:44 +00:00
Masayuki Nakano
03f3c6167b Bug 1763634 - part 1: Make BrowserParent handle test APIs only when it's in the automated mode r=smaug
Make testing API path work only when it's in the automated test mode.

Differential Revision: https://phabricator.services.mozilla.com/D145943
2022-06-02 23:50:43 +00:00
James Teh
ecd3ad9bab Bug 1756728 part 1: Make it possible to retrieve a BrowsingContext from a DocAccessibleParent. r=morgan
Previously, even for remote in-process iframes, it was only possible to retrieve the top level BrowsingContext for the remote process by getting the managing BrowserParent.
This makes it possible to get the correct BrowsingContext even for in-process iframes.

Differential Revision: https://phabricator.services.mozilla.com/D147716
2022-06-01 00:34:17 +00:00
Emilio Cobos Álvarez
39c3ff480d Bug 1767346 - Use browsing context activeness rather than renderLayers to determine process priority. r=mccr8,mconley,geckoview-reviewers,agi
For desktop this should basically have no impact (maybe impacts tab
warming, but if we wanted we could set the priority hint from the tab
switcher the same way we set renderLayers), but Fenix always has
renderLayers as true, effectively, so we were never de-prioritizing the
background tab processes.

Differential Revision: https://phabricator.services.mozilla.com/D145351
2022-05-20 09:14:42 +00:00
Marian-Vasile Laza
ae33cd6e6e Backed out changeset 7b3a02a659ef (bug 1767346) for causing geckoview failures. CLOSED TREE 2022-05-20 05:23:28 +03:00
Emilio Cobos Álvarez
0672629393 Bug 1767346 - Use browsing context activeness rather than renderLayers to determine process priority. r=mccr8,mconley,geckoview-reviewers,agi
For desktop this should basically have no impact (maybe impacts tab
warming, but if we wanted we could set the priority hint from the tab
switcher the same way we set renderLayers), but Fenix always has
renderLayers as true, effectively, so we were never de-prioritizing the
background tab processes.

Differential Revision: https://phabricator.services.mozilla.com/D145351
2022-05-20 00:48:32 +00:00
Markus Stange
78dab6af74 Bug 1768241 - Fall back to the global vsync dispatcher when we're on Wayland and there's no widget-local dispatcher.
This is fixing an oversight in a patch that was supposed to be functionally neutral.
https://hg.mozilla.org/mozilla-central/rev/22b568631834e556ab8351ac8458d5b24aa638bd#l1.49

The old code always called UpdateVsyncDispatcher, even if the widget's vsync
source was null, and then UpdateVsyncDispatcher fell back to using the global
vsync source when null was passed.
The new code skipped the call entirely when the vsync dispatcher was null,
so it prevented fallback to the global vsync dispatcher.
Now with this patch, we correctly fall back to the global vsync
dispatcher if the widget's dispatcher is null.

This code only runs on Linux wayland; on other platforms, BrowserParent::mVsyncParent
is always null because nothing calls AllocPVsyncParent.

Differential Revision: https://phabricator.services.mozilla.com/D145807
2022-05-07 22:20:50 +00:00
Markus Stange
6c635cc7e4 Bug 1765399 - Replace nsIWidget::GetVsyncSource with nsIWidget::GetVsyncDispatcher. r=smaug
All users of nsIWidget::GetVsyncSource just want the dispatcher anyway.
Getting the dispatcher directly from the widget will allow us to remove VsyncSource::GetVsyncDispatcher.

Differential Revision: https://phabricator.services.mozilla.com/D144374
2022-05-05 02:15:17 +00:00
Markus Stange
296feb0f5f Bug 1765399 - Make VsyncParent use VsyncDispatcher instead of VsyncSource. r=smaug
This doesn't change much; VsyncParent was already only using mVsyncSource
to obtain the VsyncDispatcher. (And to get the vsync rate, which it can
now get directly from the dispatcher.)

Differential Revision: https://phabricator.services.mozilla.com/D144370
2022-05-05 02:15:16 +00:00
Eitan Isaacson
9b05b625a5 Bug 1765433 - P3: Get bundle and do pivot in UI thread for remote accessibles. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144896
2022-05-04 18:00:47 +00:00
Marian-Vasile Laza
f9224e56ba Backed out 16 changesets (bug 1765399) for causing build bustages on RefPtr.h.
Backed out changeset 8ff5e213e351 (bug 1765399)
Backed out changeset bd164f5cc8b3 (bug 1765399)
Backed out changeset 939b577eee05 (bug 1765399)
Backed out changeset ee00e3583f42 (bug 1765399)
Backed out changeset e5001537e536 (bug 1765399)
Backed out changeset d5a4004a2955 (bug 1765399)
Backed out changeset d3c1f6c420e3 (bug 1765399)
Backed out changeset d21fca656853 (bug 1765399)
Backed out changeset 5e5a29a99c9e (bug 1765399)
Backed out changeset ce326de1e107 (bug 1765399)
Backed out changeset 3890e83660b0 (bug 1765399)
Backed out changeset 2f3ceca7aefe (bug 1765399)
Backed out changeset 40c47c498858 (bug 1765399)
Backed out changeset 3a3a2aa6de9b (bug 1765399)
Backed out changeset 4a30a4b3d30d (bug 1765399)
Backed out changeset a9115d9d648e (bug 1765399)
2022-05-05 00:30:06 +03:00
Markus Stange
a1023168dd Bug 1765399 - Replace nsIWidget::GetVsyncSource with nsIWidget::GetVsyncDispatcher. r=smaug
All users of nsIWidget::GetVsyncSource just want the dispatcher anyway.
Getting the dispatcher directly from the widget will allow us to remove VsyncSource::GetVsyncDispatcher.

Differential Revision: https://phabricator.services.mozilla.com/D144374
2022-05-04 16:13:38 +00:00
Markus Stange
690eacff65 Bug 1765399 - Make VsyncParent use VsyncDispatcher instead of VsyncSource. r=smaug
This doesn't change much; VsyncParent was already only using mVsyncSource
to obtain the VsyncDispatcher. (And to get the vsync rate, which it can
now get directly from the dispatcher.)

Differential Revision: https://phabricator.services.mozilla.com/D144370
2022-05-04 16:13:37 +00:00
Andreas Farre
ea19a48880 Bug 1739450 - Part 1: Move ownership of session store scroll and form data to platform. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D130389
2022-04-19 15:19:22 +00:00
Timothy Nikkel
ed09e96dad Bug 1765110. Silence spammy warning in BrowserParent::HandleQueryContentEvent. r=masayuki
Depends on D143888

Differential Revision: https://phabricator.services.mozilla.com/D143889
2022-04-18 04:26:54 +00:00
Olli Pettay
2f035a9780 Bug 1762357, don't even try to handle bogus messages in testing methods, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D143098
2022-04-11 21:35:12 +00:00
Molnar Sandor
4863c927fb Backed out changeset 06c445902d31 (bug 1762357) for causing build bustage in dom/ipc/BrowserParent.cpp CLOSED TREE 2022-04-12 00:08:29 +03:00
Olli Pettay
37db83466e Bug 1762357, don't even try to handle bogus messages in testing methods r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D143098
2022-04-11 19:58:39 +00:00
Jens Stutte
1338c9b0e8 Bug 1696771: Always null check the ContentProcessManager singleton before use. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D143180
2022-04-08 11:57:05 +00:00
Norisz Fay
80a86ada49 Backed out changeset 2531ddbeeffa (bug 1696771) for causing multiple failures CLOSED TREE 2022-04-08 10:44:55 +03:00
Jens Stutte
8507c7e54e Bug 1696771: Always null check the ContentProcessManager singleton before use. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D143180
2022-04-08 06:20:19 +00:00
Timothy Nikkel
ebe2ba2605 Bug 1763121. nsIDOMWindowUtils::sendNativeTouchpadPan should use an observer to notify when the event has been sent to the destination widget. r=hiro
Otherwise we can return without the widget even seeing the event. This is how other test functions are implemented.

We need this to make the test in bug 1757928 pass.

Differential Revision: https://phabricator.services.mozilla.com/D142943
2022-04-05 22:53:35 +00:00
Cathy Lu
b9ffc526b6 Bug 1753700 - Add priorityHint to allow apps to increase process priority for background tabs r=geckoview-reviewers,mccr8,agi
Prior behavior for active tabs in an inactive app would have the process priority oom score of 15. Now it's set to a higher priority oom score of 11. This will increase priority for recently used tabs on apps and prevent Android from unloading them.

Differential Revision: https://phabricator.services.mozilla.com/D142386
2022-04-04 17:41:37 +00:00
Cosmin Sabou
6e5b6e1dd2 Backed out changeset b7dc5de07187 (bug 1753700) for causing android mochitest failures on test_ext_tabs_getCurrent.html. CLOSED TREE 2022-04-02 01:28:06 +03:00
Cathy Lu
5b610d6222 Bug 1753700 - Add priorityHint to allow apps to increase process priority for background tabs r=geckoview-reviewers,mccr8,agi
Prior behavior for active tabs in an inactive app would have the process priority oom score of 15. Now it's set to a higher priority oom score of 11. This will increase priority for recently used tabs on apps and prevent Android from unloading them.

Differential Revision: https://phabricator.services.mozilla.com/D142386
2022-04-01 17:44:33 +00:00
Iulian Moraru
8f6711c224 Backed out changeset 4a083131d350 (bug 1753700) for causing linting failures on browser_ProcessPriorityManager.js. CLOSED TREE 2022-04-01 19:37:35 +03:00
Cathy Lu
325056c0bd Bug 1753700 - Add priorityHint to allow apps to increase process priority for background tabs r=geckoview-reviewers,mccr8,agi
Prior behavior for active tabs in an inactive app would have the process priority oom score of 15. Now it's set to a higher priority oom score of 11. This will increase priority for recently used tabs on apps and prevent Android from unloading them.

Differential Revision: https://phabricator.services.mozilla.com/D142386
2022-04-01 16:10:47 +00:00
Cathy Lu
616188e86a Bug 1753700 - Rename ActivityChanged to BrowserPriorityChanged. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D141531
2022-04-01 14:42:41 +00:00
Butkovits Atila
520eb8752c Backed out 2 changesets (bug 1728331) for causing failures at RTCPeerConnection-videoDetectorTest.html. CLOSED TREE
Backed out changeset b6649f0253c5 (bug 1728331)
Backed out changeset e9242af1224d (bug 1728331)
2022-03-29 00:04:47 +03:00
Nika Layzell
169d7e48bb Bug 1728331 - Part 1: Avoid cycling between processes when navigating within a tab, r=smaug
This patch replaces the previous process selection infrastructure with a
new setup implemented entirely in C++, which should more accurately
track the set of processes in use, and should encourage re-use of the
existing content process when navigating by not counting the current
tab.

This approach intentionally allows for process switching to another
process during navigation if there is uneven load between processes to
encourage balanced process use.

I think this may also fix some of the session restore issues with many
tabs using the same process, rather than being spread over 4, as we now
track a tab earlier in its lifecycle before the BrowserParent instance
is created.

Differential Revision: https://phabricator.services.mozilla.com/D126405
2022-03-28 16:18:04 +00:00
Masayuki Nakano
33d2450f2a Bug 1191862 - part 3: Make GlobalKeyListener not reserve key combination which is mapped to an edit command or a navigation command by native key bindings r=NeilDeakin,smaug
Users may map reserved shortcut keys of Firefox/Thunderbird as an editing
command or a navigation command.  Therefore if and only if an editable element
has focus and a reserved key combination is mapped to an editing command or
a navigation command by the system settings, we should allow to dispatch it
into the content and work it as what user expects.

With this change, keyboard only users may loose some shortcut keys to leave
from a web content which blocks keyboard focus in it.  However, there may
be another reserved shortcut keys to escape from such web apps only with
keyboard because it's hard to think that all reserved shortcut keys conflict
with users' settings.

Differential Revision: https://phabricator.services.mozilla.com/D138009
2022-02-15 08:00:06 +00:00
Masayuki Nakano
494f869332 Bug 1191862 - part 2: Make TextEventDispatcher store writing mode at selection at receiving focus notification r=m_kato
Querying selection for getting writing mode may run script in the main process
if focus is in it.  For avoiding new users of writing mode at selection **only**
when the value is required during an editable content has focus,
`TextEventDispatcher` should always store writing mode at receiving focus
notification.

Differential Revision: https://phabricator.services.mozilla.com/D138008
2022-02-15 08:00:06 +00:00
Masayuki Nakano
a8c2bbc3f0 Bug 1191862 - part 1: Make nsIWidget::NativeKeyBindingsType independent from nsIWidget and defined in an independent header file r=smaug
I'd like to use it in `IMEData.h`.  However, adding new include into it may
cause bustage with MinGW, and it's included by `nsIWidget.h` because `nsIWidget`
requires some classes defined in `IMEData.h`.  Therefore, I'd like to make a
new header file for avoiding the include hell.

Differential Revision: https://phabricator.services.mozilla.com/D138007
2022-02-15 08:00:05 +00:00
Agi Sferro
dc2b19c674 Bug 1753772 - Don't call SetDynamicToolbarMaxHeight for non-root BrowserParent. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D138326
2022-02-10 01:09:49 +00:00
Makoto Kato
05a04737a2 Bug 1750532 - Get rid of orientation information from BrowserParent/BrowserChild. r=nika
This is introduced by bug 805939, but no one uses it.
Screen orientation information is handled by `hal::ScreenConfiguration` now.

Differential Revision: https://phabricator.services.mozilla.com/D136119
2022-01-18 00:57:36 +00:00
Kagami Sascha Rosylight
3eb98512fe Bug 1539884 - Part 16: Mark BrowserParent::RecvReplyKeyEvent/RecvAccessKeyNotHandled as CAN_RUN_SCRIPT_BOUNDARY r=masayuki
Depends on D134106

Differential Revision: https://phabricator.services.mozilla.com/D134107
2021-12-17 13:27:51 +00:00
Nika Layzell
83d7a38c5a Bug 1725572 - Part 3: Recover from a missing subframe BrowsingContext in ConstructBrowser, r=smaug
If the BrowsingContext is missing in ConstructBrowser, previously we would fail
out, crashing the content process. With this new change, we instead exit
successfully, destroying the `ManagedEndpoint` instances due to the earlier
changes in this bug, and displaying the subframe as crashed.

As we don't know how to reproduce the case which caused this crash, this change
instead triggers the failure using a custom pref, which can be used to request
that attempts to create a BrowserParent for a specific BrowsingContext fail in
the same way as it would for a missing BrowsingContext, allowing us to test the
behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D128778
2021-10-18 22:59:18 +00:00
Daniel Holbert
f6ff9635d0 Bug 1733465 part 2: Modernize nsViewManager::GetRootWidget() to use already_AddRefed return value, instead of requiring getter_AddRefs at callsite. r=tnikkel
This patch shouldn't change behavior at all.

This patch replaces a manual NS_ADDREF call with typesafe code that manages the
reference count for us.  This reduces repeated boilerplate code, in the
implementation as well as the callsites.

Differential Revision: https://phabricator.services.mozilla.com/D127179
2021-10-01 20:38:09 +00:00
Sandor Molnar
cd907dc1bb Backed out 5 changesets (bug 1733465) for causing android build bustages in android/SessionAccessibility.cpp. CLOSED TREE
Backed out changeset 4c5b28b66740 (bug 1733465)
Backed out changeset 3db0452b185c (bug 1733465)
Backed out changeset d7460c9c6acb (bug 1733465)
Backed out changeset 3cee3f595e45 (bug 1733465)
Backed out changeset 267d5fc92f12 (bug 1733465)
2021-10-01 19:13:59 +03:00
Daniel Holbert
10092c7ff4 Bug 1733465 part 2: Modernize nsViewManager::GetWidget() to use already_AddRefed return value, instead of requiring getter_AddRefs at callsite. r=tnikkel
This patch shouldn't change behavior at all.

This patch replaces a manual NS_ADDREF call with typesafe code that manages the
reference count for us.  This reduces repeated boilerplate code, in the
implementation as well as the callsites.

Differential Revision: https://phabricator.services.mozilla.com/D127179
2021-10-01 14:37:05 +00:00
criss
9e5f6cc9ec Backed out 2 changesets (bug 1731792) for causing devtools failures on browser_console_error_source_click.js
Backed out changeset 567d4eb7bc83 (bug 1731792)
Backed out changeset db57b8568ae9 (bug 1731792)
2021-09-28 06:15:28 +03:00
Nika Layzell
d6e67e808f Bug 1731792 - Part 1: Avoid cycling between processes when navigating within a tab, r=smaug
This patch replaces the previous process selection infrastructure with a
new setup implemented entirely in C++, which should more accurately
track the set of processes in use, and should encourage re-use of the
existing content process when navigating by not counting the current
tab.

This approach intentionally allows for process switching to another
process during navigation if there is uneven load between processes to
encourage balanced process use.

I think this may also fix some of the session restore issues with many
tabs using the same process, rather than being spread over 4, as we now
track a tab earlier in its lifecycle before the BrowserParent instance
is created.

Differential Revision: https://phabricator.services.mozilla.com/D126405
2021-09-27 22:34:20 +00:00