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); |