Commit Graph

768 Commits

Author SHA1 Message Date
Edgar Chen
591fe42773 Bug 1836550 - Validate image data received from IPC; r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D181261
2023-06-20 08:40:05 +00:00
Emilio Cobos Álvarez
ad77d3cd03 Bug 1837450 - Check for overflow when validating custom cursor data. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D181260
2023-06-19 14:54:59 +00:00
Masayuki Nakano
155fd7857c Bug 1832306 - Make BrowserParent stop handling access keys with delayed events r=smaug,NeilDeakin
`EventStateManager::WalkESMTreeToHandleAccessKey()` requests all `BrowserParent`
instances to handle access key in content processes:
https://searchfox.org/mozilla-central/rev/a4fd6daad3a4123d995478467c1274653b283801/dom/events/EventStateManager.cpp#1379,1398,1410-1411

Then, content processes will reply if no element matches with the access key:
https://searchfox.org/mozilla-central/rev/8e1b221afcdae76284b1439c547b032d1f84d236/dom/ipc/BrowserChild.cpp#2304-2305,2310

Finally, the parent process handles the keypress event:
https://searchfox.org/mozilla-central/rev/8e1b221afcdae76284b1439c547b032d1f84d236/dom/ipc/BrowserParent.cpp#2710-2712,2720,2725

However, this is odd because if multiple remote processes calls
`BrowserParent::RecvAccessKeyNotHandled()`, the parent process will handle
same `keypress` event multiple times.

The approach of this patch is, `BrowserParent` should store main data of
sending `eKeyPress` event, and `RecvAccessKeyNotHandled()` handles only if
the coming event matches with the stored one and clear the data to avoid
handling multiple times.

Even with this approach, we cannot avoid one `eKeyPress` event handled in
multiple content processes, or in both the main process and a content process.

Differential Revision: https://phabricator.services.mozilla.com/D179172
2023-06-15 13:33:19 +00:00
Masayuki Nakano
ae2415dd66 Bug 1690827 - part 1: Number each composition for native IME or synthesized in the parent process r=smaug
For handling (ignoring) "too late" composition commit request from content
process, we need to distinguish a request is for which composition.  Therefore,
we need to number each composition originated in the parent process.

This patch makes `TextComposition` instance which is created at first
composition event for a composition consider a composition ID in the parent
process and set it to composition events which are dispatched into the DOM
tree in the parent or sent to a remote process.

And also this patch adds the composition ID param to the request method of
committing composition and reply methods to notify the parent process of ending
a composition event handling.

The last patch handle them in `ContentCacheInParent` to consider
whether a request/reply should be ignored or handled.

Differential Revision: https://phabricator.services.mozilla.com/D179310
2023-06-14 01:57:33 +00:00
Cosmin Sabou
db0847b0f7 Backed out 6 changesets (bug 1690827, bug 1835577, bug 1835578) for causing build bustages on widget/ContentCache.cpp. CLOSED TREE
Backed out changeset 8f96604b79a6 (bug 1835578)
Backed out changeset 3afcf20d7fb6 (bug 1835577)
Backed out changeset 41105bb6e199 (bug 1690827)
Backed out changeset feedd62f908d (bug 1690827)
Backed out changeset bc45f9483150 (bug 1690827)
Backed out changeset d2c874809470 (bug 1690827)
2023-06-13 09:31:03 +03:00
Masayuki Nakano
15b0e0a16e Bug 1690827 - part 1: Number each composition for native IME or synthesized in the parent process r=smaug
For handling (ignoring) "too late" composition commit request from content
process, we need to distinguish a request is for which composition.  Therefore,
we need to number each composition originated in the parent process.

This patch makes `TextComposition` instance which is created at first
composition event for a composition consider a composition ID in the parent
process and set it to composition events which are dispatched into the DOM
tree in the parent or sent to a remote process.

And also this patch adds the composition ID param to the request method of
committing composition and reply methods to notify the parent process of ending
a composition event handling.

The last patch handle them in `ContentCacheInParent` to consider
whether a request/reply should be ignored or handled.

