Backed out 2 changesets (bug 1839198) for causing failures on browser_disableSwipeGestures.js. CLOSED TREE

Backed out changeset 7571cac8dc05 (bug 1839198)
Backed out changeset 7a7eaa3f754d (bug 1839198)
This commit is contained in:
Natalia Csoregi 2023-06-23 03:31:03 +03:00
parent de1dd1c649
commit d39daca2ad
6 changed files with 5 additions and 67 deletions

View File

@ -60,7 +60,6 @@ skip-if = os == "linux" && bits == 64 && os_version == "18.04" # Bug 1569205
[browser_cornerSnapping.js]
run-if = os == "mac"
[browser_dblclickFullscreen.js]
[browser_disableSwipeGestures.js]
[browser_durationChange.js]
[browser_flipIconWithRTL.js]
skip-if =

View File

@ -1,47 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js",
this
);
add_task(async () => {
await BrowserTestUtils.withNewTab(
{
gBrowser,
url: TEST_PAGE,
},
async browser => {
let pipWin = await triggerPictureInPicture(browser, "with-controls");
let receivedSwipeGestureEvents = false;
pipWin.addEventListener("MozSwipeGestureMayStart", () => {
receivedSwipeGestureEvents = true;
});
const wheelEventPromise = BrowserTestUtils.waitForEvent(pipWin, "wheel");
// Try swiping left to right.
await panLeftToRightBegin(pipWin, 100, 100, 100);
await panLeftToRightEnd(pipWin, 100, 100, 100);
// Wait a wheel event and a couple of frames to give a chance to receive
// the MozSwipeGestureMayStart event.
await wheelEventPromise;
await new Promise(resolve => requestAnimationFrame(resolve));
await new Promise(resolve => requestAnimationFrame(resolve));
Assert.ok(
!receivedSwipeGestureEvents,
"No swipe gesture events observed"
);
let pipClosed = BrowserTestUtils.domWindowClosed(pipWin);
pipWin.close();
await pipClosed;
}
);
});

View File

@ -408,6 +408,7 @@ nsWindow::nsWindow()
mPanInProgress(false),
mDrawToContainer(false),
mTitlebarBackdropState(false),
mIsPIPWindow(false),
mIsWaylandPanelWindow(false),
mIsChildWindow(false),
mAlwaysOnTop(false),
@ -5907,6 +5908,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
}
mAlwaysOnTop = aInitData && aInitData->mAlwaysOnTop;
mIsPIPWindow = aInitData && aInitData->mPIPWindow;
// mNoAutoHide seems to be always false here.
// The mNoAutoHide state is set later on nsMenuPopupFrame level
// and can be changed so we use WaylandPopupIsPermanent() to get

View File

@ -658,6 +658,8 @@ class nsWindow final : public nsBaseWidget {
bool mDrawToContainer : 1;
// Draw titlebar with :backdrop css state (inactive/unfocused).
bool mTitlebarBackdropState : 1;
// It's PictureInPicture window.
bool mIsPIPWindow : 1;
// It's undecorated popup utility window, without resizers/titlebar,
// movable by mouse. Used on Wayland for popups without
// parent (for instance WebRTC sharing indicator, notifications).

View File

@ -154,8 +154,7 @@ nsBaseWidget::nsBaseWidget(BorderStyle aBorderStyle)
mIMEHasQuit(false),
mIsFullyOccluded(false),
mNeedFastSnaphot(false),
mCurrentPanGestureBelongsToSwipe(false),
mIsPIPWindow(false) {
mCurrentPanGestureBelongsToSwipe(false) {
#ifdef NOISY_WIDGET_LEAKS
gNumWidgets++;
printf("WIDGETS+ = %d\n", gNumWidgets);
@ -420,7 +419,6 @@ void nsBaseWidget::BaseCreate(nsIWidget* aParent, widget::InitData* aInitData) {
mPopupLevel = aInitData->mPopupLevel;
mPopupType = aInitData->mPopupHint;
mHasRemoteContent = aInitData->mHasRemoteContent;
mIsPIPWindow = aInitData->mPIPWindow;
}
if (aParent) {
@ -2315,12 +2313,6 @@ nsBaseWidget::SwipeInfo nsBaseWidget::SendMayStartSwipe(
WidgetWheelEvent nsBaseWidget::MayStartSwipeForAPZ(
const PanGestureInput& aPanInput, const APZEventResult& aApzResult) {
WidgetWheelEvent event = aPanInput.ToWidgetEvent(this);
// Ignore swipe-to-navigation in PiP window.
if (mIsPIPWindow) {
return event;
}
if (aPanInput.AllowsSwipe()) {
SwipeInfo swipeInfo = SendMayStartSwipe(aPanInput);
event.mCanTriggerSwipe = swipeInfo.wantsSwipe;
@ -2362,11 +2354,6 @@ WidgetWheelEvent nsBaseWidget::MayStartSwipeForAPZ(
}
bool nsBaseWidget::MayStartSwipeForNonAPZ(const PanGestureInput& aPanInput) {
// Ignore swipe-to-navigation in PiP window.
if (mIsPIPWindow) {
return false;
}
if (aPanInput.mType == PanGestureInput::PANGESTURE_MAYSTART ||
aPanInput.mType == PanGestureInput::PANGESTURE_START) {
mCurrentPanGestureBelongsToSwipe = false;

View File

@ -674,8 +674,6 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
void FreeShutdownObserver();
void FreeLocalesChangedObserver();
bool IsPIPWindow() const { return mIsPIPWindow; };
nsIWidgetListener* mWidgetListener;
nsIWidgetListener* mAttachedWidgetListener;
nsIWidgetListener* mPreviouslyAttachedWidgetListener;
@ -723,9 +721,6 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
// a PANGESTURE_(MAY)START event).
bool mCurrentPanGestureBelongsToSwipe;
// It's PictureInPicture window.
bool mIsPIPWindow : 1;
struct InitialZoomConstraints {
InitialZoomConstraints(const uint32_t& aPresShellID,
const ScrollableLayerGuid::ViewID& aViewID,