Commit Graph

663 Commits

Author SHA1 Message Date
David P
e844cdeed5 Bug 1893119: Part 21 - Separate nsIDragService and nsIDragSession implementations r=gstoll,geckoview-reviewers,rkraesig,win-reviewers,m_kato
Split the class inheritance trees for nsIDragService and nsIDragSession.
Remember that, before the start of this patch series, the inheritance
diagram was:

nsDragService -> nsBaseDragService -> nsIDragService + nsIDragSession

and the only instance was a singleton.  We switched it to:

nsDragService -> nsDragSession -> nsBaseDragService -> nsIDragService + nsBaseDragSession -> nsIDragSession

and maintained the singleton.  This allowed us to allow us to move things to
the new classes without breaking behavior.  We are done with that,
so we can now change the inheritance to its final form:

nsDragService -> nsBaseDragService -> nsIDragService

nsDragSession -> nsBaseDragSession -> nsIDragSession

Of course, we also need to properly construct and release the
nsIDragSessions (formerly part of the singleton), so that is done here as
well.  That happens in nsBaseDrag[Service|Session] for parent process drags
and in nsDrag[Service|Session]Proxy for content.  This is all fairly
straightforward, except in the case of gtk, where we need to change
some callback behavior.

Differential Revision: https://phabricator.services.mozilla.com/D211084
2024-07-04 07:48:11 +00:00
David P
5c77b63f65 Bug 1893119: Part 20 - Move EndDragSession from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
This is a straightforward move.  It does take the liberty of breaking out an
EndDragSessionImpl method, which will be needed later.

Differential Revision: https://phabricator.services.mozilla.com/D211083
2024-07-04 07:48:11 +00:00
David P
19861d5e8d Bug 1893119: Part 17 - Pass the widget to StartDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211080
2024-07-04 07:48:10 +00:00
David P
c32e8a504a Bug 1893119: Part 16 - Make nsBaseDragService weakly remember PBrowsers instead of PContents r=nika,win-reviewers,rkraesig
nsBaseDragService keeps track of the processes that might need to cancel a drag with EndDragSession and this is technically correct since the drag session is a singleton in the child process, but this series of patches changes those sessions to be per-PuppetWidget/BrowserChild.  This allows content processes to distinguish which of its browsers is engaged in a drag.

Differential Revision: https://phabricator.services.mozilla.com/D211062
2024-07-04 07:48:09 +00:00
David Parks
88e30b7141 Bug 1893119: Part 13 - Move FireDragEventAtSource from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211077
2024-07-04 07:48:08 +00:00
David P
805b8742ba Bug 1893119: Part 3 - Add widget to nsContentUtils::GetDragSession r=gstoll,rkraesig
Updates each client of the nsContentUtils method to get the right drag session -- the one for the widget that is currently the source or target of the drag session.
The change to nsDOMWindowUtils::DispatchDOMEventViaPresShellForTesting() supports the change to WidgetDragEvent::InitDropEffectForTests() and enabled a
large number of test fixes in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D211067
2024-07-04 07:48:04 +00:00
Masayuki Nakano
b3c5045ec1 Bug 1675847 - part 5: Make contextmenu event dispatchers use WidgetPointerEvent or PointerEvent r=smaug,pip-reviewers,devtools-reviewers,nchevobbe,mconley
`eContextMenu` event may be fired from `widget`.  Therefore, different from
`ePointerClick` and `ePointerAuxClick`, they may cross the process boundary,
may be handled by APZ and may be dispatched into the DOM after a delay.
Therefore, this patch is complicated than the previous patch.  This adds
* New IPC message handlers for sending/receiving a `WidgetPointerEvent`
* New `DelayedPointerEvent` class and templated `MouseInput::ToWidgetEvent`
* `PresShell::EventHandler` handles `eContextMenu` as same as `WidgetMouseEvent`

