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

Unified Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 203463007: Recompute overflow after transform changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests had been missing Created 6 years, 9 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/rendering/RenderLayerScrollableArea.cpp
diff --git a/Source/core/rendering/RenderLayerScrollableArea.cpp b/Source/core/rendering/RenderLayerScrollableArea.cpp
index f853c269513d06935c90b40684118bb58a9ec078..f5c00bcf59f22c434ac97b3d73a62786f3fc819b 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.cpp
+++ b/Source/core/rendering/RenderLayerScrollableArea.cpp
@@ -749,6 +749,26 @@ void RenderLayerScrollableArea::updateAfterStyleChange(const RenderStyle* oldSty
updateResizerStyle();
}
+void RenderLayerScrollableArea::updateAfterOverflowRecalc()
+{
+ computeScrollDimensions();
+ if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
+ int clientWidth = m_box->pixelSnappedClientWidth();
+ horizontalScrollbar->setProportion(clientWidth, overflowRect().width());
+ }
+ if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
+ int clientHeight = m_box->pixelSnappedClientHeight();
+ verticalScrollbar->setProportion(clientHeight, overflowRect().height());
+ }
+
+ bool hasHorizontalOverflow = this->hasHorizontalOverflow();
+ bool hasVerticalOverflow = this->hasVerticalOverflow();
+ bool autoHorizontalScrollBarChanged = m_box->hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
+ bool autoVerticalScrollBarChanged = m_box->hasAutoVerticalScrollbar() && (hasVerticalScrollbar() != hasVerticalOverflow);
+ if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged)
+ m_box->setNeedsLayout();
+}
+
IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset) const
{
int maxX = scrollWidth() - m_box->pixelSnappedClientWidth();

Powered by Google App Engine
This is Rietveld 408576698