Diff
Modified: trunk/Source/WebCore/ChangeLog (92237 => 92238)
--- trunk/Source/WebCore/ChangeLog 2011-08-02 21:36:52 UTC (rev 92237)
+++ trunk/Source/WebCore/ChangeLog 2011-08-02 22:11:30 UTC (rev 92238)
@@ -1,3 +1,25 @@
+2011-08-02 Sailesh Agrawal <[email protected]>
+
+ Chromium: Update forked ScrollbarThemeChromiumMac.mm
+ https://bugs.webkit.org/show_bug.cgi?id=65555
+
+ Merge recent changes to ScrollbarThemeMac.mm to ScrollbarThemeChromiumMac.mm.
+
+ Reviewed by James Robinson.
+
+ * platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h:
+ * platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm:
+ (wkScrollbarPainterSetEnabled):
+ * platform/chromium/ScrollbarThemeChromiumMac.h:
+ (WebCore::ScrollbarThemeChromiumMac::maxOverlapBetweenPages):
+ * platform/chromium/ScrollbarThemeChromiumMac.mm:
+ (WebCore::ScrollbarThemeChromiumMac::registerScrollbar):
+ (WebCore::ScrollbarThemeChromiumMac::setNewPainterForScrollbar):
+ (WebCore::toScrollbarPainterKnobStyle):
+ (WebCore::ScrollbarThemeChromiumMac::updateScrollbarOverlayStyle):
+ (WebCore::ScrollbarThemeChromiumMac::updateEnabledState):
+ (WebCore::ScrollbarThemeChromiumMac::paint):
+
2011-08-02 Mark Pilgrim <[email protected]>
Remove LegacyDefaultOptionalArguments flag from SVG IDL files
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h (92237 => 92238)
--- trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h 2011-08-02 21:36:52 UTC (rev 92237)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h 2011-08-02 22:11:30 UTC (rev 92238)
@@ -61,6 +61,7 @@
void wkScrollbarPainterPaintKnob(WKScrollbarPainterRef);
int wkScrollbarMinimumThumbLength(WKScrollbarPainterRef);
void wkScrollbarPainterSetDelegate(WKScrollbarPainterRef, id scrollbarPainterDelegate);
+void wkScrollbarPainterSetEnabled(WKScrollbarPainterRef, bool enabled);
CGFloat wkScrollbarPainterTrackAlpha(WKScrollbarPainterRef);
WKScrollbarPainterRef wkMakeScrollbarPainter(int controlSize, bool isHorizontal);
int wkScrollbarThickness(int controlSize);
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm (92237 => 92238)
--- trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm 2011-08-02 21:36:52 UTC (rev 92237)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm 2011-08-02 22:11:30 UTC (rev 92238)
@@ -187,6 +187,11 @@
[painter setDelegate:scrollbarPainterDelegate];
}
+void wkScrollbarPainterSetEnabled(WKScrollbarPainterRef painter, bool enabled)
+{
+ [painter setEnabled:enabled];
+}
+
CGFloat wkScrollbarPainterTrackAlpha(WKScrollbarPainterRef painter)
{
return [painter trackAlpha];
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h (92237 => 92238)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-08-02 21:36:52 UTC (rev 92237)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-08-02 22:11:30 UTC (rev 92238)
@@ -40,12 +40,15 @@
ScrollbarThemeChromiumMac();
virtual ~ScrollbarThemeChromiumMac();
+ virtual void updateEnabledState(Scrollbar*);
+
virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
virtual bool supportsControlTints() const { return true; }
virtual bool usesOverlayScrollbars() const;
+ virtual void updateScrollbarOverlayStyle(Scrollbar*);
virtual double initialAutoscrollTimerDelay();
virtual double autoscrollTimerDelay();
@@ -66,6 +69,8 @@
virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
virtual IntRect trackRect(Scrollbar*, bool painting = false);
+ virtual int maxOverlapBetweenPages() { return 40; }
+
virtual int minimumThumbLength(Scrollbar*);
virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm (92237 => 92238)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-08-02 21:36:52 UTC (rev 92237)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-08-02 22:11:30 UTC (rev 92238)
@@ -163,6 +163,8 @@
bool isHorizontal = scrollbar->orientation() == HorizontalScrollbar;
WKScrollbarPainterRef scrollbarPainter = wkMakeScrollbarPainter(scrollbar->controlSize(), isHorizontal);
scrollbarMap()->add(scrollbar, scrollbarPainter);
+ updateEnabledState(scrollbar);
+ updateScrollbarOverlayStyle(scrollbar);
}
void ScrollbarThemeChromiumMac::unregisterScrollbar(Scrollbar* scrollbar)
@@ -173,6 +175,8 @@
void ScrollbarThemeChromiumMac::setNewPainterForScrollbar(Scrollbar* scrollbar, WKScrollbarPainterRef newPainter)
{
scrollbarMap()->set(scrollbar, newPainter);
+ updateEnabledState(scrollbar);
+ updateScrollbarOverlayStyle(scrollbar);
}
WKScrollbarPainterRef ScrollbarThemeChromiumMac::painterForScrollbar(Scrollbar* scrollbar)
@@ -220,6 +224,25 @@
return false;
}
+static inline wkScrollerKnobStyle toScrollbarPainterKnobStyle(ScrollbarOverlayStyle style)
+{
+ switch (style) {
+ case ScrollbarOverlayStyleDark:
+ return wkScrollerKnobStyleDark;
+ case ScrollbarOverlayStyleLight:
+ return wkScrollerKnobStyleLight;
+ default:
+ return wkScrollerKnobStyleDefault;
+ }
+}
+
+void ScrollbarThemeChromiumMac::updateScrollbarOverlayStyle(Scrollbar* scrollbar)
+{
+ if (isScrollbarOverlayAPIAvailable()) {
+ wkSetScrollbarPainterKnobStyle(painterForScrollbar(scrollbar), toScrollbarPainterKnobStyle(scrollbar->scrollableArea()->scrollbarOverlayStyle()));
+ }
+}
+
double ScrollbarThemeChromiumMac::initialAutoscrollTimerDelay()
{
return gInitialButtonDelay;
@@ -424,18 +447,6 @@
}
}
-static inline wkScrollerKnobStyle toScrollbarPainterKnobStyle(ScrollbarOverlayStyle style)
-{
- switch (style) {
- case ScrollbarOverlayStyleDark:
- return wkScrollerKnobStyleDark;
- case ScrollbarOverlayStyleLight:
- return wkScrollerKnobStyleLight;
- default:
- return wkScrollerKnobStyleDefault;
- }
-}
-
static PlatformBridge::ThemePaintState scrollbarStateToThemeState(Scrollbar* scrollbar) {
if (!scrollbar->enabled())
return PlatformBridge::StateDisabled;
@@ -447,6 +458,13 @@
return PlatformBridge::StateActive;
}
+void ScrollbarThemeChromiumMac::updateEnabledState(Scrollbar* scrollbar)
+{
+ if (isScrollbarOverlayAPIAvailable()) {
+ wkScrollbarPainterSetEnabled(scrollbarMap()->get(scrollbar).get(), scrollbar->enabled());
+ }
+}
+
bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& damageRect)
{
if (isScrollbarOverlayAPIAvailable()) {
@@ -477,8 +495,6 @@
scrollAnimator->setIsDrawingIntoLayer(false);
#endif
- wkSetScrollbarPainterKnobStyle(painterForScrollbar(scrollbar), toScrollbarPainterKnobStyle(scrollbar->scrollableArea()->scrollbarOverlayStyle()));
-
GraphicsContextStateSaver stateSaver(*context);
context->clip(damageRect);
context->translate(scrollbar->frameRect().x(), scrollbar->frameRect().y());