Differential Revision: https://phabricator.services.mozilla.com/D213003
2024-06-14 00:18:48 +00:00
Edgar Chen
d67110bf57 Bug 1743329 - Release pointer lock when xul popup is open; r=smaug,pbz
Differential Revision: https://phabricator.services.mozilla.com/D211620
2024-05-31 11:13:46 +00:00
Andrew McCreight
c1d7b2257a Bug 1899888 - Remove the frequent "Fallback to FallbackRenderer" warning. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D212186
2024-05-30 21:48:17 +00:00
Butkovits Atila
3a56b9800d Backed out 4 changesets (bug 1743329) for causing failures at browser_popupNotification_security_delay.js. CLOSED TREE
Backed out changeset 6d33ea38cd14 (bug 1743329)
Backed out changeset 0f9bffa357a5 (bug 1743329)
Backed out changeset cd96c48488eb (bug 1743329)
Backed out changeset 209a41c449e1 (bug 1743329)
2024-05-29 15:47:23 +03:00
Edgar Chen
625627d9e8 Bug 1743329 - Release pointer lock when xul popup is open; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211620
2024-05-29 07:50:20 +00:00
Masayuki Nakano
ab19f1368c Bug 1879765 - part 2: Make BrowserChild store the last code value of consumed eKeyDown event r=smaug
The builtin legacy IME of Windows to type a Unicode with typing a code point
causes consumed `eKeyDown` events while typing the code point, i.e., without
`eKeyPress` (FYI: The consumed state is not exposed to the web, it's used only
in chrome UI for the compatibility with Chrome).  Then, `BrowserChild` store
whether the last `eKeyDown` was consumed or not to prevent the following
`eKeyPress`.  Finally, a `eKeyPress` event is fired to input the Unicode
character after `eKeyUp` for `Alt`.  The stored value is set to new value only
when another `eKeyDown` event is sent from the parent process.  Therefore,
the last digit inputting `eKeyDown` causes `BrowserChild` thinking the last
`eKeyDown` is consumed so that the last `eKeyPress` is not dispatched.

This patch makes `BrowserChild` to store the `code` value of the last consumed
`eKeyDown` and check the `code` value to consider whether coming `eKeyPress`
should be or not be dispatched to `PresShell` and the DOM.

Differential Revision: https://phabricator.services.mozilla.com/D207957
2024-05-16 02:36:03 +00:00
Tamas Szentpeteri
26e6238bd3 Backed out 2 changesets (bug 1879765) for causing failures on test_nsITextInputProcessor.xhtml. CLOSED TREE
Backed out changeset 6214b15c2021 (bug 1879765)
Backed out changeset 87e77d284071 (bug 1879765)
2024-05-15 15:15:50 +03:00
Masayuki Nakano
cbc30f77ec Bug 1879765 - part 2: Make BrowserChild store the last code value of consumed eKeyDown event r=smaug
The builtin legacy IME of Windows to type a Unicode with typing a code point
causes consumed `eKeyDown` events while typing the code point, i.e., without
`eKeyPress` (FYI: The consumed state is not exposed to the web, it's used only
in chrome UI for the compatibility with Chrome).  Then, `BrowserChild` store
whether the last `eKeyDown` was consumed or not to prevent the following
`eKeyPress`.  Finally, a `eKeyPress` event is fired to input the Unicode
character after `eKeyUp` for `Alt`.  The stored value is set to new value only
when another `eKeyDown` event is sent from the parent process.  Therefore,
the last digit inputting `eKeyDown` causes `BrowserChild` thinking the last
`eKeyDown` is consumed so that the last `eKeyPress` is not dispatched.

This patch makes `BrowserChild` to store the `code` value of the last consumed
`eKeyDown` and check the `code` value to consider whether coming `eKeyPress`
should be or not be dispatched to `PresShell` and the DOM.

