Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Unified Diff: Source/core/layout/LayerScrollableArea.cpp

Issue 949303002: Fix invalidation during painting of scrollbars (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TestExpectations Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/LayerScrollableArea.cpp
diff --git a/Source/core/layout/LayerScrollableArea.cpp b/Source/core/layout/LayerScrollableArea.cpp
index 44f874f309ad6a9bcaf31b50d2d43a52bd3f1c9a..3f0a4b0d985db778efa6a5b0dc40bbc0958e70a0 100644
--- a/Source/core/layout/LayerScrollableArea.cpp
+++ b/Source/core/layout/LayerScrollableArea.cpp
@@ -706,10 +706,8 @@ void LayerScrollableArea::updateAfterLayout()
bool hasOverflow = hasScrollableHorizontalOverflow() || hasScrollableVerticalOverflow();
updateScrollableAreaSet(hasOverflow);
- if (hasOverflow) {
- DisableCompositingQueryAsserts disabler;
- positionOverflowControls(IntSize());
- }
+ DisableCompositingQueryAsserts disabler;
+ positionOverflowControls();
Julien - ping for review 2015/02/25 01:43:36 If we have no overflow it seems wasteful to call p
Xianzhu 2015/02/25 01:57:09 Even if we have no overflow, we can still have scr
}
bool LayerScrollableArea::hasHorizontalOverflow() const
@@ -1007,23 +1005,17 @@ int LayerScrollableArea::horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy
return m_hBar->height();
}
-void LayerScrollableArea::positionOverflowControls(const IntSize& offsetFromRoot)
+void LayerScrollableArea::positionOverflowControls()
{
if (!hasScrollbar() && !box().canResize())
return;
const IntRect borderBox = box().pixelSnappedBorderBoxRect();
- if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
- IntRect vBarRect = rectForVerticalScrollbar(borderBox);
- vBarRect.move(offsetFromRoot);
- verticalScrollbar->setFrameRect(vBarRect);
- }
+ if (Scrollbar* verticalScrollbar = this->verticalScrollbar())
+ verticalScrollbar->setFrameRect(rectForVerticalScrollbar(borderBox));
- if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
- IntRect hBarRect = rectForHorizontalScrollbar(borderBox);
- hBarRect.move(offsetFromRoot);
- horizontalScrollbar->setFrameRect(hBarRect);
- }
+ if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar())
+ horizontalScrollbar->setFrameRect(rectForHorizontalScrollbar(borderBox));
const IntRect& scrollCorner = scrollCornerRect();
if (m_scrollCorner)
@@ -1036,7 +1028,7 @@ void LayerScrollableArea::positionOverflowControls(const IntSize& offsetFromRoot
// controls get correctly positioned on a compositor update. For now, conservatively
// leaving this unchanged.
if (layer()->hasCompositedLayerMapping())
- layer()->compositedLayerMapping()->positionOverflowControlsLayers(offsetFromRoot);
+ layer()->compositedLayerMapping()->positionOverflowControlsLayers();
}
void LayerScrollableArea::updateScrollCornerStyle()

Powered by Google App Engine
This is Rietveld 408576698