Chromium Code Reviews| Index: Source/core/layout/LayoutTextControlSingleLine.cpp |
| diff --git a/Source/core/layout/LayoutTextControlSingleLine.cpp b/Source/core/layout/LayoutTextControlSingleLine.cpp |
| index d3dbf3ca121cc03bd9f1c982de55cbc3710a8045..0dc7d8cade72f937eaf548918d7e44388434e8b2 100644 |
| --- a/Source/core/layout/LayoutTextControlSingleLine.cpp |
| +++ b/Source/core/layout/LayoutTextControlSingleLine.cpp |
| @@ -94,6 +94,7 @@ void LayoutTextControlSingleLine::layout() |
| { |
| SubtreeLayoutScope layoutScope(*this); |
| + // FIXME: This code is madness (https://crbug.com/461117) |
|
leviw_travelin_and_unemployed
2015/02/24 18:38:25
Well said, sir!
|
| // FIXME: We should remove the height-related hacks in layout() and |
| // styleDidChange(). We need them because |
| // - Center the inner elements vertically if the input height is taller than |
| @@ -106,6 +107,7 @@ void LayoutTextControlSingleLine::layout() |
| // because of compability. |
| RenderBox* innerEditorRenderer = innerEditorElement()->renderBox(); |
| + bool innerEditorRendererHadLayout = innerEditorRenderer && innerEditorRenderer->needsLayout(); |
|
leviw_travelin_and_unemployed
2015/02/24 18:38:25
innerEditorRendererHadNeedsLayout?
Julien - ping for review
2015/02/24 18:48:01
I prefer HadLayout as it corresponds to what's hap
|
| RenderBox* viewPortRenderer = editingViewPortElement() ? editingViewPortElement()->renderBox() : 0; |
| // To ensure consistency between layouts, we need to reset any conditionally overriden height. |
| @@ -157,6 +159,11 @@ void LayoutTextControlSingleLine::layout() |
| } |
| } |
| + // We ensure that the inner editor renderer is laid out at least once. This is |
| + // required as the logic below assumes that we don't carry over previous layout values. |
| + if (innerEditorRenderer && !innerEditorRendererHadLayout) |
| + layoutScope.setNeedsLayout(innerEditorRenderer); |
| + |
| // If we need another layout pass, we have changed one of children's height so we need to relayout them. |
| if (needsLayout()) |
| RenderBlockFlow::layoutBlock(true); |