| Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
|
| index 087eaa3ce71a05b843d9fc3e4dfbb19d7e495d8f..e40d3bc920c23b7226720a12b1ce82c5464b6cff 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
|
| @@ -596,6 +596,9 @@ void PaintLayerScrollableArea::computeScrollDimensions()
|
| int scrollableLeftOverflow = m_overflowRect.x() - box().borderLeft() - (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? box().verticalScrollbarWidth() : 0);
|
| int scrollableTopOverflow = m_overflowRect.y() - box().borderTop();
|
| setScrollOrigin(IntPoint(-scrollableLeftOverflow, -scrollableTopOverflow));
|
| + fprintf(stderr, "origin=%i,%i\n", scrollOrigin().x(), scrollOrigin().y());
|
| + fprintf(stderr, "........overflowRect x = %f width = %f layoutRect x = %f width = %f\n", m_overflowRect.x().toFloat(), m_overflowRect.width().toFloat(), box().location().x().toFloat(), box().size().width().toFloat());
|
| + fprintf(stderr, "offset=%f,%f\n", m_scrollOffset.width(), m_scrollOffset.height());
|
| }
|
|
|
| void PaintLayerScrollableArea::scrollToPosition(const DoublePoint& scrollPosition, ScrollOffsetClamping clamp, ScrollBehavior scrollBehavior, ScrollType scrollType)
|
| @@ -607,6 +610,15 @@ void PaintLayerScrollableArea::scrollToPosition(const DoublePoint& scrollPositio
|
| ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollBehavior);
|
| }
|
|
|
| +void PaintLayerScrollableArea::clampPositionAfterLayout()
|
| +{
|
| + // Layout may cause us to be at an invalid scroll position. In this case we need
|
| + // to pull our scroll offsets back to the max (or push them up to the min).
|
| + DoublePoint clampedScrollPosition = clampScrollPosition(scrollPositionDouble());
|
| + if (clampedScrollPosition != scrollPositionDouble())
|
| + scrollToPosition(clampedScrollPosition);
|
| +}
|
| +
|
| bool PaintLayerScrollableArea::updateAfterLayout(SubtreeLayoutScope* delayedLayoutScope)
|
| {
|
| ASSERT(box().hasOverflowClip());
|
| @@ -624,18 +636,25 @@ bool PaintLayerScrollableArea::updateAfterLayout(SubtreeLayoutScope* delayedLayo
|
| IntPoint originalOrigin = scrollOrigin();
|
| computeScrollDimensions();
|
|
|
| - // Layout may cause us to be at an invalid scroll position. In this case we need
|
| - // to pull our scroll offsets back to the max (or push them up to the min).
|
| - DoublePoint clampedScrollPosition = clampScrollPosition(scrollPositionDouble());
|
| - if (clampedScrollPosition != scrollPositionDouble()) {
|
| - scrollToPosition(clampedScrollPosition);
|
| - } else if (originalOrigin != scrollOrigin()) {
|
| + fprintf(stderr, "updateAfterLayout -- origin is %i,%i offset %f,%f\n", scrollOrigin().x(), scrollOrigin().y(), scrollPositionDouble().x(), scrollPositionDouble().y());
|
| +
|
| + IntPoint newOrigin(scrollOrigin());
|
| + if (originalOrigin != newOrigin) {
|
| // TODO: We should be able to use scrollOriginChanged() here, but we can't because
|
| // PaintLayerScrollableArea does not maintain that flag: it gets set, but it never
|
| // gets unset. We should unset the flag after layout.
|
| - scrollPositionChanged(scrollPositionDouble(), ProgrammaticScroll);
|
| + DoubleSize originDiff(newOrigin - originalOrigin);
|
| + /*
|
| + if (originDiff.width() < 0)
|
| + originDiff.setWidth(0);
|
| + if (originDiff.height() < 0)
|
| + originDiff.setHeight(0);
|
| + */
|
| + scrollPositionChanged(scrollPositionDouble() + originDiff, ProgrammaticScroll);
|
| + fprintf(stderr, " adjusting position by %f,%f\n", originDiff.width(), originDiff.height());
|
| }
|
|
|
| +
|
| m_scrollbarManager.setCanDetachScrollbars(false);
|
|
|
| bool hasHorizontalOverflow = this->hasHorizontalOverflow();
|
|
|