commit 1734b54c10fd2f83745bdd6d7d430d146b0f0de1
parent 5634917913a5d139a37698452732bc4ccabfef9b
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Wed, 12 Nov 2025 11:47:33 +0000
Bug 1999620 - Remove some dead view-related code now that popups don't use views. r=tnikkel,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D272205
Diffstat:
8 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h
@@ -2069,9 +2069,6 @@ class PresShell final : public nsStubDocumentObserver,
nsRect aArea, const LayoutDeviceIntPoint aPoint,
LayoutDeviceIntRect* aScreenRect, RenderImageFlags aFlags);
- // Hide a view if it is a popup
- void HideViewIfPopup(nsView* aView);
-
// Utility method to restore the root scrollframe state
void RestoreRootScrollPosition();
diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp
@@ -357,7 +357,7 @@ nsXULPopupManager* nsXULPopupManager::GetInstance() {
}
bool nsXULPopupManager::RollupTooltips() {
- const RollupOptions options{0, FlushViews::Yes, nullptr, AllowAnimations::No};
+ const RollupOptions options{0, nullptr, AllowAnimations::No};
return RollupInternal(RollupKind::Tooltip, options, nullptr);
}
@@ -517,10 +517,6 @@ bool nsXULPopupManager::RollupInternal(RollupKind aKind,
}
}
- nsPresContext* presContext = item->Frame()->PresContext();
- RefPtr<nsViewManager> viewManager =
- presContext->PresShell()->GetViewManager();
-
HidePopupOptions options{HidePopupOption::HideChain,
HidePopupOption::DeselectMenu,
HidePopupOption::IsRollup};
@@ -530,12 +526,6 @@ bool nsXULPopupManager::RollupInternal(RollupKind aKind,
HidePopup(item->Element(), options, lastPopup);
- if (aOptions.mFlush == FlushViews::Yes) {
- // The popup's visibility doesn't update until the minimize animation
- // has finished, so call UpdateWidgetGeometry to update it right away.
- viewManager->UpdateWidgetGeometry();
- }
-
return consume;
}
diff --git a/view/nsView.cpp b/view/nsView.cpp
@@ -498,15 +498,6 @@ void nsView::RequestRepaint() {
}
}
-bool nsView::ShouldNotBeVisible() {
- if (mFrame && mFrame->IsMenuPopupFrame()) {
- nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
- return !pm || !pm->IsPopupOpen(mFrame->GetContent()->AsElement());
- }
-
- return false;
-}
-
nsEventStatus nsView::HandleEvent(WidgetGUIEvent* aEvent,
bool aUseAttachedEvents) {
MOZ_ASSERT(nullptr != aEvent->mWidget, "null widget ptr");
diff --git a/view/nsView.h b/view/nsView.h
@@ -281,7 +281,6 @@ class nsView final : public nsIWidgetListener {
const mozilla::TimeStamp& aCompositeStart,
const mozilla::TimeStamp& aCompositeEnd) override;
void RequestRepaint() override;
- bool ShouldNotBeVisible() override;
MOZ_CAN_RUN_SCRIPT_BOUNDARY
nsEventStatus HandleEvent(mozilla::WidgetGUIEvent* aEvent,
bool aUseAttachedEvents) override;
diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm
@@ -148,8 +148,7 @@ static void RollUpPopups(nsIRollupListener::AllowAnimations aAllowAnimations =
if (!rollupWidget) {
return;
}
- nsIRollupListener::RollupOptions options{
- 0, nsIRollupListener::FlushViews::Yes, nullptr, aAllowAnimations};
+ nsIRollupListener::RollupOptions options{0, nullptr, aAllowAnimations};
rollupListener->Rollup(options);
}
@@ -1962,8 +1961,7 @@ NSEvent* gLastDragMouseDownEvent = nil; // [strong]
}
LayoutDeviceIntPoint devPoint;
- nsIRollupListener::RollupOptions rollupOptions{
- popupsToRollup, nsIRollupListener::FlushViews::Yes};
+ nsIRollupListener::RollupOptions rollupOptions{popupsToRollup};
if ([theEvent type] == NSEventTypeLeftMouseDown) {
NSPoint point = [NSEvent mouseLocation];
FlipCocoaScreenCoordinate(point);
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
@@ -7667,8 +7667,7 @@ bool nsWindow::CheckForRollup(gdouble aMouseX, gdouble aMouseY, bool aIsWheel,
}
}
LayoutDeviceIntPoint point;
- nsIRollupListener::RollupOptions options{0,
- nsIRollupListener::FlushViews::Yes};
+ nsIRollupListener::RollupOptions options;
// if we're dealing with menus, we probably have submenus and
// we don't want to rollup if the click is in a parent menu of
// the current submenu
diff --git a/widget/nsIRollupListener.h b/widget/nsIRollupListener.h
@@ -16,14 +16,11 @@ class nsIWidget;
class nsIRollupListener {
public:
- enum class FlushViews : bool { No, Yes };
enum class AllowAnimations : bool { No, Yes };
struct RollupOptions {
// aCount is the number of popups in a chain to close. If this is
// zero, then all popups are closed.
uint32_t mCount = 0;
- // If this is true, then views should be flushed after the rollup.
- FlushViews mFlush = FlushViews::No;
// This is the mouse pointer position where the event that triggered the
// rollup occurred, which may be nullptr.
const mozilla::LayoutDeviceIntPoint* mPoint = nullptr;
diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp
@@ -7777,7 +7777,6 @@ bool nsWindow::DealWithPopups(HWND aWnd, UINT aMessage, WPARAM aWParam,
nsIRollupListener::RollupOptions rollupOptions{
popupsToRollup,
- nsIRollupListener::FlushViews::Yes,
/* mPoint = */ nullptr,
allowAnimations,
};