commit eab3d6646c1f2e2fd4b71010e0ee8d7a4ba1fbcd
parent acc5651bb965d06857ba179ffffc95fc84770c77
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Sat, 3 Jan 2026 18:26:51 +0000
Bug 2008419 - Remove nsITheme::WidgetIsContainer. r=jwatt
It's only used to avoid painting children of some widgets, but radios /
checkboxes are already frame tree leafs, and nowadays content can't
specify appearance: radio on arbitrary frames.
Differential Revision: https://phabricator.services.mozilla.com/D277795
Diffstat:
8 files changed, 0 insertions(+), 44 deletions(-)
diff --git a/gfx/src/nsITheme.h b/gfx/src/nsITheme.h
@@ -228,8 +228,6 @@ class nsITheme : public nsISupports {
nsIFrame* aFrame,
StyleAppearance aWidgetType) = 0;
- virtual bool WidgetIsContainer(StyleAppearance aWidgetType) = 0;
-
/**
* Does the nsITheme implementation draw its own focus ring for this widget?
*/
diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp
@@ -4395,13 +4395,6 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
pseudoStackingContext = true;
}
- const nsStyleDisplay* ourDisp = StyleDisplay();
- // Don't paint our children if the theme object is a leaf.
- if (IsThemed(ourDisp) && !PresContext()->Theme()->WidgetIsContainer(
- ourDisp->EffectiveAppearance())) {
- return;
- }
-
// Since we're now sure that we're adding this frame to the display list
// (which means we're painting it, modulo occlusion), mark it as visible
// within the displayport.
diff --git a/widget/Theme.cpp b/widget/Theme.cpp
@@ -1607,17 +1607,6 @@ bool Theme::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
}
}
-bool Theme::WidgetIsContainer(StyleAppearance aAppearance) {
- switch (aAppearance) {
- case StyleAppearance::MozMenulistArrowButton:
- case StyleAppearance::Radio:
- case StyleAppearance::Checkbox:
- return false;
- default:
- return true;
- }
-}
-
bool Theme::ThemeDrawsFocusForWidget(nsIFrame*, StyleAppearance) {
return true;
}
diff --git a/widget/Theme.h b/widget/Theme.h
@@ -84,7 +84,6 @@ class Theme : protected nsNativeTheme, public nsITheme {
ThemeGeometryType ThemeGeometryTypeForWidget(nsIFrame*,
StyleAppearance) override;
bool ThemeSupportsWidget(nsPresContext*, nsIFrame*, StyleAppearance) override;
- bool WidgetIsContainer(StyleAppearance) override;
bool ThemeDrawsFocusForWidget(nsIFrame*, StyleAppearance) override;
bool ThemeNeedsComboboxDropmarker() override;
diff --git a/widget/cocoa/nsNativeThemeCocoa.h b/widget/cocoa/nsNativeThemeCocoa.h
@@ -162,7 +162,6 @@ class nsNativeThemeCocoa : public mozilla::widget::ThemeCocoa {
nsAtom* aAttribute) override;
bool ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame*,
StyleAppearance) override;
- bool WidgetIsContainer(StyleAppearance) override;
bool ThemeDrawsFocusForWidget(nsIFrame*, StyleAppearance) override;
bool ThemeNeedsComboboxDropmarker() override;
bool WidgetAppearanceDependsOnWindowFocus(StyleAppearance) override;
diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -1781,22 +1781,6 @@ bool nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext,
return false;
}
-bool nsNativeThemeCocoa::WidgetIsContainer(StyleAppearance aAppearance) {
- // flesh this out at some point
- switch (aAppearance) {
- case StyleAppearance::MozMenulistArrowButton:
- case StyleAppearance::Radio:
- case StyleAppearance::Checkbox:
- case StyleAppearance::MozMacHelpButton:
- case StyleAppearance::MozMacDisclosureButtonOpen:
- case StyleAppearance::MozMacDisclosureButtonClosed:
- return false;
- default:
- break;
- }
- return true;
-}
-
bool nsNativeThemeCocoa::ThemeDrawsFocusForWidget(nsIFrame*,
StyleAppearance aAppearance) {
switch (aAppearance) {
diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp
@@ -495,11 +495,6 @@ bool nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
return false;
}
-bool nsNativeThemeGTK::WidgetIsContainer(StyleAppearance aAppearance) {
- // XXXdwh At some point flesh all of this out.
- return true;
-}
-
bool nsNativeThemeGTK::ThemeDrawsFocusForWidget(nsIFrame* aFrame,
StyleAppearance aAppearance) {
if (IsWidgetNonNative(aFrame, aAppearance) != NonNative::No) {
diff --git a/widget/gtk/nsNativeThemeGTK.h b/widget/gtk/nsNativeThemeGTK.h
@@ -56,7 +56,6 @@ class nsNativeThemeGTK final : public mozilla::widget::Theme {
nsAtom* aAttribute) override;
bool ThemeSupportsWidget(nsPresContext*, nsIFrame*, StyleAppearance) override;
- bool WidgetIsContainer(StyleAppearance) override;
bool ThemeDrawsFocusForWidget(nsIFrame*, StyleAppearance) override;
Transparency GetWidgetTransparency(nsIFrame*, StyleAppearance) override;