diff --git a/toolkit/themes/windows/global/tooltip.css b/toolkit/themes/windows/global/tooltip.css index bc6e1201f272..7d54a596663a 100644 --- a/toolkit/themes/windows/global/tooltip.css +++ b/toolkit/themes/windows/global/tooltip.css @@ -19,11 +19,25 @@ tooltip { } @media (-moz-windows-default-theme) { - /* We use Window / WindowText instead on the default theme because the - default yellowish styles are somewhat ugly */ tooltip { - background-color: Window; - color: WindowText; + /* These are the same colors as --menu-background-color and co., but we + can't quite use them because the default tooltip is native anonymous and + doesn't inherit from the root. */ + background-color: #f9f9fb; + color: #15141a; + border-color: #cfcfd8; + + /* Force a rounded-rect dropshadow to appear. */ + -moz-window-shadow: cliprounded; + border-radius: 4px; + } + + @media (prefers-color-scheme: dark) { + tooltip { + background-color: #2b2a33; + color: #fbfbfe; + border-color: #5b5b66; + } } } diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 3e36a5f67ae8..53d7a043e255 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -1816,7 +1816,8 @@ static bool ShouldHaveRoundedMenuDropShadow(nsWindow* aWindow) { // XXX this is apparently still needed in Windows 7 and later void nsWindow::ClearThemeRegion() { if (mWindowType == eWindowType_popup && - (mPopupType == ePopupTypeMenu || mPopupType == ePopupTypePanel) && + (mPopupType == ePopupTypeTooltip || mPopupType == ePopupTypeMenu || + mPopupType == ePopupTypePanel) && ShouldHaveRoundedMenuDropShadow(this)) { SetWindowRgn(mWnd, nullptr, false); } else if (!HasGlass() && @@ -1830,9 +1831,9 @@ void nsWindow::ClearThemeRegion() { void nsWindow::SetThemeRegion() { // Clip the window to the rounded rect area of the popup if needed. if (mWindowType == eWindowType_popup && - (mPopupType == ePopupTypeMenu || mPopupType == ePopupTypePanel)) { - nsView* view = nsView::GetViewFor(this); - if (view) { + (mPopupType == ePopupTypeTooltip || mPopupType == ePopupTypeMenu || + mPopupType == ePopupTypePanel)) { + if (nsView* view = nsView::GetViewFor(this)) { LayoutDeviceIntSize size = nsLayoutUtils::GetBorderRadiusForMenuDropShadow(view->GetFrame()); if (size.width || size.height) {