https://bugs.webkit.org/show_bug.cgi?id=141985
Reviewed by Beth Dakin.
Source/WebCore:
Switch to an enum class for the scrollbar style (normal or overlay).
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollbarStyleChanged):
* page/FrameView.h:
* platform/ScrollTypes.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollbarStyleChanged):
* platform/ScrollView.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::scrollbarStyleChanged):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
Source/WebKit2:
Switch to an enum class for the scrollbar style (normal or overlay).
Sadly it still has to be passed as an int across the process boundary.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::scrollbarStyleChanged):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::recommendedScrollbarStyleDidChange):
* WebProcess/WebCoreSupport/WebChromeClient.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180607
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-02-24 Simon Fraser <simon.fraser@apple.com>
+
+ Use an enum for scrollbar style
+ https://bugs.webkit.org/show_bug.cgi?id=141985
+
+ Reviewed by Beth Dakin.
+
+ Switch to an enum class for the scrollbar style (normal or overlay).
+
+ * page/ChromeClient.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollbarStyleChanged):
+ * page/FrameView.h:
+ * platform/ScrollTypes.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scrollbarStyleChanged):
+ * platform/ScrollView.h:
+ * platform/ScrollableArea.h:
+ (WebCore::ScrollableArea::scrollbarStyleChanged):
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::updateScrollerStyle):
+
2015-02-24 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r180599.
virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) { }
virtual void notifyScrollerThumbIsVisibleInRect(const IntRect&) { }
- virtual void recommendedScrollbarStyleDidChange(int /*newStyle*/) { }
+ virtual void recommendedScrollbarStyleDidChange(ScrollbarStyle) { }
enum DialogType {
AlertDialog = 0,
return frame().loader().state() != FrameStateComplete;
}
-void FrameView::scrollbarStyleChanged(int newStyle, bool forceUpdate)
+void FrameView::scrollbarStyleChanged(ScrollbarStyle newStyle, bool forceUpdate)
{
if (!frame().isMainFrame())
return;
void flushAnyPendingPostLayoutTasks();
virtual bool shouldSuspendScrollAnimations() const override;
- virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) override;
+ virtual void scrollbarStyleChanged(ScrollbarStyle, bool forceUpdate) override;
RenderBox* embeddedContentBox() const;
ScrollbarButtonsDoubleEnd,
ScrollbarButtonsDoubleBoth
};
+
+ enum class ScrollbarStyle {
+ AlwaysVisible,
+ Overlay
+ };
enum ScrollbarOverlayStyle {
ScrollbarOverlayStyleDefault,
return !scrollCornerRect().isEmpty();
}
-void ScrollView::scrollbarStyleChanged(int, bool forceUpdate)
+void ScrollView::scrollbarStyleChanged(ScrollbarStyle, bool forceUpdate)
{
if (!forceUpdate)
return;
virtual int scrollPosition(Scrollbar*) const override;
WEBCORE_EXPORT virtual void setScrollOffset(const IntPoint&) override;
virtual bool isScrollCornerVisible() const override;
- virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) override;
+ virtual void scrollbarStyleChanged(ScrollbarStyle, bool forceUpdate) override;
virtual void notifyPageThatContentAreaWillPaint() const;
WEBCORE_EXPORT IntSize totalContentsSize() const;
virtual bool shouldSuspendScrollAnimations() const { return true; }
- virtual void scrollbarStyleChanged(int /*newStyle*/, bool /*forceUpdate*/) { }
+ virtual void scrollbarStyleChanged(ScrollbarStyle, bool /*forceUpdate*/) { }
virtual void setVisibleScrollerThumbRect(const IntRect&) { }
// Note that this only returns scrollable areas that can actually be scrolled.
// If m_needsScrollerStyleUpdate is true, then the page is restoring from the page cache, and
// a relayout will happen on its own. Otherwise, we must initiate a re-layout ourselves.
- scrollableArea().scrollbarStyleChanged(newStyle, !m_needsScrollerStyleUpdate);
+ scrollableArea().scrollbarStyleChanged(newStyle == NSScrollerStyleOverlay ? ScrollbarStyle::Overlay : ScrollbarStyle::AlwaysVisible, !m_needsScrollerStyleUpdate);
m_needsScrollerStyleUpdate = false;
}
+2015-02-24 Simon Fraser <simon.fraser@apple.com>
+
+ Use an enum for scrollbar style
+ https://bugs.webkit.org/show_bug.cgi?id=141985
+
+ Reviewed by Beth Dakin.
+
+ Switch to an enum class for the scrollbar style (normal or overlay).
+
+ Sadly it still has to be passed as an int across the process boundary.
+
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
+ * UIProcess/mac/PageClientImpl.h:
+ * UIProcess/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
+ * WebProcess/Plugins/PDF/PDFPlugin.h:
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit::PDFPlugin::scrollbarStyleChanged):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::recommendedScrollbarStyleDidChange):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+
2015-02-24 Chris Dumez <cdumez@apple.com>
[Mac][WK2] ASSERTION FAILED: m_sendPort in IPC::Connection::open()
virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) = 0;
virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText) = 0;
virtual void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String& replacedString, const String& replacementString) = 0;
- virtual void recommendedScrollbarStyleDidChange(int32_t newStyle) = 0;
+ virtual void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle) = 0;
virtual void removeNavigationGestureSnapshot() = 0;
virtual CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const = 0;
void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle)
{
#if USE(APPKIT)
- m_pageClient.recommendedScrollbarStyleDidChange(newStyle);
+ m_pageClient.recommendedScrollbarStyleDidChange(static_cast<WebCore::ScrollbarStyle>(newStyle));
#else
UNUSED_PARAM(newStyle);
#endif
virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText) override;
virtual void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String& replacedString, const String& replacementString) override;
- virtual void recommendedScrollbarStyleDidChange(int32_t newStyle) override;
+ virtual void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle) override;
virtual WKView* wkView() const override { return m_wkView; }
virtual void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize) override;
CorrectionPanel::recordAutocorrectionResponse(m_wkView, response, replacedString, replacementString);
}
-void PageClientImpl::recommendedScrollbarStyleDidChange(int32_t newStyle)
+void PageClientImpl::recommendedScrollbarStyleDidChange(ScrollbarStyle newStyle)
{
// Now re-create a tracking area with the appropriate options given the new scrollbar style
NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect;
- if (newStyle == NSScrollerStyleLegacy)
+ if (newStyle == ScrollbarStyle::AlwaysVisible)
options |= NSTrackingActiveAlways;
else
options |= NSTrackingActiveInKeyWindow;
virtual WebCore::Scrollbar* horizontalScrollbar() const override { return m_horizontalScrollbar.get(); }
virtual WebCore::Scrollbar* verticalScrollbar() const override { return m_verticalScrollbar.get(); }
virtual bool shouldSuspendScrollAnimations() const override { return false; } // If we return true, ScrollAnimatorMac will keep cycling a timer forever, waiting for a good time to animate.
- virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) override;
+ virtual void scrollbarStyleChanged(WebCore::ScrollbarStyle, bool forceUpdate) override;
virtual WebCore::IntRect convertFromScrollbarToContainingView(const WebCore::Scrollbar*, const WebCore::IntRect& scrollbarRect) const override;
virtual WebCore::IntRect convertFromContainingViewToScrollbar(const WebCore::Scrollbar*, const WebCore::IntRect& parentRect) const override;
virtual WebCore::IntPoint convertFromScrollbarToContainingView(const WebCore::Scrollbar*, const WebCore::IntPoint& scrollbarPoint) const override;
return maximumOffset;
}
-void PDFPlugin::scrollbarStyleChanged(int, bool forceUpdate)
+void PDFPlugin::scrollbarStyleChanged(ScrollbarStyle style, bool forceUpdate)
{
if (!forceUpdate)
return;
m_page->send(Messages::WebPageProxy::NotifyScrollerThumbIsVisibleInRect(scrollerThumb));
}
-void WebChromeClient::recommendedScrollbarStyleDidChange(int32_t newStyle)
+void WebChromeClient::recommendedScrollbarStyleDidChange(ScrollbarStyle newStyle)
{
- m_page->send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(newStyle));
+ m_page->send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(static_cast<int32_t>(newStyle)));
}
Color WebChromeClient::underlayColor() const
virtual void dispatchViewportPropertiesDidChange(const WebCore::ViewportArguments&) const override;
virtual void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&) override;
- virtual void recommendedScrollbarStyleDidChange(int32_t newStyle) override;
+ virtual void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle newStyle) override;
virtual WebCore::Color underlayColor() const override;