Differential Revision: https://phabricator.services.mozilla.com/D179310
2023-06-13 04:07:45 +00:00
Masayuki Nakano
3ea832e4ce Bug 1825693 - Make ContentCache stop assigning invalid data r=m_kato,nika
There are some crash reports crashed in TSF module which may be caused by
passing invalid selection range (e.g., out of bounds of text).  However,
the cache is created in the child process and that causes the invalid cache
creation does not appear in the crash reports.  Therefore, let's try to
crash as soon as possible if `ContentCache` has invalid data.

Note that this does not detect all of the invalid cases because it's hard to
(re-)understand the edge cases.  Therefore, this tries to detect the cases
checked in `ContentCacheInParent::HandleQueryContentEvent` (*1) and some other
obvious odd cases.

1. https://searchfox.org/mozilla-central/rev/0ffaecaa075887ab07bf4c607c61ea2faa81b172/widget/ContentCache.cpp#776-778

Differential Revision: https://phabricator.services.mozilla.com/D176747
2023-05-26 01:24:35 +00:00
Olli Pettay
e8471cb79d Bug 1534586 - Remove unused PBrowser::DispatchFocusToTopLevelWindow, r=aiunusov,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D178976
2023-05-25 12:15:44 +00:00
Emilio Cobos Álvarez
f8efc66d64 Bug 1834813 - Document.allowDeprecatedTls is dead code. r=smaug,geckoview-reviewers,m_kato
This was added in bug 1641597, but nowadays neither us nor Fenix show
any UI to enable deprecated TLS anymore. That string isn't in the
firefox-android repo afaict:

  https://github.com/search?type=code&q=repo%3Amozilla-mobile%2Ffirefox-android+allowDeprecatedTls

So this is just dead code.

Differential Revision: https://phabricator.services.mozilla.com/D178958
2023-05-25 10:00:46 +00:00
James Teh
45e9e9b5ee Bug 1821956 part 7: Remove DocAccessibleChildBase::IsConstructedInParentProcess. r=nlapre
Now that we don't defer events on Windows, this isn't necessary on Windows.
Usage of this on other platforms was removed in bug 1821957.

Differential Revision: https://phabricator.services.mozilla.com/D177900
2023-05-21 22:23:48 +00:00
James Teh
a8c3928847 Bug 1821956 part 4: Remove COM proxy, HWND and MSAA id code from PDocAccessible. r=nlapre
All of this is only used to support content process COM proxies.

Differential Revision: https://phabricator.services.mozilla.com/D177897
2023-05-21 22:23:47 +00:00
James Teh
2241907f41 Bug 1821956 part 1: Remove content process COM proxy support from MsaaAccessible, ia2Accessible, etc. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D177894
2023-05-21 22:23:47 +00:00
James Teh
ddfdb64368 Bug 1821955 part 5: Change all CtW pref checks to use a11y::IsCacheActive. r=eeejay,taskgraph-reviewers,bhearsum
This was done using the following script:

```
matchingFiles=`git grep -l accessibility_cache_enabled`
sed -i 's/StaticPrefs::accessibility_cache_enabled_AtStartup/a11y::IsCacheActive/' $matchingFiles
for f in $matchingFiles; do
  usesA11yPref=
  grep -q StaticPrefs::accessibility_ $f && usesA11yPref=1
  hasA11yInclude=
  grep -q 'nsAccessibilityService.h' $f && hasA11yInclude=1
  if [ -z $usesA11yPref ] && [ -z $hasA11yInclude ]; then
    sed -i 's,mozilla/StaticPrefs_accessibility.h,nsAccessibilityService.h,' $f
  elif [ -z $usesA11yPref ] && [ $hasA11yInclude ]; then
    sed -i '/"mozilla.StaticPrefs_accessibility.h"/d' $f
  elif [ $usesA11yPref ] && [ -z $hasA11yInclude ]; then
    sed -i '/"mozilla.StaticPrefs_accessibility.h"/a#include "nsAccessibilityService.h"' $f
  fi
done
```

Differential Revision: https://phabricator.services.mozilla.com/D177722
2023-05-19 02:56:48 +00:00
Iulian Moraru
c122c41577 Backed out 2 changesets (bug 1825693) for causing reftest failures related to ContentCache::Selection. CLOSED TREE
Backed out changeset 6a854fc8f509 (bug 1825693)
Backed out changeset f0646a32d694 (bug 1825693)
2023-05-19 04:15:46 +03:00
Masayuki Nakano
dfc755850d Bug 1825693 - Make ContentCache stop assigning invalid data r=m_kato,nika
There are some crash reports crashed in TSF module which may be caused by
passing invalid selection range (e.g., out of bounds of text).  However,
the cache is created in the child process and that causes the invalid cache
creation does not appear in the crash reports.  Therefore, let's try to
crash as soon as possible if `ContentCache` has invalid data.

