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

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

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Worked on review comments 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/LayoutTextControlSingleLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp b/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
index 32fbfe5c4488431415cf20f508d4e13f211addd5..f4433670313e5640d583d874aec161260712067b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
@@ -351,16 +351,31 @@ LayoutUnit LayoutTextControlSingleLine::computeControlLogicalHeight(LayoutUnit l
return lineHeight + nonContentHeight;
}
-PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(const ComputedStyle& startStyle) const
+void LayoutTextControlSingleLine::addScrollbarPeudoStyle()
ymalik 2015/10/01 22:25:31 Added this method for input fields that default to
skobes 2015/10/01 22:40:19 It would be better to have this in one place inste
ymalik 2015/10/03 20:49:21 Removed the logic from html.css Discussed this in
{
+ if (!style()->hasPseudoStyle(SCROLLBAR)) {
+ RefPtr<ComputedStyle> noScrollbarStyle = ComputedStyle::create();
+ noScrollbarStyle->setStyleType(SCROLLBAR);
+ noScrollbarStyle->setDisplay(NONE);
+
+ mutableStyleRef().addCachedPseudoStyle(noScrollbarStyle);
+ mutableStyleRef().setHasPseudoStyle(SCROLLBAR);
+ }
+}
+
+PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(const ComputedStyle& startStyle)
+{
+ addScrollbarPeudoStyle();
RefPtr<ComputedStyle> textBlockStyle = ComputedStyle::create();
textBlockStyle->inheritFrom(startStyle);
adjustInnerEditorStyle(*textBlockStyle);
textBlockStyle->setWhiteSpace(PRE);
textBlockStyle->setOverflowWrap(NormalOverflowWrap);
- textBlockStyle->setOverflowX(OHIDDEN);
- textBlockStyle->setOverflowY(OHIDDEN);
+ // Note that although overflowX/Y is set to scroll, the scrollbars will be
+ // hidden by the SCROLLBAR pseudo style added above.
+ textBlockStyle->setOverflowX(OSCROLL);
+ textBlockStyle->setOverflowY(OSCROLL);
textBlockStyle->setTextOverflow(textShouldBeTruncated() ? TextOverflowEllipsis : TextOverflowClip);
if (m_desiredInnerEditorLogicalHeight >= 0)

Powered by Google App Engine
This is Rietveld 408576698