Differential Revision: https://phabricator.services.mozilla.com/D207957
2024-05-15 05:42:33 +00:00
Emilio Cobos Álvarez
a705793753 Bug 1895229 - Remove nsIWebBrowserChromeFocus. r=hsivonen,dom-core
It's only implemented by BrowserChild, we can do this more directly.

Differential Revision: https://phabricator.services.mozilla.com/D209534
2024-05-06 11:30:34 +00:00
Nika Layzell
715c98639b Bug 1875528 - Part 3: Remove unnecessary VsyncChild strong reference in BrowserChild, r=smaug
This reference created a cycle after the strong Manager() reference added in an earlier part.

With the reference removed, the VsyncChild will be kept alive via the IPC link
instead, and will be torn down when the IPDL actor is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D198626
2024-04-22 17:13:23 +00:00
Greg Stoll
1a4633232d Bug 1875481 - Part 3: Add content analysis support to printing operations r=handyman,spohl,fluent-reviewers,kpatenio,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200979
2024-04-10 00:15:47 +00:00
Stanca Serban
4c0f6b30c1 Backed out 3 changesets (bug 1875481) for basicWindowDotPrintTest related junit failures.
Backed out changeset cd024cb2768e (bug 1875481)
Backed out changeset 6b7be15cd017 (bug 1875481)
Backed out changeset d1da53c0673b (bug 1875481)
2024-04-09 05:56:47 +03:00
Greg Stoll
77cb63d2a3 Bug 1875481 - Part 3: Add content analysis support to printing operations r=handyman,spohl,fluent-reviewers,kpatenio,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200979
2024-04-08 23:53:58 +00:00
Peter Van der Beken
0cf1288004 Bug 1883278 - Force-enable platform collection code of session store when SHIP is enabled. r=farre,geckoview-reviewers,sessionstore-reviewers
If session history in the parent is enabled then session store only works
correctly if the platform collection code is turned on.

Differential Revision: https://phabricator.services.mozilla.com/D203375
2024-03-13 10:56:33 +00:00
Sean Feng
d7254ccf1b Bug 1483828 - [Part 1] Disallow <tab> to move focus to root element r=smaug
Brings us on-par with Chrome and Safari

Differential Revision: https://phabricator.services.mozilla.com/D198436
2024-03-04 14:16:30 +00:00
Gabriele Svelto
e1e9346196 Bug 1831092 - Use the new pull-based API for all crash annotations and remove the global annotations table r=jgilbert,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,padenot,handyman,afranchuk,valentin,alwu,sotaro
This changes comes with several different refactorings all rolled into one,
unfotunately I couldn't find a way to pull them apart:
- First of all annotations now can either recorded (that is, we copy the value
  and have the crash reporting code own the copy) or registered. Several
  annotations are changed to use this functionality so that we don't need to
  update them as their value change.
- The code in the exception handler is modified to read the annotations from
  the mozannotation_client crate. This has the unfortunate side-effect that
  we need three different bits of code to serialize them: one for annotations
  read from a child process, one for reading annotations from the main process
  outside of the exception handler and one for reading annotations from the
  main process within the exception handler. As we move to fully
  out-of-process crash reporting the last two methods will go away.
- The mozannotation_client crate now doesn't record annotation types anymore.
  I realized as I was working on this that storing types at runtime has two
  issues: the first one is that buggy code might change the type of an
  annotation (that is record it under two different types at two different
  moments), the second issue is that types might become corrupt during a
  crash, so better enforce them at annotation-writing time. The end result is
  that the mozannotation_* crates now only store byte buffers, track the
  format the data is stored in (null-terminated string, fixed size buffer,
  etc...) but not the type of data each annotation is supposed to contain.
- Which brings us to the next change: concrete types for annotations are now
  enforced when they're written out. If an annotation doesn't match the
  expected type it's skipped. Storing an annotation with the wrong type will
  also trigger an assertion in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D195248
