Diff
Modified: branches/safari-536-branch/Source/WebCore/ChangeLog (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/ChangeLog 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/ChangeLog 2012-05-15 20:05:44 UTC (rev 117131)
@@ -1,5 +1,52 @@
2012-05-15 Lucas Forschler <[email protected]>
+ Merge 116570
+
+ 2012-05-09 Beth Dakin <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=86025
+ RTL and vertical text documents do no scroll properly with the new
+ tiled scrolling model
+ -and corresponding-
+ <rdar://problem/11077589>
+
+ Reviewed by Dan Bernstein.
+
+ Most of the fix here is just to teach the scrolling tree about the
+ scroll origin.
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
+ (WebCore::ScrollingCoordinator::setScrollParameters):
+ * page/scrolling/ScrollingCoordinator.h:
+ (ScrollParameters):
+ * page/scrolling/ScrollingTreeNode.cpp:
+ (WebCore::ScrollingTreeNode::update):
+ * page/scrolling/ScrollingTreeNode.h:
+ (WebCore::ScrollingTreeNode::scrollOrigin):
+ (ScrollingTreeNode):
+ * page/scrolling/ScrollingTreeState.cpp:
+ (WebCore::ScrollingTreeState::setScrollOrigin):
+ (WebCore):
+ * page/scrolling/ScrollingTreeState.h:
+ (WebCore::ScrollingTreeState::scrollOrigin):
+ (ScrollingTreeState):
+ * page/scrolling/mac/ScrollingTreeNodeMac.mm:
+ (WebCore::ScrollingTreeNodeMac::scrollPosition):
+ (WebCore::ScrollingTreeNodeMac::setScrollLayerPosition):
+ (WebCore::ScrollingTreeNodeMac::minimumScrollPosition):
+ (WebCore::ScrollingTreeNodeMac::maximumScrollPosition):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::frameViewDidScroll):
+
+ Teaching the scrolling tree about the scroll origin revealed this pre-
+ existing bug. layoutOverflowRect() is not the right rect to use since
+ it is not writing-mode savvy. unscaledDocumentRect() is the right rect
+ for the view's bounds.
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateCompositedBounds):
+
+2012-05-15 Lucas Forschler <[email protected]>
+
Merge 116473
2012-05-08 Jon Lee <[email protected]>
Modified: branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-05-15 20:05:44 UTC (rev 117131)
@@ -149,6 +149,7 @@
scrollParameters.horizontalScrollbarMode = frameView->horizontalScrollbarMode();
scrollParameters.verticalScrollbarMode = frameView->verticalScrollbarMode();
+ scrollParameters.scrollOrigin = frameView->scrollOrigin();
scrollParameters.viewportRect = IntRect(IntPoint(), frameView->visibleContentRect().size());
scrollParameters.contentsSize = frameView->contentsSize();
@@ -360,6 +361,7 @@
m_scrollingTreeState->setHorizontalScrollbarMode(scrollParameters.horizontalScrollbarMode);
m_scrollingTreeState->setVerticalScrollbarMode(scrollParameters.verticalScrollbarMode);
+ m_scrollingTreeState->setScrollOrigin(scrollParameters.scrollOrigin);
m_scrollingTreeState->setViewportRect(scrollParameters.viewportRect);
m_scrollingTreeState->setContentsSize(scrollParameters.contentsSize);
scheduleTreeStateCommit();
Modified: branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-05-15 20:05:44 UTC (rev 117131)
@@ -135,6 +135,8 @@
ScrollbarMode horizontalScrollbarMode;
ScrollbarMode verticalScrollbarMode;
+ IntPoint scrollOrigin;
+
IntRect viewportRect;
IntSize contentsSize;
};
Modified: branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp 2012-05-15 20:05:44 UTC (rev 117131)
@@ -76,6 +76,9 @@
if (state->changedProperties() & ScrollingTreeState::VerticalScrollbarMode)
m_verticalScrollbarMode = state->verticalScrollbarMode();
+
+ if (state->changedProperties() & ScrollingTreeState::ScrollOrigin)
+ m_scrollOrigin = state->scrollOrigin();
}
} // namespace WebCore
Modified: branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeNode.h (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeNode.h 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeNode.h 2012-05-15 20:05:44 UTC (rev 117131)
@@ -65,11 +65,14 @@
bool canHaveScrollbars() const { return m_horizontalScrollbarMode != ScrollbarAlwaysOff || m_verticalScrollbarMode != ScrollbarAlwaysOff; }
+ const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
+
private:
ScrollingTree* m_scrollingTree;
IntRect m_viewportRect;
IntSize m_contentsSize;
+ IntPoint m_scrollOrigin;
bool m_shouldUpdateScrollLayerPositionOnMainThread;
Modified: branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeState.cpp (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeState.cpp 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeState.cpp 2012-05-15 20:05:44 UTC (rev 117131)
@@ -157,6 +157,15 @@
m_changedProperties |= RequestedScrollPosition;
}
+void ScrollingTreeState::setScrollOrigin(const IntPoint& scrollOrigin)
+{
+ if (m_scrollOrigin == scrollOrigin)
+ return;
+
+ m_scrollOrigin = scrollOrigin;
+ m_changedProperties |= ScrollOrigin;
+}
+
PassOwnPtr<ScrollingTreeState> ScrollingTreeState::commit()
{
OwnPtr<ScrollingTreeState> treeState = adoptPtr(new ScrollingTreeState(*this));
Modified: branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeState.h (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeState.h 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/page/scrolling/ScrollingTreeState.h 2012-05-15 20:05:44 UTC (rev 117131)
@@ -61,8 +61,9 @@
HasEnabledVerticalScrollbar = 1 << 8,
HorizontalScrollbarMode = 1 << 9,
VerticalScrollbarMode = 1 << 10,
- ScrollLayer = 1 << 11,
- RequestedScrollPosition = 1 << 12,
+ ScrollOrigin = 1 << 11,
+ ScrollLayer = 1 << 12,
+ RequestedScrollPosition = 1 << 13,
};
bool hasChangedProperties() const { return m_changedProperties; }
@@ -107,6 +108,9 @@
const IntPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
void setRequestedScrollPosition(const IntPoint&);
+ const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
+ void setScrollOrigin(const IntPoint&);
+
// Copies the current tree state and clears the changed properties mask in the original.
PassOwnPtr<ScrollingTreeState> commit();
@@ -134,6 +138,7 @@
ScrollbarMode m_verticalScrollbarMode;
IntPoint m_requestedScrollPosition;
+ IntPoint m_scrollOrigin;
#if PLATFORM(MAC)
RetainPtr<PlatformLayer> m_platformScrollLayer;
Modified: branches/safari-536-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm 2012-05-15 20:05:44 UTC (rev 117131)
@@ -237,24 +237,22 @@
return m_probableMainThreadScrollPosition;
CGPoint scrollLayerPosition = m_scrollLayer.get().position;
- return IntPoint(-scrollLayerPosition.x, -scrollLayerPosition.y);
+ return IntPoint(-scrollLayerPosition.x + scrollOrigin().x(), -scrollLayerPosition.y + scrollOrigin().y());
}
void ScrollingTreeNodeMac::setScrollLayerPosition(const IntPoint& position)
{
ASSERT(!shouldUpdateScrollLayerPositionOnMainThread());
- m_scrollLayer.get().position = CGPointMake(-position.x(), -position.y());
+ m_scrollLayer.get().position = CGPointMake(-position.x() + scrollOrigin().x(), -position.y() + scrollOrigin().y());
}
IntPoint ScrollingTreeNodeMac::minimumScrollPosition() const
{
- // FIXME: This should take the scroll origin into account.
return IntPoint(0, 0);
}
IntPoint ScrollingTreeNodeMac::maximumScrollPosition() const
{
- // FIXME: This should take the scroll origin into account.
IntPoint position(contentsSize().width() - viewportRect().width(),
contentsSize().height() - viewportRect().height());
Modified: branches/safari-536-branch/Source/WebCore/rendering/RenderLayerBacking.cpp (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2012-05-15 20:05:44 UTC (rev 117131)
@@ -262,7 +262,7 @@
RenderLayer* rootLayer = view->layer();
// Start by clipping to the view's bounds.
- LayoutRect clippingBounds = view->layoutOverflowRect();
+ LayoutRect clippingBounds = view->unscaledDocumentRect();
if (m_owningLayer != rootLayer)
clippingBounds.intersect(m_owningLayer->backgroundClipRect(rootLayer, 0, true).rect()); // FIXME: Incorrect for CSS regions.
Modified: branches/safari-536-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (117130 => 117131)
--- branches/safari-536-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-05-15 20:03:43 UTC (rev 117130)
+++ branches/safari-536-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-05-15 20:05:44 UTC (rev 117131)
@@ -1040,8 +1040,11 @@
FrameView* frameView = m_renderView->frameView();
IntPoint scrollPosition = frameView->scrollPosition();
- if (TiledBacking* tiledBacking = frameView->tiledBacking())
- tiledBacking->visibleRectChanged(frameView->visibleContentRect(false /* exclude scrollbars */));
+ if (TiledBacking* tiledBacking = frameView->tiledBacking()) {
+ IntRect visibleContentRect = frameView->visibleContentRect(false /* exclude scrollbars */);
+ visibleContentRect.move(toSize(frameView->scrollOrigin()));
+ tiledBacking->visibleRectChanged(visibleContentRect);
+ }
if (!m_scrollLayer)
return;