739 Commits

Author SHA1 Message Date
Hiroyuki Ikezoe
f89be3e0e6 Bug 1715179 - Propagate VisualViewport rect and the root scrollable rect and use them on the main-thread. r=botond
Depends on D186323

Differential Revision: https://phabricator.services.mozilla.com/D186324
2023-12-04 09:31:22 +00:00
Stanca Serban
2b58cc84d0 Backed out 5 changesets (bug 1715179) for causing mochitests failures in test_group_double_tap_zoom-2.html. CLOSED TREE
Backed out changeset 600afc2dc0ca (bug 1715179)
Backed out changeset 75c2c7f6230e (bug 1715179)
Backed out changeset b851e0aff383 (bug 1715179)
Backed out changeset 0acfcbbdf460 (bug 1715179)
Backed out changeset b0c83c964ccf (bug 1715179)
2023-11-28 18:45:32 +02:00
Hiroyuki Ikezoe
b2f944eea1 Bug 1715179 - Propagate VisualViewport rect and the root scrollable rect and use them on the main-thread. r=botond
Depends on D186323

Differential Revision: https://phabricator.services.mozilla.com/D186324
2023-11-28 09:42:21 +00:00
Tom Schuster
864f258ff2 Bug 1847990 - Canvas fingerprinting telemetry. r=timhuang,anti-tracking-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189111
2023-11-13 10:05:22 +00:00
Gijs Kruitbosch
f398697431 Bug 1855992 - remove about: specialcase from principal validation in BrowserParent, r=nika,necko-reviewers,jesup,perftest-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189923
2023-11-07 11:34:42 +00:00
Sandor Molnar
2b95800b49 Backed out 2 changesets (bug 1855992) for causing talos failures @ mozilla::net::nsAboutProtocolHandler::NewChannel CLOSED TREE
Backed out changeset f287e725a845 (bug 1855992)
Backed out changeset 81236027b7dc (bug 1855992)
2023-11-03 00:02:09 +02:00
Gijs Kruitbosch
12d0193d1a Bug 1855992 - remove about: specialcase from principal validation in BrowserParent, r=nika,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D189923
2023-11-02 17:41:17 +00:00
Cristina Horotan
2842815eee Backed out 2 changesets (bug 1855992) for causing assertion failures at ContentParent.cpp CLOSED TREE
Backed out changeset 794155e516b3 (bug 1855992)
Backed out changeset 5489de5365fe (bug 1855992)
2023-10-31 12:19:43 +02:00
Gijs Kruitbosch
ed63da3d0b Bug 1855992 - remove about: specialcase from principal validation in BrowserParent, r=nika,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D189923
2023-10-31 09:11:30 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Emilio Cobos Álvarez
a749941c2f Bug 1854092 - Don't clear cursor if not over the relevant document. r=saschanaz,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D188709
2023-09-21 09:54:40 +00:00
Emilio Cobos Álvarez
1a7924d367 Bug 1848357 - Remove PaintWhileInterruptingJSNoOp(). r=mconley
This should not be needed anymore. We no longer need to "ack" an epoch,
since there's no epoch.

Make the logic to trigger a paint and request composite a bit more
generic. That doesn't change behavior right now, because our visibility
state is tied to mRenderLayers, but without this change setting
renderLayers = true on a display: none iframe will trigger a useless
paint after bug 1847584.

Differential Revision: https://phabricator.services.mozilla.com/D187293
2023-09-02 07:09:01 +00:00
Emilio Cobos Álvarez
c7d8e549f3 Bug 1848357 - Cleanup layer observer handling. r=mconley,gfx-reviewers,bradwerth
This seems to work, and turns out I need to fix this before bug 1847584,
because the epoch handling breaks with those patches in the case
customize mode sets display: none on browser elements.

Instead of dealing with epochs, just always report the last "has layers"
state to BrowserParent. This is both simpler and more reliable (there
were a couple hacks in WebRenderBridgeParent to make sure we notified
even though a transaction failed).

AsyncTabSwitcher pretty much already deals with this correctly because
it already needs to deal with browsers that already have layers, we only
had to loosen some assertions for potentially previous messages which
are fine.

Differential Revision: https://phabricator.services.mozilla.com/D187203
2023-09-01 17:09:27 +00:00
James Teh
65baf08086 Bug 1831035 part 7: Remove (now empty) platform specific RemoteAccessible classes and rename RemoteAccessibleBase to RemoteAccessible. r=eeejay
This involved moving ApplyCache from the .h into the .cpp because now that the class is no longer a template, forward declaration of DocAccessibleParent is not sufficient.

Differential Revision: https://phabricator.services.mozilla.com/D181852
2023-06-26 21:20:13 +00:00
Jens Stutte
7cec61174b Bug 1838779 - Overhaul the thread safety and synchronization of our keepalive checks. r=dom-worker-reviewers,asuth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D180958
2023-06-21 16:47:08 +00:00
Cristina Horotan
6cebdf340e Backed out changeset 81e6aadf9911 (bug 1838779) for causing build bustage at ContentParent.cpp 2023-06-21 18:57:32 +03:00
Jens Stutte
1b941ff78d Bug 1838779 - Overhaul the thread safety and synchronization of our keepalive checks. r=dom-worker-reviewers,asuth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D180958
2023-06-21 14:59:10 +00:00
Narcis Beleuzu
1007999d21 Backed out changeset cc655f99b353 (bug 1838779) for bc failure on RecursiveMutex.cpp 2023-06-21 14:14:59 +03:00
Jens Stutte
6c0e934344 Bug 1838779 - Overhaul the thread safety and synchronization of our keepalive checks. r=dom-worker-reviewers,asuth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D180958
2023-06-21 09:17:18 +00:00
Edgar Chen
e6d575b5d9 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
482090a387 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
828d108d6f 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
cb321ed332 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
b91f473221 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
b2e57090e9 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
4c5f7cf636 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
3a786da831 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
a3dc24d5ea 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
a3f5b3838c 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
6e16770381 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
b7670454fd 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
5183cb7125 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
645bd13854 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
a6448bb218 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
5bd3109c7d 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
bc9ede8f91 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
50a7356c9e 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
71d235742a Backed out changeset 4f6d49b8d207 (bug 1825693) for ContentCache crashes 2023-05-16 00:29:31 +03:00
Masayuki Nakano
f9157293e3 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
f686782a80 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
801dae8f2c 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
99ef2e2b47 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
771bdc853e 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
fa4832237d 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
60b2a99aab 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
e62ca4e480 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
61b953b167 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
a18102714d 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