2024-03-04 10:24:43 +00:00
Stanca Serban
6980988721 Backed out 6 changesets (bug 1875528) for causing leakcheck failures. CLOSED TREE
Backed out changeset dcbbb7316940 (bug 1875528)
Backed out changeset a5c0564f9761 (bug 1875528)
Backed out changeset f3bc6e972f79 (bug 1875528)
Backed out changeset 535378dd79b0 (bug 1875528)
Backed out changeset 3cef14ed0f25 (bug 1875528)
Backed out changeset f0941fdbbabb (bug 1875528)
2024-01-25 01:26:46 +02:00
Nika Layzell
1863636c52 Bug 1875528 - Part 3: Remove unnecessary VsyncChild strong reference in BrowserChild, r=smaug
This reference created a cycle after the strong Manager() reference added in an earlier part.

With the reference removed, the VsyncChild will be kept alive via the IPC link
instead, and will be torn down when the IPDL actor is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D198626
2024-01-24 20:54:40 +00:00
Tooru Fujisawa
36c7ec1d88 Bug 1873330 - Part 6: Reflect UserActivation::Modifiers to window.open location. r=smaug
Reflect modifiers to chromeFlags and nsIBrowserDOMWindow::OPEN_* location,
to perform the equivalent of BrowserUtils.whereToOpenLink in window.open with
modifier keys.

Differential Revision: https://phabricator.services.mozilla.com/D197864
2024-01-11 17:24:03 +00:00
Tooru Fujisawa
9fb2cbc815 Bug 1873330 - Part 5: Add UserActivation::Modifiers parameters for window.open-related functions. r=smaug
Pass UserActivation::Modifiers from nsGlobalWindowOuter::OpenInternal
to nsPIWindowWatcher.openWindowWithRemoteTab, through the following interfaces
and protocol:
  * nsPIWindowWatcher.openWindow2
  * nsIWindowProvider.provideWindow
  * PContent.CreateWindow or PContent.CreateWindowInDifferentProcess
  * nsPIWindowWatcher.openWindowWithRemoteTab

Differential Revision: https://phabricator.services.mozilla.com/D197863
2024-01-11 17:24:03 +00:00
Edgar Chen
3d56f815a9 Bug 1833172 - Remove unused data from PasteTransferable IPC; r=masayuki
The PasteTransferable IPC is used for sending the nsITransferable in paste
command to content process. And the nsITransferable in paste command is from
 - https://searchfox.org/mozilla-central/rev/eb07633057d66ab25f9db4c5900eeb6913da7579/widget/android/GeckoEditableSupport.cpp#1685
 - https://searchfox.org/mozilla-central/rev/eb07633057d66ab25f9db4c5900eeb6913da7579/widget/cocoa/nsChildView.mm#4528
 - or from nsIDOMWindowUtils::sendContentCommandEvent which is used for tests.

None of them have valid requesting principal and content policy type set.

Differential Revision: https://phabricator.services.mozilla.com/D195948
2023-12-20 13:18:23 +00:00
Randell Jesup
2fece2d0d8 Bug 1847298: IPC constructor cleanup r=nika,padenot,dom-storage-reviewers,necko-reviewers,cookie-reviewers,asuth,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D185472
2023-12-08 15:56:39 +00:00
Hiroyuki Ikezoe
ad709bfe9d 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
358a6e26a0 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
6017e8b01f 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
Jonathan Watt
61ff6ba12e Bug 1866011 p2. Rename nsIDocShell.contentViewer. r=emilio,credential-management-reviewers,devtools-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D194370
2023-11-24 09:10:52 +00:00
Jonathan Watt
839fe1be5d Bug 1865995 p6. Rename createAboutBlankContentViewer to match nsIDocumentViewer's new name. r=emilio,webdriver-reviewers,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D194340
2023-11-23 21:35:21 +00:00
Kagami Sascha Rosylight
c1e45850a8 Bug 1862244 - Add GlobalTeardownHelper r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D193295
2023-11-23 17:17:39 +00:00
Jonathan Watt
efb5a74fbc Bug 1865480. Rename nsIContentViewer to nsIDocumentViewer. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D193987
2023-11-21 12:45:59 +00:00
Tom Schuster
b69f140767 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
Adam Brouwers-Harries
4a2ba69cbc Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-24 15:18:12 +00:00
Narcis Beleuzu
67b61b8b2c Backed out changeset 714aaf6484fb (bug 1421651) for causing Bug 1860719. CLOSED TREE 2023-10-24 17:31:02 +03:00
Adam Brouwers-Harries
720e582a3a Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-23 13:55:50 +00:00
Emilio Cobos Álvarez
d02e297b2d Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Dan Robertson
a62cae6009 Bug 1856716 - Ensure that we hold a strong reference to the APZ event state. r=hiro
- Ensure that we hold a strong reference to the APZ event state before
   calling ProcessSingleTap, as ProcessSingleTap fires events.
 - Mark ProcessSingleTap as MOZ_CAN_RUN_SCRIPT since it can fire events.

