Skip to content

Commit

Permalink
Bug 1821733 - Add chrome-only method for ending a wheel event group. …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
dlrobertson committed May 22, 2023
1 parent bef2e7a commit 1eee441
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dom/base/ChromeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions dom/base/ChromeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions dom/chrome-webidl/ChromeUtils.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1eee441

Please sign in to comment.