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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 691863003: Add a setting to do frame scrolls through the root layer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | « no previous file | Source/core/frame/Settings.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index d5bf83aa8aecf7602cb2c174a742c86203a68ac7..0de05a9afddf16597794d73fd931bbfc17820627 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2178,6 +2178,11 @@ void FrameView::scrollTo(const DoublePoint& newPosition)
if (scrollDelta.isZero())
return;
+ if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) {
+ // Don't scroll the FrameView!
+ ASSERT_NOT_REACHED();
+ }
+
m_scrollPosition = newPosition;
if (!scrollbarsSuppressed())
@@ -2905,6 +2910,9 @@ bool FrameView::wheelEvent(const PlatformWheelEvent& wheelEvent)
allowScrolling = false;
#endif
+ if (m_frame->settings()->rootLayerScrolls())
+ allowScrolling = false;
+
if (allowScrolling && ScrollableArea::handleWheelEvent(wheelEvent))
return true;
@@ -3248,6 +3256,9 @@ void FrameView::computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool&
newHasHorizontalScrollbar = hasHorizontalScrollbar;
newHasVerticalScrollbar = hasVerticalScrollbar;
+ if (m_frame->settings() && m_frame->settings()->rootLayerScrolls())
+ return;
+
ScrollbarMode hScroll = m_horizontalScrollbarMode;
ScrollbarMode vScroll = m_verticalScrollbarMode;
@@ -3748,7 +3759,7 @@ void FrameView::calculateOverhangAreasForPainting(IntRect& horizontalOverhangRec
horizontalOverhangRect = frameRect();
horizontalOverhangRect.setHeight(-physicalScrollY);
horizontalOverhangRect.setWidth(horizontalOverhangRect.width() - verticalScrollbarWidth);
- } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) {
+ } else if (physicalScrollY > 0 && contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) {
int height = physicalScrollY - (contentsHeight() - visibleHeight());
horizontalOverhangRect = frameRect();
horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight);
@@ -3765,7 +3776,7 @@ void FrameView::calculateOverhangAreasForPainting(IntRect& horizontalOverhangRec
verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
else
verticalOverhangRect.setY(frameRect().y());
- } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) {
+ } else if (physicalScrollX > 0 && contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) {
int width = physicalScrollX - (contentsWidth() - visibleWidth());
verticalOverhangRect.setWidth(width);
verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height() - horizontalScrollbarHeight);
« no previous file with comments | « no previous file | Source/core/frame/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698