Note that this does not detect all of the invalid cases because it's hard to
(re-)understand the edge cases.  Therefore, this tries to detect the cases
checked in `ContentCacheInParent::HandleQueryContentEvent` (*1) and some other
obvious odd cases.

1. https://searchfox.org/mozilla-central/rev/0ffaecaa075887ab07bf4c607c61ea2faa81b172/widget/ContentCache.cpp#776-778

Differential Revision: https://phabricator.services.mozilla.com/D176747
2023-05-18 23:56:06 +00:00
Edgar Chen
26bd98cff3 Bug 1832701 - Part 1: Rename IPCDataTransfer* to IPCTransferable*; r=nika
Since IPCDataTransfer* is actually used for nsITransferable, so rename them to
IPCTransferable* as follows,
- Rename IPCDataTransfer to IPCTransferableData.
- Rename IPCDataTransferItem to IPCTransferableDataItem.
- Rename IPCDataTransferData to IPCTransferableDataType.
- Rename IPCDataTransferString to IPCTransferableDataString.
- Rename IPCDataTransferCString to IPCTransferableDataCString.
- Rename IPCDataTransferInputStream to IPCTransferableDataInputStream.
- Rename IPCDataTransferImageContainer to IPCTransferableDataImageContainer.
- Rename IPCDataTransferBlob to IPCTransferableDataBlob.

Differential Revision: https://phabricator.services.mozilla.com/D178069
2023-05-16 21:25:37 +00:00
Iulian Moraru
020a15b35d Backed out 2 changesets (bug 1832701) for causing bc failures on browser_test_clipboardcache.js. CLOSED TREE
Backed out changeset 888814f19788 (bug 1832701)
Backed out changeset 1946d69582b0 (bug 1832701)
2023-05-16 15:54:58 +03:00
Edgar Chen
87ed98a471 Bug 1832701 - Part 1: Rename IPCDataTransfer* to IPCTransferable*; r=nika
Since IPCDataTransfer* is actually used for nsITransferable, so rename them to
IPCTransferable* as follows,
- Rename IPCDataTransfer to IPCTransferableData.
- Rename IPCDataTransferItem to IPCTransferableDataItem.
- Rename IPCDataTransferData to IPCTransferableDataType.
- Rename IPCDataTransferString to IPCTransferableDataString.
- Rename IPCDataTransferCString to IPCTransferableDataCString.
- Rename IPCDataTransferInputStream to IPCTransferableDataInputStream.
- Rename IPCDataTransferImageContainer to IPCTransferableDataImageContainer.
- Rename IPCDataTransferBlob to IPCTransferableDataBlob.

Differential Revision: https://phabricator.services.mozilla.com/D178069
2023-05-16 10:51:13 +00:00
Noemi Erli
84665092bc Backed out changeset 4f6d49b8d207 (bug 1825693) for ContentCache crashes 2023-05-16 00:29:31 +03:00
Masayuki Nakano
5902d34aee Bug 1825693 - Make ContentCache stop assigning invalid data r=m_kato,nika
There are some crash reports crashed in TSF module which may be caused by
passing invalid selection range (e.g., out of bounds of text).  However,
the cache is created in the child process and that causes the invalid cache
creation does not appear in the crash reports.  Therefore, let's try to
crash as soon as possible if `ContentCache` has invalid data.

Note that this does not detect all of the invalid cases because it's hard to
(re-)understand the edge cases.  Therefore, this tries to detect the cases
checked in `ContentCacheInParent::HandleQueryContentEvent` (*1) and some other
obvious odd cases.

1. https://searchfox.org/mozilla-central/rev/0ffaecaa075887ab07bf4c607c61ea2faa81b172/widget/ContentCache.cpp#776-778

