diff --git a/browser/base/content/test/performance/browser_panel_vsync.js b/browser/base/content/test/performance/browser_panel_vsync.js index 9f9b478b4d74..a00b977ca98f 100644 --- a/browser/base/content/test/performance/browser_panel_vsync.js +++ b/browser/base/content/test/performance/browser_panel_vsync.js @@ -34,6 +34,21 @@ add_task( // Should not already be using vsync ok(!ChromeUtils.vsyncEnabled(), "vsync should be off initially"); + if ( + AppConstants.platform == "linux" && + DownloadsPanel.panel.state != "open" + ) { + // Panels sometime receive spurious popuphiding events on Linux. + // Given the main target of this test is Windows, avoid causing + // intermittent failures and just make the test return early. + todo( + false, + "panel should still be 'open', current state: " + + DownloadsPanel.panel.state + ); + return; + } + const hiddenPromise = BrowserTestUtils.waitForEvent( DownloadsPanel.panel, "popuphidden" diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 96fd7ab58fd1..c55270501e0e 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -1099,6 +1099,9 @@ void nsMenuPopupFrame::HidePopup(bool aDeselectMenu, nsPopupState aNewState) { mHFlip = mVFlip = false; if (auto* widget = GetWidget()) { + // Ideally we should call ClearCachedWebrenderResources but there are + // intermittent failures (see bug 1748788), so we currently call + // ClearWebrenderAnimationResources instead. widget->ClearWebrenderAnimationResources(); }