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

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

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle case when overflow-x:hidden and y:scroll 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/LayoutTextControl.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp b/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp
index ebe5ed1cbe5d06093aa6be13bfbbb3156091b82f..02f553922f8d48f0fa3607150dcc5317ffdfc4e5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp
@@ -26,6 +26,7 @@
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutTheme.h"
#include "core/layout/TextRunConstructor.h"
+#include "core/paint/DeprecatedPaintLayer.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "wtf/text/CharacterNames.h"
@@ -80,6 +81,23 @@ void LayoutTextControl::styleDidChange(StyleDifference diff, const ComputedStyle
textFormControlElement()->updatePlaceholderVisibility();
}
+void LayoutTextControl::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY, bool programmaticScroll)
bokan 2015/09/25 22:26:26 I'm not up to speed on what LayoutObjects LayoutTe
+{
+ LayoutRect newRect = rect;
+
+ // Bring the innerEditor into view first because the scrollRectToVisible call
+ // on it skipped it because it has overflow:hidden. See changes made pertaining
+ // to crbug.com/531525.
+ Element* innerEditor = innerEditorElement();
+ if (!innerEditor)
+ return;
+ LayoutBlock* innerEditorLayoutObject = toLayoutBlock(innerEditor->layoutObject());
+ if (innerEditorLayoutObject && innerEditorLayoutObject->hasOverflowClip() && !innerEditorLayoutObject->scrollRestrictedByLineClamp()) {
+ newRect = innerEditorLayoutObject->layer()->scrollableArea()->scrollIntoView(rect, alignX, alignY);
+ }
+ LayoutBox::scrollRectToVisible(newRect, alignX, alignY, programmaticScroll);
+}
+
static inline void updateUserModifyProperty(HTMLTextFormControlElement& node, ComputedStyle& style)
{
style.setUserModify(node.isDisabledOrReadOnly() ? READ_ONLY : READ_WRITE_PLAINTEXT_ONLY);

Powered by Google App Engine
This is Rietveld 408576698