Differential Revision: https://phabricator.services.mozilla.com/D176747
2023-05-15 02:01:06 +00:00
Nika Layzell
1f736b7027 Bug 1814686 - Part 2: Make nsDocShellLoadState not-null, and simplify handling of nsDOMNavigationTiming, r=necko-reviewers,valentin,smaug
These types were already non-nullable, with the serializer implementation not
supporting nullptr values. This patch converts the uses to be explicitly
non-nullable, and adds the relevant `WrapNotNull` changes.

Differential Revision: https://phabricator.services.mozilla.com/D168890
2023-03-20 15:40:38 +00:00
Iulian Moraru
0c8d23ecea Backed out 14 changesets (bug 1607634, bug 1814683, bug 1815177, bug 1814686) for causing build bustages on MaybeStorageBase. CLOSED TREE
Backed out changeset ae1c0551cea5 (bug 1815177)
Backed out changeset a11cafaa1884 (bug 1814686)
Backed out changeset 621507521762 (bug 1814686)
Backed out changeset ad692c73e381 (bug 1814686)
Backed out changeset 3be031e503dc (bug 1607634)
Backed out changeset aebbaa145d2d (bug 1607634)
Backed out changeset 9aa1f346fe14 (bug 1607634)
Backed out changeset e3eb77ad55ca (bug 1607634)
Backed out changeset e60591e5d5cf (bug 1607634)
Backed out changeset 6e43042d204a (bug 1814683)
Backed out changeset 1706e88652d6 (bug 1814683)
Backed out changeset 6878a1590e91 (bug 1814683)
Backed out changeset b1c980c834d8 (bug 1814683)
Backed out changeset 94480b82d102 (bug 1814683)
2023-03-15 01:58:36 +02:00
Nika Layzell
4c261fb18c Bug 1814686 - Part 2: Make nsDocShellLoadState not-null, and simplify handling of nsDOMNavigationTiming, r=necko-reviewers,valentin,smaug
These types were already non-nullable, with the serializer implementation not
supporting nullptr values. This patch converts the uses to be explicitly
non-nullable, and adds the relevant `WrapNotNull` changes.

Differential Revision: https://phabricator.services.mozilla.com/D168890
2023-03-14 19:31:42 +00:00
Ray Kraesig
1b07ab5c30 Bug 1816740 [6/6] - remove ManualDealloc from ColorPicker and FilePicker r=ipc-reviewers,nika
The existing manual-deallocation code isn't actually doing anything
interesting. Strip it out.

(No functional changes.)

Differential Revision: https://phabricator.services.mozilla.com/D169855
2023-02-22 21:05:25 +00:00
Ray Kraesig
eb8a5041cb Bug 1816740 [4/6] - convert nsIFilePicker::mode* into a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
Convert the various mode* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.

Differential Revision: https://phabricator.services.mozilla.com/D169853
2023-02-22 21:05:24 +00:00
Edgar Chen
fa0263159b Bug 1809122 - Track top-level window context in DragSession; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D169121
2023-02-13 18:44:04 +00:00
Artur Iunusov
c7e9e19333 Bug 1711740 - Consider interrupting JS to unload layers, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D167026
2023-02-04 19:07:55 +00:00
Emilio Cobos Álvarez
12891350ea Bug 1813148 - Don't return already_AddRefed in nsPresContext::GetRootWidget. r=dholbert
Let the caller addref it if needed.

I wrote this because I wanted to make some code dealing with it
thread-safe, but I ended up writing a less sketchy solution. However I
still think this is worth it.

It seems this only returns an already_AddRefed because before it used to
be an XPCOM-ish thing where the widget was returned as an out-param.

For now it doesn't change behavior but there are some callers that would
benefit from having less addref/release calls if they only need to read
simple stuff from the widget.

Differential Revision: https://phabricator.services.mozilla.com/D168141
2023-01-27 19:50:59 +00:00
Jens Stutte
55f1e9e0ff Bug 1809134 - Ensure we get ContentChild::NotifiedImpendingShutdown before (the last) BrowserChild::RecvDestroy. r=smaug
For normal (desktop) fission, we add NotifyImpendingShutdown before we notify destroy to the browser if we know a content process will go away both during normal operations and when the parent shuts down.
For e10s and Android we can only add NotifyImpendingShutdown when the parent process is shutting down, as they use a different keep alive logic that is hard to anticipate.

