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

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

Issue 14703004: Reland "Unifies ScrollView and RenderLayer to use non-shi..." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 7 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
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerBacking.cpp
diff --git a/Source/core/rendering/RenderLayerBacking.cpp b/Source/core/rendering/RenderLayerBacking.cpp
index 44230d97dff274129eb0435a2839c3808e3266e8..167aed7f302286edbc6a776848b7871ba4da0273 100644
--- a/Source/core/rendering/RenderLayerBacking.cpp
+++ b/Source/core/rendering/RenderLayerBacking.cpp
@@ -676,24 +676,26 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
if (m_scrollingLayer) {
ASSERT(m_scrollingContentsLayer);
RenderBox* renderBox = toRenderBox(renderer());
- IntRect paddingBox(renderBox->borderLeft(), renderBox->borderTop(), renderBox->width() - renderBox->borderLeft() - renderBox->borderRight(), renderBox->height() - renderBox->borderTop() - renderBox->borderBottom());
- IntSize scrollOffset = m_owningLayer->adjustedScrollOffset();
+ IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect());
+ // FIXME: We should make RenderBox::clientBoxRect consider scrollbar placement.
+ if (style->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ clientBox.move(renderBox->verticalScrollbarWidth(), 0);
- m_scrollingLayer->setPosition(FloatPoint(paddingBox.location() - localCompositingBounds.location()));
-
- m_scrollingLayer->setSize(paddingBox.size());
- m_scrollingContentsLayer->setPosition(FloatPoint(-scrollOffset.width(), -scrollOffset.height()));
+ IntSize adjustedScrollOffset = m_owningLayer->adjustedScrollOffset();
+ m_scrollingLayer->setPosition(FloatPoint(clientBox.location() - localCompositingBounds.location()));
+ m_scrollingLayer->setSize(clientBox.size());
+ m_scrollingContentsLayer->setPosition(FloatPoint(-adjustedScrollOffset.width(), -adjustedScrollOffset.height()));
IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer();
- m_scrollingLayer->setOffsetFromRenderer(-toIntSize(paddingBox.location()));
+ m_scrollingLayer->setOffsetFromRenderer(-toIntSize(clientBox.location()));
- bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer();
+ bool clientBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer();
IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHeight());
- if (scrollSize != m_scrollingContentsLayer->size() || paddingBoxOffsetChanged)
+ if (scrollSize != m_scrollingContentsLayer->size() || clientBoxOffsetChanged)
m_scrollingContentsLayer->setNeedsDisplay();
- IntSize scrollingContentsOffset = toIntSize(paddingBox.location() - scrollOffset);
+ IntSize scrollingContentsOffset = toIntSize(clientBox.location() - adjustedScrollOffset);
if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRenderer() || scrollSize != m_scrollingContentsLayer->size())
compositor()->scrollingLayerDidChange(m_owningLayer);
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698