Skip to content

Commit

Permalink
Scroll corner painting ignores color-scheme when overflow: scroll
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258482

Reviewed by Aditya Keerthi.

Update the local appearance value before painting Mac scroll corner.

This means that the color-scheme is correctly accounted for when painting the scroll corner for both frame views and scrollable areas.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::paintScrollCorner):
* Source/WebCore/platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paintScrollCorner):

Canonical link: https://commits.webkit.org/265687@main
  • Loading branch information
lukewarlow authored and Ahmad Saleem committed Jul 1, 2023
1 parent 9e8ea19 commit 4498c48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 0 additions & 9 deletions Source/WebCore/page/LocalFrameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@
#include "LegacyTileCache.h"
#endif

#if PLATFORM(MAC)
#include "LocalDefaultSystemAppearance.h"
#endif

#include "DisplayView.h"
#include "LayoutContext.h"

Expand Down Expand Up @@ -4570,11 +4566,6 @@ void LocalFrameView::paintScrollCorner(GraphicsContext& context, const IntRect&
return;
}

#if PLATFORM(MAC)
// Keep this in sync with ScrollAnimatorMac's effectiveAppearanceForScrollerImp:.
LocalDefaultSystemAppearance localAppearance(useDarkAppearanceForScrollbars());
#endif

ScrollView::paintScrollCorner(context, cornerRect);
}

Expand Down
6 changes: 5 additions & 1 deletion Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#import "GraphicsLayer.h"
#import "ImageBuffer.h"
#import "LocalCurrentGraphicsContext.h"
#import "LocalDefaultSystemAppearance.h"
#import "NSScrollerImpDetails.h"
#import "PlatformMouseEvent.h"
#import "ScrollView.h"
Expand Down Expand Up @@ -582,11 +583,14 @@ static void paintScrollbar(Scrollbar& scrollbar, GraphicsContext& context)
return true;
}

void ScrollbarThemeMac::paintScrollCorner(ScrollableArea&, GraphicsContext& context, const IntRect& cornerRect)
void ScrollbarThemeMac::paintScrollCorner(ScrollableArea& area, GraphicsContext& context, const IntRect& cornerRect)
{
if (context.paintingDisabled())
return;

// Keep this in sync with ScrollAnimatorMac's effectiveAppearanceForScrollerImp:.
LocalDefaultSystemAppearance localAppearance(area.useDarkAppearanceForScrollbars());

context.drawSystemImage(ScrollbarTrackCornerSystemImageMac::create(), cornerRect);
}

Expand Down

0 comments on commit 4498c48

Please sign in to comment.