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

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

Issue 804343007: Make RenderBox::scrollToOffset check for overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing file Created 6 years 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 | « LayoutTests/fast/scroll-behavior/scroll-element-without-overflow-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 4c28db6039a963c35c85e375c7223f0929b87c18..733d523fc6b7770c3fc16527f2b404a9aa31fb97 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -426,12 +426,12 @@ void RenderBox::setScrollTop(LayoutUnit newTop)
void RenderBox::scrollToOffset(const DoubleSize& offset, ScrollBehavior scrollBehavior)
{
- ASSERT(hasOverflowClip());
-
// This doesn't hit in any tests, but since the equivalent code in setScrollTop
// does, presumably this code does as well.
DisableCompositingQueryAsserts disabler;
- layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped, scrollBehavior);
+
+ if (hasOverflowClip())
+ layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped, scrollBehavior);
}
static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameElementBase, FrameView* frameView)
« no previous file with comments | « LayoutTests/fast/scroll-behavior/scroll-element-without-overflow-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698