Index: Source/core/platform/mac/NSScrollerImpDetails.mm |
diff --git a/Source/core/platform/mac/NSScrollerImpDetails.mm b/Source/core/platform/mac/NSScrollerImpDetails.mm |
index a5f09c5d519c0df39a5713c72bc1acc9152a3ce1..464bbc0c4b498fa665be8c0a6913010bd023d5c7 100644 |
--- a/Source/core/platform/mac/NSScrollerImpDetails.mm |
+++ b/Source/core/platform/mac/NSScrollerImpDetails.mm |
@@ -48,7 +48,13 @@ bool isScrollbarOverlayAPIAvailable() |
NSScrollerStyle recommendedScrollerStyle() { |
if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) |
return NSScrollerStyleOverlay; |
- if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)]) |
Nico
2013/10/11 19:48:48
If this is called from a single thread, just
sta
|
+ bool respondsToSelectorPreferredScrollerStyle; |
+ bool shouldInitialize = true; |
Nico
2013/10/11 19:48:48
…wait, how does this version work? Isn't this stil
|
+ if (shouldInitialize) { |
+ shouldInitialize = false; |
+ respondsToSelectorPreferredScrollerStyle = [NSScroller respondsToSelector:@selector(preferredScrollerStyle)]; |
+ } |
+ if (respondsToSelectorPreferredScrollerStyle) |
return [NSScroller preferredScrollerStyle]; |
return NSScrollerStyleLegacy; |
} |