Differential Revision: https://phabricator.services.mozilla.com/D166303
2023-01-25 20:15:12 +00:00
Sandor Molnar
04d6dd612e Backed out changeset 2a9e0f5c854d (bug 1809134) for causing assertion failures in ContentParent.cpp CLOSED TREE 2023-01-16 23:17:10 +02:00
Jens Stutte
130784af92 Bug 1809134 - Ensure we get ContentChild::NotifiedImpendingShutdown before (the last) BrowserChild::RecvDestroy. r=smaug
For normal (desktop) fission, we add NotifyImpendingShutdown before we notify destroy to the browser if we know a content process will go away both during normal operations and when the parent shuts down.
For e10s and Android we can only add NotifyImpendingShutdown when the parent process is shutting down, as they use a different keep alive logic that is hard to anticipate.

Differential Revision: https://phabricator.services.mozilla.com/D166303
2023-01-16 19:39:14 +00:00
Iulian Moraru
e81e043fc3 Backed out changeset 4130ec388aeb (bug 1809134) for causing geckoview-junit failures. CLOSED TREE 2023-01-11 19:28:05 +02:00
Jens Stutte
6f6f698f36 Bug 1809134 - Ensure we get ContentChild::NotifiedImpendingShutdown before (the last) BrowserChild::RecvDestroy. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D166303
2023-01-11 15:46:28 +00:00
Norisz Fay
c70c0da4cc Backed out changeset 6729683a006a (bug 1809134) for causing storage related failures CLOSED TREE 2023-01-10 18:07:27 +02:00
Jens Stutte
8a0a2a73f9 Bug 1809134 - Ensure we get ContentChild::NotifiedImpendingShutdown before (the last) BrowserChild::RecvDestroy. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D166303
2023-01-10 14:31:04 +00:00
Matthias Camenzind
90f82e886d Bug 1786048 - Part 4: Remove cross process SizeShellTo. r=emilio
Because the parent process lacks information about the current shell
size, the child has to send both the current and the new shell size to
the parent. The parent then applies the delta to the window size. This
can produce different results for calls with the same arguments,
whenever a previous call did not have enough time to update the child
with its new size.

The implementation is replaced by applying the delta in the child.

Differential Revision: https://phabricator.services.mozilla.com/D160261
2022-12-15 23:13:01 +00:00
Matthias Camenzind
d634177ee2 Bug 1786048 - Part 3: Merge nsIEmbeddingSiteWindow into nsIBaseWindow. r=emilio
Implementations of nsIEmbeddingSiteWindow and nsIBaseWindow largely
overlap, and where they don't, the nsIEmbeddingSiteWindow implementation
of the otherwise shared interface is primarily stubbed out with the
exception of Get/SetDimensions().

This patch moves a reimplementation of Get/SetDimensions() from
nsIEmbeddingSiteWindow to nsIBaseWindow. The other methods of
nsIEmbeddingSiteWindow remain covered by nsIBaseWindow.
Get/SetDimensions() can be implemented as part of nsIWebBrowserChrome
where nsIBaseWindow is not necessary. This removes the need for
nsIEmbeddingSiteWindow.

Blur() has also been moved to nsIWebBrowserChrome, as only
nsContentTreeOwner has an actual implementation which we in theory also
want to call from BrowserChild/Parent, but the spec suggests to
"selectively or uniformly ignore calls".

GetVisibility() had an implementation in BrowserChild that pretended to
always be visible. Instead of providing an interface for that,
nsDocShell now handles the not implemented case for tree owners.

nsIEmbeddingSiteWindow::GetSiteWindow() used to call through to
nsIBaseWindow::GetParentNativeWindow().

The Get/SetDimensions() implementation has been replaced with a strongly
typed setter, which is now also used directly from nsGlobalWindowOuter
to avoid problems that come with autodetecting unchanged dimensions,
when the current dimensions are outdated (e.g. immediately reverting a
change can be ignored).

Differential Revision: https://phabricator.services.mozilla.com/D160260
2022-12-15 23:13:00 +00:00
Matthias Camenzind
9514738e64 Bug 1786048 - Part 1: AppWindow can't skip SetSize calls, HeadlessWidget has to notify when moved. r=emilio
Two minor changes that otherwise might go unnoticed in the following
parts:

