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