Differential Revision: https://phabricator.services.mozilla.com/D190228
2023-10-05 22:34:32 +00:00
Dan Robertson
88fcf3a2f7 Bug 1816473 - Do not delay dispatching synthesized mouse events. r=botond,edgar
Do not delay dispatching synthesized mouse events for a single tap
gesture.

Differential Revision: https://phabricator.services.mozilla.com/D184051
2023-09-25 19:13:07 +00:00
Emilio Cobos Álvarez
93252b3465 Bug 1847584 - Account for IsUnderHiddenEmbedderElement() for BrowserChild visibility. r=smaug
Test by Gijs. Note that I removed the .isActive assertion, because this doesn't
affect activeness.

We could make that change too, but that's a bigger change, and I think we want
to do this regardless.

The CAN_RUN_SCRIPT annotations are obsolete (they come from bug 1582042
which directly fired docshell activity events, but that's not true
anymore, bug 1635914 changed the setup a bit later).

Differential Revision: https://phabricator.services.mozilla.com/D185643
2023-09-05 16:13:00 +00:00
Emilio Cobos Álvarez
f589903d08 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
afarwees
1168c2c194 Bug 1850608 BrowserChild::NotifyAPZStateChange updated have a void return type. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D187248
2023-09-02 00:58:07 +00:00
Emilio Cobos Álvarez
11692470d4 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
Stanca Serban
3fdab1cbc9 Backed out 2 changesets (bug 1816473) for causing Android junit failures. CLOSED TREE
Backed out changeset eccf1dcce67f (bug 1816473)
Backed out changeset e974d872becd (bug 1816473)
2023-08-30 18:42:40 +03:00
Dan Robertson
7cc1ade4d6 Bug 1816473 - Do not delay dispatching synthesized mouse events. r=botond,edgar
Do not delay dispatching synthesized mouse events for a single tap
gesture.

Differential Revision: https://phabricator.services.mozilla.com/D184051
2023-08-30 12:49:22 +00:00
Cristian Tuns
58e4ef4e8e Backed out changeset a741e0bcdca4 (bug 1847584) for causing bc failures in browser_reload_tab.js CLOSED TREE 2023-08-18 14:24:03 -04:00
Emilio Cobos Álvarez
91faba9e00 Bug 1847584 - Account for IsUnderHiddenEmbedderElement() for BrowserChild visibility. r=smaug
Test by Gijs. Note that I removed the .isActive assertion, because this doesn't
affect activeness.

We could make that change too, but that's a bigger change, and I think we want
to do this regardless.

The CAN_RUN_SCRIPT annotations are obsolete (they come from bug 1582042
which directly fired docshell activity events, but that's not true
anymore, bug 1635914 changed the setup a bit later).

Differential Revision: https://phabricator.services.mozilla.com/D185643
2023-08-18 16:17:31 +00:00