- AppWindow can't skip SetSize calls that match the current size. On
  Linux a previous call might not have changed the size yet. If the
  current call is skipped, the previous call can ultimately dictate the
  resulting size.

- BrowserParent should not have to call UpdatePosition when receiving
  new dimensions from BrowserChild. But HeadlessWidget needs to call
  NotifyWindowMoved when moved.

Differential Revision: https://phabricator.services.mozilla.com/D160259
2022-12-15 23:12:59 +00:00
Tom Schuster
cdeab032f9 Bug 960984 - Implement the list attribute for <input type=color>. r=emilio,geckoview-reviewers,m_kato
UI support on Windows and Linux. macOS and Android are not supported.

Differential Revision: https://phabricator.services.mozilla.com/D163796
2022-12-14 18:17:59 +00:00
Sandor Molnar
e73ab8eb7e Backed out 4 changesets (bug 1786048) for causing multiple failures. CLOSED TREE
Backed out changeset ae94135e68ef (bug 1786048)
Backed out changeset f505df8a481a (bug 1786048)
Backed out changeset 999a18d6f33e (bug 1786048)
Backed out changeset e71e8644b8a9 (bug 1786048)
2022-12-02 20:30:07 +02:00
Matthias Camenzind
42a5ca53d5 Bug 1786048 - Part 4: Remove cross process SizeShellTo. r=emilio
Because the parent process lacks information about the current shell
size, the child has to send both the current and the new shell size to
the parent. The parent then applies the delta to the window size. This
can produce different results for calls with the same arguments,
whenever a previous call did not have enough time to update the child
with its new size.

The implementation is replaced by applying the delta in the child.

Differential Revision: https://phabricator.services.mozilla.com/D160261
2022-12-02 16:47:46 +00:00
Matthias Camenzind
4e55c203ac Bug 1786048 - Part 3: Merge nsIEmbeddingSiteWindow into nsIBaseWindow. r=emilio
Implementations of nsIEmbeddingSiteWindow and nsIBaseWindow largely
overlap, and where they don't, the nsIEmbeddingSiteWindow implementation
of the otherwise shared interface is primarily stubbed out with the
exception of Get/SetDimensions().

This patch moves a reimplementation of Get/SetDimensions() from
nsIEmbeddingSiteWindow to nsIBaseWindow. The other methods of
nsIEmbeddingSiteWindow remain covered by nsIBaseWindow.
Get/SetDimensions() can be implemented as part of nsIWebBrowserChrome
where nsIBaseWindow is not necessary. This removes the need for
nsIEmbeddingSiteWindow.

Blur() has also been moved to nsIWebBrowserChrome, as only
nsContentTreeOwner has an actual implementation which we in theory also
want to call from BrowserChild/Parent, but the spec suggests to
"selectively or uniformly ignore calls".

GetVisibility() had an implementation in BrowserChild that pretended to
always be visible. Instead of providing an interface for that,
nsDocShell now handles the not implemented case for tree owners.

nsIEmbeddingSiteWindow::GetSiteWindow() used to call through to
nsIBaseWindow::GetParentNativeWindow().

The Get/SetDimensions() implementation has been replaced with a strongly
typed setter, which is now also used directly from nsGlobalWindowOuter
to avoid problems that come with autodetecting unchanged dimensions,
when the current dimensions are outdated (e.g. immediately reverting a
change can be ignored).

Differential Revision: https://phabricator.services.mozilla.com/D160260
2022-12-02 16:47:46 +00:00
Matthias Camenzind
bc663051ab Bug 1786048 - Part 1: AppWindow can't skip SetSize calls, HeadlessWidget has to notify when moved. r=emilio
Two minor changes that otherwise might go unnoticed in the following
parts:

- AppWindow can't skip SetSize calls that match the current size. On
  Linux a previous call might not have changed the size yet. If the
  current call is skipped, the previous call can ultimately dictate the
  resulting size.

- BrowserParent should not have to call UpdatePosition when receiving
  new dimensions from BrowserChild. But HeadlessWidget needs to call
  NotifyWindowMoved when moved. HeadlessWidget no longer stays in
  "maximized" size mode after being resized or moved.

