Commit 79468295 authored by Dan Robertson's avatar Dan Robertson
Browse files

Bug 1821733 - Add chrome-only method for ending a wheel event group. r=smaug

Add a chrome-only method for ending a wheel event group. This can then
be used by the webdriver to ensure that the wheel event group does not
live longer than the action chain.

Differential Revision: https://phabricator.services.mozilla.com/D177923
parent 51c6d82b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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,
+2 −0
Original line number Diff line number Diff line
@@ -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,
+7 −0
Original line number Diff line number Diff line
@@ -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.