Skip to content
Permalink
Browse files
Remove the chromium code from WebCore/platform/mac
https://bugs.webkit.org/show_bug.cgi?id=114104

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-04-06
Reviewed by Sam Weinig.

* platform/mac/NSScrollerImpDetails.h:
(WebCore::isScrollbarOverlayAPIAvailable):
* platform/mac/NSScrollerImpDetails.mm:
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterDelegate layer]):
(WebCore::scrollAnimationEnabledForSystem):
* platform/mac/ScrollElasticityController.mm:
(WebCore):
* platform/mac/ScrollbarThemeMac.h:
(ScrollbarThemeMac):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarTheme::nativeTheme):
(WebCore::ScrollbarThemeMac::paint):
(WebCore):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::ensuredView):
* platform/mac/WebCoreNSCellExtras.h:


Canonical link: https://commits.webkit.org/132489@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Benjamin Poulain authored and BenjaminPoulain committed Apr 6, 2013
1 parent 506558d commit bd654b761cd214fbaa735a125f1b7dee0cb09bf7
Showing 9 changed files with 31 additions and 36 deletions.
@@ -1,3 +1,28 @@
2013-04-06 Benjamin Poulain <bpoulain@apple.com>

Remove the chromium code from WebCore/platform/mac
https://bugs.webkit.org/show_bug.cgi?id=114104

Reviewed by Sam Weinig.

* platform/mac/NSScrollerImpDetails.h:
(WebCore::isScrollbarOverlayAPIAvailable):
* platform/mac/NSScrollerImpDetails.mm:
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterDelegate layer]):
(WebCore::scrollAnimationEnabledForSystem):
* platform/mac/ScrollElasticityController.mm:
(WebCore):
* platform/mac/ScrollbarThemeMac.h:
(ScrollbarThemeMac):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarTheme::nativeTheme):
(WebCore::ScrollbarThemeMac::paint):
(WebCore):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::ensuredView):
* platform/mac/WebCoreNSCellExtras.h:

2013-04-06 Benjamin Poulain <benjamin@webkit.org>

Remove the Chromium code from Mac's FontPlatformData
@@ -110,9 +110,6 @@ typedef NSInteger NSScrollerKnobStyle;

namespace WebCore {

#if PLATFORM(CHROMIUM)
bool isScrollbarOverlayAPIAvailable();
#else
static inline bool isScrollbarOverlayAPIAvailable()
{
#if USE(SCROLLBAR_PAINTER)
@@ -121,7 +118,6 @@ static inline bool isScrollbarOverlayAPIAvailable()
return false;
#endif
}
#endif

NSScrollerStyle recommendedScrollerStyle();

@@ -31,22 +31,6 @@

namespace WebCore {

#if PLATFORM(CHROMIUM)
bool isScrollbarOverlayAPIAvailable()
{
static bool apiAvailable;
static bool shouldInitialize = true;
if (shouldInitialize) {
shouldInitialize = false;
Class scrollerImpClass = NSClassFromString(@"NSScrollerImp");
Class scrollerImpPairClass = NSClassFromString(@"NSScrollerImpPair");
apiAvailable = [scrollerImpClass respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)]
&& [scrollerImpPairClass instancesRespondToSelector:@selector(scrollerStyle)];
}
return apiAvailable;
}
#endif

NSScrollerStyle recommendedScrollerStyle() {
if (Settings::usesOverlayScrollbars())
return NSScrollerStyleOverlay;
@@ -432,7 +432,6 @@ - (NSRect)convertRectFromBacking:(NSRect)aRect
return aRect;
}

#if !PLATFORM(CHROMIUM)
- (CALayer *)layer
{
if (!_scrollbar)
@@ -445,7 +444,6 @@ - (CALayer *)layer
static CALayer *dummyLayer = [[CALayer alloc] init];
return dummyLayer;
}
#endif

- (NSPoint)mouseLocationInScrollerForScrollerImp:(id)scrollerImp
{
@@ -642,7 +640,7 @@ - (void)invalidate
static bool scrollAnimationEnabledForSystem()
{
NSString* scrollAnimationDefaultsKey =
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 || PLATFORM(CHROMIUM)
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
@"AppleScrollAnimationEnabled";
#else
@"NSScrollAnimationEnabled";
@@ -63,7 +63,7 @@ static NSTimeInterval systemUptime()
static const float rubberbandDirectionLockStretchRatio = 1;
static const float rubberbandMinimumRequiredDeltaBeforeStretch = 10;

#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 || PLATFORM(CHROMIUM)
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
static const float rubberbandStiffness = 20;
static const float rubberbandAmplitude = 0.31f;
static const float rubberbandPeriod = 1.6f;
@@ -41,9 +41,7 @@ class ScrollbarThemeMac : public ScrollbarThemeComposite {

virtual void updateEnabledState(ScrollbarThemeClient*);

#if !PLATFORM(CHROMIUM)
virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
#endif

virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);

@@ -81,7 +79,7 @@ class ScrollbarThemeMac : public ScrollbarThemeComposite {
virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
int scrollbarPartToHIPressedState(ScrollbarPart);

#if !PLATFORM(CHROMIUM) && USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
#if USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) OVERRIDE;
virtual void setUpContentShadowLayer(GraphicsLayer*) OVERRIDE;
#endif
@@ -113,13 +113,11 @@ + (void)registerAsObserver

namespace WebCore {

#if !PLATFORM(CHROMIUM)
ScrollbarTheme* ScrollbarTheme::nativeTheme()
{
DEFINE_STATIC_LOCAL(ScrollbarThemeMac, theme, ());
return &theme;
}
#endif

// FIXME: Get these numbers from CoreUI.
static int cRealButtonLength[] = { 28, 21 };
@@ -478,7 +476,6 @@ static IntRect buttonRepaintRect(const IntRect& buttonRect, ScrollbarOrientation
[scrollbarMap()->get(scrollbar).get() setEnabled:scrollbar->enabled()];
}

#if !PLATFORM(CHROMIUM)
static void scrollbarPainterPaint(ScrollbarPainter scrollbarPainter, bool enabled, double value, CGFloat proportion, CGRect frameRect)
{
[scrollbarPainter setEnabled:enabled];
@@ -597,9 +594,8 @@ static void scrollbarPainterPaint(ScrollbarPainter scrollbarPainter, bool enable

return true;
}
#endif

#if !PLATFORM(CHROMIUM) && USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
#if USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
static RetainPtr<CGColorRef> linenBackgroundColor()
{
NSImage *image = [NSColor _linenPatternImage];
@@ -572,11 +572,9 @@ static void paintStepper(ControlStates states, GraphicsContext* context, const I
// If the ScrollView doesn't have an NSView, we will return a fake NSView whose sole purpose is to tell AppKit that it's flipped.
NSView *ThemeMac::ensuredView(ScrollView* scrollView)
{
#if !PLATFORM(CHROMIUM)
if (NSView *documentView = scrollView->documentView())
return documentView;
#endif


// Use a fake flipped view.
static NSView *flippedView = [[WebCoreFlippedView alloc] init];
[flippedView setFrameSize:NSSizeFromCGSize(scrollView->totalContentsSize())];
@@ -25,7 +25,7 @@

#import <AppKit/AppKit.h>

#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING (__MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 || PLATFORM(CHROMIUM))
#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING (__MAC_OS_X_VERSION_MIN_REQUIRED <= 1070)

#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING

0 comments on commit bd654b7

Please sign in to comment.