diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp index 2eb1bd8eb7315..8804b73e39481 100644 --- a/dom/base/ChromeUtils.cpp +++ b/dom/base/ChromeUtils.cpp @@ -52,6 +52,7 @@ #include "mozilla/ipc/UtilityProcessManager.h" #include "mozilla/ipc/UtilityProcessHost.h" #include "mozilla/net/UrlClassifierFeatureFactory.h" +#include "mozilla/WheelHandlingHelper.h" #include "IOActivityMonitor.h" #include "nsNativeTheme.h" #include "nsThreadUtils.h" @@ -1696,6 +1697,15 @@ void ChromeUtils::ResetLastExternalProtocolIframeAllowed( PopupBlocker::ResetLastExternalProtocolIframeAllowed(); } +/* static */ +void ChromeUtils::EndWheelTransaction(GlobalObject& aGlobal) { + // This allows us to end the current wheel transaction from the browser + // chrome. We do not need to perform any checks before calling + // EndTransaction(), as it should do nothing in the case that there is + // no current wheel transaction. + WheelTransaction::EndTransaction(); +} + /* static */ void ChromeUtils::RegisterWindowActor(const GlobalObject& aGlobal, const nsACString& aName, diff --git a/dom/base/ChromeUtils.h b/dom/base/ChromeUtils.h index 685a325e736e1..acb2cffdd2579 100644 --- a/dom/base/ChromeUtils.h +++ b/dom/base/ChromeUtils.h @@ -251,6 +251,8 @@ class ChromeUtils { static void ResetLastExternalProtocolIframeAllowed(GlobalObject& aGlobal); + static void EndWheelTransaction(GlobalObject& aGlobal); + static void RegisterWindowActor(const GlobalObject& aGlobal, const nsACString& aName, const WindowActorOptions& aOptions, diff --git a/dom/chrome-webidl/ChromeUtils.webidl b/dom/chrome-webidl/ChromeUtils.webidl index 688b6311870ab..5f85b521e5625 100644 --- a/dom/chrome-webidl/ChromeUtils.webidl +++ b/dom/chrome-webidl/ChromeUtils.webidl @@ -613,6 +613,13 @@ partial namespace ChromeUtils { [ChromeOnly] undefined resetLastExternalProtocolIframeAllowed(); + /** + * For webdriver consistency purposes, we need to be able to end a wheel + * transaction from the browser chrome. + */ + [ChromeOnly] + undefined endWheelTransaction(); + /** * Register a new toplevel window global actor. This method may only be * called in the parent process. |name| must be globally unique.