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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos Created 5 years, 3 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
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 0272e0ac8552e1f0090d5ad84d5e849afad17c0b..c310ac2346f8c2fdf7649234c7ec754ee27e64d9 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -503,8 +503,9 @@ static bool isDisallowedAutoscroll(HTMLFrameOwnerElement* ownerElement, FrameVie
return false;
}
-void LayoutBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
+void LayoutBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType scrollType)
{
+ ASSERT(scrollType == ProgrammaticScroll || scrollType == UserScroll);
// Presumably the same issue as in setScrollTop. See crbug.com/343132.
DisableCompositingQueryAsserts disabler;
@@ -520,12 +521,12 @@ void LayoutBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen
if (hasOverflowClip() && !restrictedByLineClamp) {
// Don't scroll to reveal an overflow layer that is restricted by the -webkit-line-clamp property.
// This will prevent us from revealing text hidden by the slider in Safari RSS.
- newRect = layer()->scrollableArea()->scrollIntoView(rect, alignX, alignY);
+ newRect = layer()->scrollableArea()->scrollIntoView(rect, alignX, alignY, scrollType);
} else if (!parentBox && canBeProgramaticallyScrolled()) {
if (FrameView* frameView = this->frameView()) {
HTMLFrameOwnerElement* ownerElement = document().ownerElement();
if (!isDisallowedAutoscroll(ownerElement, frameView)) {
- frameView->scrollableArea()->scrollIntoView(rect, alignX, alignY);
+ frameView->scrollableArea()->scrollIntoView(rect, alignX, alignY, scrollType);
if (ownerElement && ownerElement->layoutObject()) {
if (frameView->safeToPropagateScrollToParent()) {
@@ -550,7 +551,7 @@ void LayoutBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen
parentBox = enclosingScrollableBox();
if (parentBox)
- parentBox->scrollRectToVisible(newRect, alignX, alignY);
+ parentBox->scrollRectToVisible(newRect, alignX, alignY, scrollType);
}
void LayoutBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
@@ -773,7 +774,7 @@ void LayoutBox::autoscroll(const IntPoint& positionInRootFrame)
return;
IntPoint positionInContent = frameView->rootFrameToContents(positionInRootFrame);
- scrollRectToVisible(LayoutRect(positionInContent, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+ scrollRectToVisible(LayoutRect(positionInContent, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded, UserScroll);
}
// There are two kinds of layoutObject that can autoscroll.

Powered by Google App Engine
This is Rietveld 408576698