Chromium Code Reviews| 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 820c0a70ea0a8799d252b7b87cf0b379e01b4d79..ef2dda0a89d353cfb6365864144cac52e79a5482 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp |
| @@ -273,8 +273,19 @@ PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(co |
| textBlockStyle->setOverflowWrap(NormalOverflowWrap); |
| textBlockStyle->setTextOverflow(textShouldBeTruncated() ? TextOverflowEllipsis : TextOverflowClip); |
| + int computedLineHeight = lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes); |
| // Do not allow line-height to be smaller than our default. |
| - if (textBlockStyle->fontSize() >= lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes) || !startStyle.logicalHeight().isIntrinsicOrAuto()) |
| + if (textBlockStyle->fontSize() >= computedLineHeight) |
| + textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); |
| + |
| + // We'd like to remove line-height if it's unnecessary because |
| + // overflow:scroll clips editing text by line-height. |
| + Length logicalHeight = startStyle.logicalHeight(); |
| + // Here, we remove line-height if the INPUT fixed height is taller than the |
| + // line-height. It's not the precise condition because logicalHeight |
| + // includes border and padding if box-sizing:border-box, and non-fixed |
| + // heights are possible. |
| + if (logicalHeight.isFixed() && logicalHeight.getFloatValue() > computedLineHeight) |
|
kojii
2016/04/26 06:03:21
Are Percent and Calculated converted to Fixed at t
tkent
2016/04/26 07:03:28
No. We are unable to determine if it's ok to remo
tkent
2016/04/26 07:44:49
We discussed offline, and agreed that we should no
|
| textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); |
| textBlockStyle->setDisplay(BLOCK); |
| @@ -284,6 +295,7 @@ PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(co |
| textBlockStyle->setTextSecurity(TSNONE); |
| textBlockStyle->setOverflowX(OverflowScroll); |
| + // overflow-y:visible doesn't work because overflow-x:scroll makes a layer. |
| textBlockStyle->setOverflowY(OverflowScroll); |
| RefPtr<ComputedStyle> noScrollbarStyle = ComputedStyle::create(); |
| noScrollbarStyle->setStyleType(PseudoIdScrollbar); |