diff options
Diffstat (limited to 'WebCore/page/FrameView.cpp')
-rw-r--r-- | WebCore/page/FrameView.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index 65c9920..92ee051 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -444,7 +444,16 @@ void FrameView::adjustViewSize() if (!root) return; - setContentsSize(IntSize(root->rightLayoutOverflow(), root->bottomLayoutOverflow())); + int prevScrollOriginX = scrollOriginX(); + ScrollView::setScrollOriginX(-root->leftLayoutOverflow()); + IntSize size = IntSize(root->rightLayoutOverflow() - root->leftLayoutOverflow(), root->bottomLayoutOverflow()); + // Take care of the case when contents remain but the RenderView's direction has changed. + // In which case, we need to update scroller position, for example, from leftmost to + // rightmost when direction changes from left-to-right to right-to-left. + bool directionChanged = (!prevScrollOriginX || !scrollOriginX()) && (scrollOriginX() != prevScrollOriginX); + if (size == contentsSize() && directionChanged) + ScrollView::updateScrollbars(); + setContentsSize(size); } void FrameView::applyOverflowToViewport(RenderObject* o, ScrollbarMode& hMode, ScrollbarMode& vMode) |