Commit 933f6b82 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[cleanup] Remove LayoutDeprecatedFlexibleBox::LayoutHorizontalBox

... and associated code. As of:
https://chromium-review.googlesource.com/c/chromium/src/+/1753557

This is now dead! \o/

Bug: 993813
Change-Id: Ia1e0b1bc6ae357cae40d6a26c0eda81aa6c084a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954925
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726459}
parent 5366727d
...@@ -3570,22 +3570,13 @@ void LayoutBox::ComputeLogicalHeight( ...@@ -3570,22 +3570,13 @@ void LayoutBox::ComputeLogicalHeight(
return; return;
} }
// FIXME: Account for writing-mode in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
bool in_horizontal_box =
Parent()->IsDeprecatedFlexibleBox() &&
Parent()->StyleRef().BoxOrient() == EBoxOrient::kHorizontal;
bool stretching =
Parent()->StyleRef().BoxAlign() == EBoxAlignment::kStretch;
bool treat_as_replaced =
ShouldComputeSizeAsReplaced() && (!in_horizontal_box || !stretching);
bool check_min_max_height = false; bool check_min_max_height = false;
// The parent box is flexing us, so it has increased or decreased our // The parent box is flexing us, so it has increased or decreased our
// height. We have to grab our cached flexible height. // height. We have to grab our cached flexible height.
if (HasOverrideLogicalHeight()) { if (HasOverrideLogicalHeight()) {
h = Length::Fixed(OverrideLogicalHeight()); h = Length::Fixed(OverrideLogicalHeight());
} else if (treat_as_replaced) { } else if (ShouldComputeSizeAsReplaced()) {
h = Length::Fixed(ComputeReplacedLogicalHeight() + h = Length::Fixed(ComputeReplacedLogicalHeight() +
BorderAndPaddingLogicalHeight()); BorderAndPaddingLogicalHeight());
} else { } else {
...@@ -3593,16 +3584,6 @@ void LayoutBox::ComputeLogicalHeight( ...@@ -3593,16 +3584,6 @@ void LayoutBox::ComputeLogicalHeight(
check_min_max_height = true; check_min_max_height = true;
} }
// Block children of horizontal flexible boxes fill the height of the box.
// FIXME: Account for writing-mode in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
if (h.IsAuto() && in_horizontal_box &&
ToLayoutDeprecatedFlexibleBox(Parent())->IsStretchingChildren()) {
h = Length::Fixed(ParentBox()->ContentLogicalHeight() - MarginBefore() -
MarginAfter());
check_min_max_height = false;
}
LayoutUnit height_result; LayoutUnit height_result;
if (check_min_max_height) { if (check_min_max_height) {
height_result = ComputeLogicalHeightUsing( height_result = ComputeLogicalHeightUsing(
......
...@@ -42,12 +42,10 @@ class LayoutDeprecatedFlexibleBox final : public LayoutBlock { ...@@ -42,12 +42,10 @@ class LayoutDeprecatedFlexibleBox final : public LayoutBlock {
const ComputedStyle& new_style) override; const ComputedStyle& new_style) override;
void UpdateBlockLayout(bool relayout_children) override; void UpdateBlockLayout(bool relayout_children) override;
void LayoutHorizontalBox(bool relayout_children);
void LayoutVerticalBox(bool relayout_children); void LayoutVerticalBox(bool relayout_children);
bool IsDeprecatedFlexibleBox() const override { return true; } bool IsDeprecatedFlexibleBox() const override { return true; }
bool IsFlexibleBoxIncludingDeprecatedAndNG() const override { return true; } bool IsFlexibleBoxIncludingDeprecatedAndNG() const override { return true; }
bool IsStretchingChildren() const { return stretching_children_; }
void PlaceChild(LayoutBox* child, const LayoutPoint& location); void PlaceChild(LayoutBox* child, const LayoutPoint& location);
...@@ -58,17 +56,8 @@ class LayoutDeprecatedFlexibleBox final : public LayoutBlock { ...@@ -58,17 +56,8 @@ class LayoutDeprecatedFlexibleBox final : public LayoutBlock {
LayoutUnit AllowedChildFlex(LayoutBox* child, bool expanding); LayoutUnit AllowedChildFlex(LayoutBox* child, bool expanding);
bool IsVertical() const {
return StyleRef().BoxOrient() == EBoxOrient::kVertical;
}
bool IsHorizontal() const {
return StyleRef().BoxOrient() == EBoxOrient::kHorizontal;
}
void ApplyLineClamp(FlexBoxIterator&, bool relayout_children); void ApplyLineClamp(FlexBoxIterator&, bool relayout_children);
void ClearLineClamp(); void ClearLineClamp();
bool stretching_children_;
}; };
DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutDeprecatedFlexibleBox, DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutDeprecatedFlexibleBox,
......
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