commit 8ef7a8ef4aa279c5f82cf11a97506e2691f23d52
parent 416277b531877114294b5de850af2daf1d89b96e
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Wed, 5 Nov 2025 19:52:44 +0000
Bug 1998057 - Don't synchronously call into script for autoscroll cancellation. r=botond
It runs script at a time when APZ holds locks. It seems notifying this
through the event loop shouldn't cause any adverse effect (and in fact
is already the case for the GPU process).
Re-enable a test that was recently disabled which I'm pretty sure was
just hitting this.
Differential Revision: https://phabricator.services.mozilla.com/D271236
Diffstat:
3 files changed, 6 insertions(+), 20 deletions(-)
diff --git a/gfx/layers/apz/util/ChromeProcessController.cpp b/gfx/layers/apz/util/ChromeProcessController.cpp
@@ -341,14 +341,9 @@ void ChromeProcessController::NotifyAsyncAutoscrollRejected(
void ChromeProcessController::CancelAutoscroll(
const ScrollableLayerGuid& aGuid) {
- if (!mUIThread->IsOnCurrentThread()) {
- mUIThread->Dispatch(NewRunnableMethod<ScrollableLayerGuid>(
- "layers::ChromeProcessController::CancelAutoscroll", this,
- &ChromeProcessController::CancelAutoscroll, aGuid));
- return;
- }
-
- APZCCallbackHelper::CancelAutoscroll(aGuid.mScrollId);
+ mUIThread->Dispatch(NewRunnableFunction("layers::CancelAutoscroll",
+ &APZCCallbackHelper::CancelAutoscroll,
+ aGuid.mScrollId));
}
void ChromeProcessController::NotifyScaleGestureComplete(
diff --git a/gfx/layers/ipc/RemoteContentController.cpp b/gfx/layers/ipc/RemoteContentController.cpp
@@ -455,15 +455,9 @@ void RemoteContentController::CancelAutoscroll(
void RemoteContentController::CancelAutoscrollInProcess(
const ScrollableLayerGuid& aGuid) {
MOZ_ASSERT(XRE_IsParentProcess());
-
- if (!NS_IsMainThread()) {
- NS_DispatchToMainThread(NewRunnableMethod<ScrollableLayerGuid>(
- "layers::RemoteContentController::CancelAutoscrollInProcess", this,
- &RemoteContentController::CancelAutoscrollInProcess, aGuid));
- return;
- }
-
- APZCCallbackHelper::CancelAutoscroll(aGuid.mScrollId);
+ NS_DispatchToMainThread(NewRunnableFunction(
+ "layers::CancelAutoScroll", &APZCCallbackHelper::CancelAutoscroll,
+ aGuid.mScrollId));
}
void RemoteContentController::CancelAutoscrollCrossProcess(
diff --git a/toolkit/content/tests/browser/browser.toml b/toolkit/content/tests/browser/browser.toml
@@ -83,9 +83,6 @@ fail-if = ["a11y_checks"] # Bug 1854538 clicked tabbrowser-tabpanels may not be
["browser_click_event_during_autoscrolling.js"]
fail-if = ["a11y_checks"] # Bug 1854538 clicked browser may not be accessible
-skip-if = [
- "os == 'linux' && os_version == '24.04' && processor == 'x86_64'", # Bug 1775544
-]
["browser_contentTitle.js"]