Issue #2765 - Follow-up: Make scrollbar width checks use the originating non-NAC style context on Linux and Mac

This commit is contained in:
Francis Dominic Fajardo 2025-06-27 12:23:26 +08:00 committed by roytam1
commit af84337437
2 changed files with 6 additions and 2 deletions

View file

@ -2282,7 +2282,9 @@ IsHiDPIContext(nsPresContext* aContext)
static bool
IsScrollbarWidthThin(nsIFrame* aFrame)
{
return aFrame->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::Thin;
nsStyleContext* styleContext = nsLayoutUtils::GetNonAnonymousStyleContext(aFrame);
auto scrollbarWidth = styleContext->StyleUIReset()->mScrollbarWidth;
return scrollbarWidth == StyleScrollbarWidth::Thin;
}
NS_IMETHODIMP

View file

@ -1101,7 +1101,9 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, uint8_t aWidgetType,
static bool
IsScrollbarWidthThin(nsIFrame* aFrame)
{
return aFrame->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::Thin;
nsStyleContext* styleContext = nsLayoutUtils::GetNonAnonymousStyleContext(aFrame);
auto scrollbarWidth = styleContext->StyleUIReset()->mScrollbarWidth;
return scrollbarWidth == StyleScrollbarWidth::Thin;
}
NS_IMETHODIMP