We don't need to always repaint overlay scrollbars if they're in layers
[WebKit-https.git] / Source / WebCore / platform / ScrollableArea.cpp
index 374092eb2e92ede9b3a1b010a219f01f54593898..99b9babc3469f2252f509aeb43881d3ee8b7256d 100644 (file)
@@ -181,7 +181,7 @@ void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
     // Tell the scrollbars to update their thumb postions.
     if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
         horizontalScrollbar->offsetDidChange();
-        if (horizontalScrollbar->isOverlayScrollbar()) {
+        if (horizontalScrollbar->isOverlayScrollbar() && !hasLayerForHorizontalScrollbar()) {
             if (!verticalScrollbar)
                 horizontalScrollbar->invalidate();
             else {
@@ -195,7 +195,7 @@ void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
     }
     if (verticalScrollbar) {
         verticalScrollbar->offsetDidChange();
-        if (verticalScrollbar->isOverlayScrollbar())
+        if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrollbar())
             verticalScrollbar->invalidate();
     }
 }