Issue #2765 - Part 3: Make scrollbar width checks use the originating non-NAC style context

This commit is contained in:
Francis Dominic Fajardo 2025-06-26 21:15:50 +08:00 committed by roytam1
commit 3ba0b10bb4
2 changed files with 6 additions and 2 deletions

View file

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