Commit dea4e91a authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Update some comments on <textarea> layout

This CL has no behavior changes.

No-Try: true
Change-Id: Id12d1876e22f8c40c3998573fa8cef36b06ab012
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2467038Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817298}
parent 34f09b87
......@@ -136,10 +136,11 @@ namespace {
LayoutUnit TextAreaIntrinsicInlineSize(const HTMLTextAreaElement& textarea,
const LayoutBox& box) {
// <textarea>'s intrinsic inilne-size always contains the scrollbar thickness
// regardless of actual existence of a scrollbar. If a scrollbar exists, its
// thickness is not added. See NGBlockLayoutAlgorithm::ComputeMinMaxSizes()
// and LayoutBlock::ComputeIntrinsicLogicalWidths().
// <textarea>'s intrinsic inline-size always contains the scrollbar thickness
// regardless of actual existence of a scrollbar.
//
// See |NGBlockLayoutAlgorithm::ComputeMinMaxSizes()| and |LayoutBlock::
// ComputeIntrinsicLogicalWidths()|.
return LayoutUnit(ceilf(LayoutTextControl::GetAvgCharWidth(box.StyleRef()) *
textarea.cols())) +
LayoutTextControl::ScrollbarThickness(box);
......@@ -172,7 +173,7 @@ LayoutUnit TextFieldIntrinsicInlineSize(const HTMLInputElement& input,
spin_button ? spin_button->GetLayoutBox() : nullptr) {
result += spin_box->BorderAndPaddingLogicalWidth();
// Since the width of spin_box is not calculated yet,
// spin_layout_object->LogicalWidth() returns 0. Use the computed logical
// spin_box->LogicalWidth() returns 0. Use the computed logical
// width instead.
result += spin_box->StyleRef().LogicalWidth().Value();
}
......
......@@ -9,7 +9,7 @@
namespace blink {
// LayoutNGTextControlSingleLine is a LayoutObject for <textarea>.
// LayoutNGTextControlMultiLine is a LayoutObject for <textarea>.
class LayoutNGTextControlMultiLine final : public LayoutNGBlockFlow {
public:
explicit LayoutNGTextControlMultiLine(Element* element);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment