is set
https://bugs.webkit.org/show_bug.cgi?id=116493
-and corresponding-
<rdar://problem/
13912871>
Reviewed by Dean Jackson.
We need to be more aggressive with our approach since AppKit may still ask the
scrollbars to paint here.
scrollbarAnimationsAreSuppressed() will allow us to find out if the setting has
been set.
* page/FrameView.cpp:
(WebCore::FrameView::scrollbarAnimationsAreSuppressed):
* page/FrameView.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::scrollbarAnimationsAreSuppressed):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollbarAnimationsAreSuppressed):
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollbarAnimationsAreSuppressed):
* rendering/RenderListBox.h:
Don’t allow animations if scrollbars are suppressed.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
Call cancelAnimations() to prevent a just-started animation from continuing.
(WebCore::ScrollAnimatorMac::finishCurrentScrollAnimations):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150399
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-05-20 Beth Dakin <bdakin@apple.com>
+
+ Scrollbars still show sometimes even when WKPageSetSuppressScrollbarAnimations()
+ is set
+ https://bugs.webkit.org/show_bug.cgi?id=116493
+ -and corresponding-
+ <rdar://problem/13912871>
+
+ Reviewed by Dean Jackson.
+
+ We need to be more aggressive with our approach since AppKit may still ask the
+ scrollbars to paint here.
+
+ scrollbarAnimationsAreSuppressed() will allow us to find out if the setting has
+ been set.
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollbarAnimationsAreSuppressed):
+ * page/FrameView.h:
+ * platform/ScrollableArea.h:
+ (WebCore::ScrollableArea::scrollbarAnimationsAreSuppressed):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollbarAnimationsAreSuppressed):
+ * rendering/RenderLayer.h:
+ (RenderLayer):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::scrollbarAnimationsAreSuppressed):
+ * rendering/RenderListBox.h:
+
+ Don’t allow animations if scrollbars are suppressed.
+ * platform/mac/ScrollAnimatorMac.mm:
+ (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
+
+ Call cancelAnimations() to prevent a just-started animation from continuing.
+ (WebCore::ScrollAnimatorMac::finishCurrentScrollAnimations):
+
2013-05-20 Andreas Kling <akling@apple.com>
Avoid caret repaints if we're not showing carets anyway.
#endif // ENABLE(RUBBER_BANDING)
+bool FrameView::scrollbarAnimationsAreSuppressed() const
+{
+ Page* page = frame() ? frame()->page() : 0;
+ if (!page)
+ return true;
+ return page->shouldSuppressScrollbarAnimations();
+}
+
bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush)
{
RenderView* renderView = this->renderView();
virtual void willStartLiveResize() OVERRIDE;
virtual void willEndLiveResize() OVERRIDE;
+ virtual bool scrollbarAnimationsAreSuppressed() const OVERRIDE;
+
void addPaintPendingMilestones(LayoutMilestones);
void firePaintRelatedMilestones();
LayoutMilestones milestonesPendingPaint() const { return m_milestonesPendingPaint; }
void contentAreaDidHide() const;
void finishCurrentScrollAnimations() const;
+ virtual bool scrollbarAnimationsAreSuppressed() const { return false; }
virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation);
virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation);
ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
ScrollbarPainter scrollerPainter = (ScrollbarPainter)scrollerImp;
+ if (_scrollbar->scrollableArea()->scrollbarAnimationsAreSuppressed()) {
+ [scrollerImp setKnobAlpha:0];
+ _scrollbar->invalidate();
+ return;
+ }
+
[self setUpAlphaAnimation:_knobAlphaAnimation scrollerPainter:scrollerPainter part:WebCore::ThumbPart animateAlphaTo:newKnobAlpha duration:duration];
}
void ScrollAnimatorMac::finishCurrentScrollAnimations()
{
- if (isScrollbarOverlayAPIAvailable()) {
+ cancelAnimations();
+
+ if (isScrollbarOverlayAPIAvailable())
[m_scrollbarPainterController.get() hideOverlayScrollers];
- }
}
void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar* scrollbar)
return renderer()->absoluteBoundingBoxRect();
}
+bool RenderLayer::scrollbarAnimationsAreSuppressed() const
+{
+ RenderView* view = renderer()->view();
+ if (!view)
+ return false;
+ return view->frameView()->scrollbarsCanBeActive();
+}
+
RenderLayer* RenderLayer::enclosingTransformedAncestor() const
{
RenderLayer* curr = parent();
virtual bool shouldSuspendScrollAnimations() const;
virtual bool scrollbarsCanBeActive() const;
virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
+ virtual bool scrollbarAnimationsAreSuppressed() const OVERRIDE;
// Rectangle encompassing the scroll corner and resizer rect.
IntRect scrollCornerAndResizerRect() const;
return view->frameView()->scrollbarsCanBeActive();
}
+bool RenderListBox::scrollbarAnimationsAreSuppressed() const
+{
+ RenderView* view = this->view();
+ if (!view)
+ return false;
+ return view->frameView()->scrollbarAnimationsAreSuppressed();
+}
+
ScrollableArea* RenderListBox::enclosingScrollableArea() const
{
// FIXME: Return a RenderLayer that's scrollable.
virtual bool isHandlingWheelEvent() const OVERRIDE;
virtual bool shouldSuspendScrollAnimations() const OVERRIDE;
virtual bool scrollbarsCanBeActive() const OVERRIDE;
+ virtual bool scrollbarAnimationsAreSuppressed() const OVERRIDE;
virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE;
virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;