Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 396d38c

Browse files
committed
Bug 1691169 - Remove unused code that indicated "bright titlebar foreground" to the widget. r=spohl
Depends on D104300 Differential Revision: https://phabricator.services.mozilla.com/D104301
1 parent 19e9df6 commit 396d38c

File tree

6 files changed

+0
-50
lines changed

6 files changed

+0
-50
lines changed

dom/xul/ChromeObserver.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,6 @@ void ChromeObserver::SetDrawsTitle(bool aState) {
102102
}
103103
}
104104

105-
void ChromeObserver::UpdateBrightTitlebarForeground() {
106-
nsIWidget* mainWidget = GetWindowWidget();
107-
if (mainWidget) {
108-
// We can do this synchronously because SetBrightTitlebarForeground doesn't
109-
// have any synchronous effects apart from a harmless invalidation.
110-
mainWidget->SetUseBrightTitlebarForeground(
111-
mDocument->GetDocumentLWTheme() == Document::Doc_Theme_Bright ||
112-
mDocument->GetRootElement()->AttrValueIs(
113-
kNameSpaceID_None, nsGkAtoms::brighttitlebarforeground, u"true"_ns,
114-
eCaseMatters));
115-
}
116-
}
117-
118105
class MarginSetter : public Runnable {
119106
public:
120107
explicit MarginSetter(nsIWidget* aWidget)
@@ -196,9 +183,6 @@ void ChromeObserver::AttributeChanged(dom::Element* aElement,
196183
// if the lwtheme changed, make sure to reset the document lwtheme
197184
// cache
198185
mDocument->ResetDocumentLWTheme();
199-
UpdateBrightTitlebarForeground();
200-
} else if (aName == nsGkAtoms::brighttitlebarforeground) {
201-
UpdateBrightTitlebarForeground();
202186
}
203187
} else {
204188
if (aName == nsGkAtoms::hidechrome) {
@@ -213,9 +197,6 @@ void ChromeObserver::AttributeChanged(dom::Element* aElement,
213197
aName == nsGkAtoms::lwthemetextcolor)) {
214198
// if the lwtheme changed, make sure to restyle appropriately
215199
mDocument->ResetDocumentLWTheme();
216-
UpdateBrightTitlebarForeground();
217-
} else if (aName == nsGkAtoms::brighttitlebarforeground) {
218-
UpdateBrightTitlebarForeground();
219200
} else if (aName == nsGkAtoms::drawintitlebar) {
220201
SetDrawsInTitlebar(false);
221202
} else if (aName == nsGkAtoms::drawtitle) {

dom/xul/ChromeObserver.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class ChromeObserver final : public nsStubMutationObserver {
2929
nsIWidget* GetWindowWidget();
3030
void SetDrawsInTitlebar(bool aState);
3131
void SetDrawsTitle(bool aState);
32-
void UpdateBrightTitlebarForeground();
3332
void SetChromeMargins(const nsAttrValue* aValue);
3433
nsresult HideWindowChrome(bool aShouldHide);
3534

widget/cocoa/nsCocoaWindow.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ typedef struct _nsCocoaWindowList {
4949

5050
BOOL mBeingShown;
5151
BOOL mDrawTitle;
52-
BOOL mBrightTitlebarForeground;
5352
BOOL mUseMenuStyle;
5453
BOOL mIsAnimationSuppressed;
5554

@@ -98,9 +97,6 @@ typedef struct _nsCocoaWindowList {
9897
- (void)setWantsTitleDrawn:(BOOL)aDrawTitle;
9998
- (BOOL)wantsTitleDrawn;
10099

101-
- (void)setUseBrightTitlebarForeground:(BOOL)aBrightForeground;
102-
- (BOOL)useBrightTitlebarForeground;
103-
104100
- (void)disableSetNeedsDisplay;
105101
- (void)enableSetNeedsDisplay;
106102

@@ -307,7 +303,6 @@ class nsCocoaWindow final : public nsBaseWidget, public nsPIWidgetCocoa {
307303
virtual void SetSupportsNativeFullscreen(bool aShow) override;
308304
virtual void SetWindowAnimationType(WindowAnimationType aType) override;
309305
virtual void SetDrawsTitle(bool aDrawTitle) override;
310-
virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) override;
311306
virtual nsresult SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
312307
virtual void SetDrawsInTitlebar(bool aState) override;
313308
virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) override;

widget/cocoa/nsCocoaWindow.mm

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,14 +2475,6 @@ static inline CGAffineTransform GfxMatrixToCGAffineTransform(const gfx::Matrix&
24752475
NS_OBJC_END_TRY_ABORT_BLOCK;
24762476
}
24772477

2478-
void nsCocoaWindow::SetUseBrightTitlebarForeground(bool aBrightForeground) {
2479-
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
2480-
2481-
[mWindow setUseBrightTitlebarForeground:aBrightForeground];
2482-
2483-
NS_OBJC_END_TRY_ABORT_BLOCK;
2484-
}
2485-
24862478
nsresult nsCocoaWindow::SetNonClientMargins(LayoutDeviceIntMargin& margins) {
24872479
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
24882480

@@ -3162,7 +3154,6 @@ - (id)initWithContentRect:(NSRect)aContentRect
31623154
mDirtyRect = NSZeroRect;
31633155
mBeingShown = NO;
31643156
mDrawTitle = NO;
3165-
mBrightTitlebarForeground = NO;
31663157
mUseMenuStyle = NO;
31673158
mTouchBar = nil;
31683159
mIsAnimationSuppressed = NO;
@@ -3344,15 +3335,6 @@ - (BOOL)wantsTitleDrawn {
33443335
return mDrawTitle;
33453336
}
33463337

3347-
- (void)setUseBrightTitlebarForeground:(BOOL)aBrightForeground {
3348-
mBrightTitlebarForeground = aBrightForeground;
3349-
[[self standardWindowButton:NSWindowFullScreenButton] setNeedsDisplay:YES];
3350-
}
3351-
3352-
- (BOOL)useBrightTitlebarForeground {
3353-
return mBrightTitlebarForeground;
3354-
}
3355-
33563338
- (NSView*)trackingAreaView {
33573339
NSView* contentView = [self contentView];
33583340
return [contentView superview] ? [contentView superview] : contentView;

widget/nsIWidget.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,12 +1186,6 @@ class nsIWidget : public nsISupports {
11861186
*/
11871187
virtual void SetDrawsTitle(bool aDrawTitle) {}
11881188

1189-
/**
1190-
* Indicates whether the widget should attempt to make titlebar controls
1191-
* easier to see on dark titlebar backgrounds.
1192-
*/
1193-
virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) {}
1194-
11951189
/**
11961190
* Hide window chrome (borders, buttons) for this widget.
11971191
*

xpcom/ds/StaticAtoms.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@
200200
Atom("browser", "browser"),
201201
Atom("mozbrowser", "mozbrowser"),
202202
Atom("button", "button"),
203-
Atom("brighttitlebarforeground", "brighttitlebarforeground"),
204203
Atom("callTemplate", "call-template"),
205204
Atom("canvas", "canvas"),
206205
Atom("caption", "caption"),

0 commit comments

Comments
 (0)