Differential Revision: https://phabricator.services.mozilla.com/D160259
2022-12-02 16:47:45 +00:00
Sebastian Hengst
a8f9da04ba Backed out changeset 238b73822db1 (bug 1802040) by Jamie because the patch didn't fix the issue 2022-12-02 15:20:47 +01:00
Marian-Vasile Laza
dd80667326 Backed out 4 changesets (bug 1786048) for causing bc failures on browser_modal_resize.js. CLOSED TREE
Backed out changeset 318a2d2e6e39 (bug 1786048)
Backed out changeset 17a9990d6d19 (bug 1786048)
Backed out changeset 205f129c648a (bug 1786048)
Backed out changeset 0750c885a688 (bug 1786048)
2022-12-01 05:00:38 +02:00
Matthias Camenzind
2132a09967 Bug 1786048 - Part 4: Remove cross process SizeShellTo. r=emilio
Because the parent process lacks information about the current shell
size, the child has to send both the current and the new shell size to
the parent. The parent then applies the delta to the window size. This
can produce different results for calls with the same arguments,
whenever a previous call did not have enough time to update the child
with its new size.

The implementation is replaced by applying the delta in the child.

Differential Revision: https://phabricator.services.mozilla.com/D160261
2022-11-30 19:37:17 +00:00
Matthias Camenzind
77a12929ca Bug 1786048 - Part 3: Merge nsIEmbeddingSiteWindow into nsIBaseWindow. r=emilio
Implementations of nsIEmbeddingSiteWindow and nsIBaseWindow largely
overlap, and where they don't, the nsIEmbeddingSiteWindow implementation
of the otherwise shared interface is primarily stubbed out with the
exception of Get/SetDimensions().

This patch moves a reimplementation of Get/SetDimensions() from
nsIEmbeddingSiteWindow to nsIBaseWindow. The other methods of
nsIEmbeddingSiteWindow remain covered by nsIBaseWindow.
Get/SetDimensions() can be implemented as part of nsIWebBrowserChrome
where nsIBaseWindow is not necessary. This removes the need for
nsIEmbeddingSiteWindow.

Blur() has also been moved to nsIWebBrowserChrome, as only
nsContentTreeOwner has an actual implementation which we in theory also
want to call from BrowserChild/Parent, but the spec suggests to
"selectively or uniformly ignore calls".

GetVisibility() had an implementation in BrowserChild that pretended to
always be visible. Instead of providing an interface for that,
nsDocShell now handles the not implemented case for tree owners.

nsIEmbeddingSiteWindow::GetSiteWindow() used to call through to
nsIBaseWindow::GetParentNativeWindow().

The Get/SetDimensions() implementation has been replaced with a strongly
typed setter, which is now also used directly from nsGlobalWindowOuter
to avoid problems that come with autodetecting unchanged dimensions,
when the current dimensions are outdated (e.g. immediately reverting a
change can be ignored).

Differential Revision: https://phabricator.services.mozilla.com/D160260
2022-11-30 19:37:16 +00:00
Matthias Camenzind
bba6a42299 Bug 1786048 - Part 1: AppWindow can't skip SetSize calls, HeadlessWidget has to notify when moved. r=emilio
Two minor changes that otherwise might go unnoticed in the following
parts:

- AppWindow can't skip SetSize calls that match the current size. On
  Linux a previous call might not have changed the size yet. If the
  current call is skipped, the previous call can ultimately dictate the
  resulting size.

- BrowserParent should not have to call UpdatePosition when receiving
  new dimensions from BrowserChild. But HeadlessWidget needs to call
  NotifyWindowMoved when moved. HeadlessWidget no longer stays in
  "maximized" size mode after being resized or moved.

Differential Revision: https://phabricator.services.mozilla.com/D160259
2022-11-30 19:37:15 +00:00
James Teh
7565289471 Bug 1802040: Fix cleanup of DocAccessibleParent on Android. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D163260
2022-11-28 19:59:38 +00:00
Emilio Cobos Álvarez
f58483a72d Bug 1798213 - For widget-less pages keep defaulting to primary screen scale factor. r=tnikkel,layout-reviewers,extension-reviewers,robwu
This restores the previous behavior in a somewhat more principled way.

The extensions code is still broken in multi-monitor cases, but that's a
more complicated fix.

Differential Revision: https://phabricator.services.mozilla.com/D161997
2022-11-16 15:52:07 +00:00