Commit 88a15349 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Remove |non_content_height| argument of LayoutTextControl::ComputeControlLogicalHeight()

|non_content_height| is always zero because UA stylesheet for the inner
editor doesn't have border/padding/margin, and web authors can't specify them.

This CL has no behavior changes.

Change-Id: I9093a8bb33076a67730231b75ce804daadb61a06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2449674
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814069}
parent c0546970
......@@ -96,12 +96,8 @@ void LayoutTextControl::ComputeLogicalHeight(
HTMLElement* inner_editor = InnerEditorElement();
DCHECK(inner_editor);
if (LayoutBox* inner_editor_box = inner_editor->GetLayoutBox()) {
LayoutUnit non_content_height = inner_editor_box->BorderAndPaddingHeight() +
inner_editor_box->MarginHeight();
logical_height = ComputeControlLogicalHeight(
inner_editor_box->LineHeight(true, kHorizontalLine,
kPositionOfInteriorLineBoxes),
non_content_height);
logical_height = ComputeControlLogicalHeight(inner_editor_box->LineHeight(
true, kHorizontalLine, kPositionOfInteriorLineBoxes));
// We are able to have a horizontal scrollbar if the overflow style is
// scroll, or if its auto and there's no word wrap.
......
......@@ -68,8 +68,7 @@ class CORE_EXPORT LayoutTextControl : public LayoutBlockFlow {
virtual LayoutUnit PreferredContentLogicalWidth(float char_width) const = 0;
virtual LayoutUnit ComputeControlLogicalHeight(
LayoutUnit line_height,
LayoutUnit non_content_height) const = 0;
LayoutUnit line_height) const = 0;
void ComputeLogicalHeight(LayoutUnit logical_height,
LayoutUnit logical_top,
......
......@@ -65,11 +65,9 @@ LayoutUnit LayoutTextControlMultiLine::PreferredContentLogicalWidth(
}
LayoutUnit LayoutTextControlMultiLine::ComputeControlLogicalHeight(
LayoutUnit line_height,
LayoutUnit non_content_height) const {
LayoutUnit line_height) const {
NOT_DESTROYED();
return line_height * To<HTMLTextAreaElement>(GetNode())->rows() +
non_content_height;
return line_height * To<HTMLTextAreaElement>(GetNode())->rows();
}
LayoutUnit LayoutTextControlMultiLine::BaselinePosition(
......
......@@ -45,9 +45,7 @@ class LayoutTextControlMultiLine final : public LayoutTextControl {
HitTestAction) override;
LayoutUnit PreferredContentLogicalWidth(float char_width) const override;
LayoutUnit ComputeControlLogicalHeight(
LayoutUnit line_height,
LayoutUnit non_content_height) const override;
LayoutUnit ComputeControlLogicalHeight(LayoutUnit line_height) const override;
// We override the two baseline functions because we want our baseline to be
// the bottom of our margin box.
LayoutUnit BaselinePosition(
......
......@@ -212,10 +212,9 @@ LayoutUnit LayoutTextControlSingleLine::PreferredContentLogicalWidth(
}
LayoutUnit LayoutTextControlSingleLine::ComputeControlLogicalHeight(
LayoutUnit line_height,
LayoutUnit non_content_height) const {
LayoutUnit line_height) const {
NOT_DESTROYED();
return line_height + non_content_height;
return line_height;
}
LayoutUnit LayoutTextControlSingleLine::ScrollWidth() const {
......
......@@ -65,9 +65,7 @@ class LayoutTextControlSingleLine : public LayoutTextControl {
int TextBlockWidth() const;
LayoutUnit PreferredContentLogicalWidth(float char_width) const final;
LayoutUnit ComputeControlLogicalHeight(
LayoutUnit line_height,
LayoutUnit non_content_height) const override;
LayoutUnit ComputeControlLogicalHeight(LayoutUnit line_height) const override;
void ComputeVisualOverflow(bool recompute_floats) override;
......
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