Skip to content

Commit

Permalink
[RemoveLegacy] Remove unnecessary UpdateBlockLayout() overrides.
Browse files Browse the repository at this point in the history
We don't need this in LayoutBlockFlow and LayoutView. There's already
one in LayoutBlock, which will end with NOTREACHED_NORETURN().

Bug: 1229581
Change-Id: I53ee26568d9e707bfa58dedaa82f98050c133125
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4443329
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1132748}
  • Loading branch information
mstensho authored and Chromium LUCI CQ committed Apr 19, 2023
1 parent dac0711 commit 4aed6d0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
5 changes: 0 additions & 5 deletions third_party/blink/renderer/core/layout/layout_block_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ class CORE_EXPORT LayoutBlockFlow : public LayoutBlock {
return true;
}

void UpdateBlockLayout(bool relayout_children) override {
NOT_DESTROYED();
NOTREACHED_NORETURN();
}

void ComputeVisualOverflow() override;

bool CanContainFirstFormattedLine() const;
Expand Down
40 changes: 0 additions & 40 deletions third_party/blink/renderer/core/layout/layout_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,46 +289,6 @@ bool LayoutView::ShouldPlaceBlockDirectionScrollbarOnLogicalLeft() const {
return false;
}

void LayoutView::UpdateBlockLayout(bool relayout_children) {
NOT_DESTROYED();

relayout_children |=
!ShouldUsePrintingLayout() &&
(!frame_view_ || LogicalWidth() != ViewLogicalWidthForBoxSizing() ||
LogicalHeight() != ViewLogicalHeightForBoxSizing());

if (relayout_children) {
SetChildNeedsLayout();
for (LayoutObject* child = FirstChild(); child;
child = child->NextSibling()) {
if (child->IsSVGRoot())
continue;

// TODO(1229581): Is this really necessary?
if ((child->IsBox() &&
To<LayoutBox>(child)->HasRelativeLogicalHeight()) ||
child->StyleRef().LogicalHeight().IsPercentOrCalc() ||
child->StyleRef().LogicalMinHeight().IsPercentOrCalc() ||
child->StyleRef().LogicalMaxHeight().IsPercentOrCalc())
child->SetChildNeedsLayout();
}

if (GetDocument().SvgExtensions()) {
GetDocument()
.AccessSVGExtensions()
.InvalidateSVGRootsWithRelativeLengthDescendents();
}
}

if (!NeedsLayout())
return;

LayoutBlockFlow::UpdateBlockLayout(relayout_children);

// TODO(1229581): Remove this logic.
NOTREACHED_NORETURN();
}

void LayoutView::UpdateLayout() {
NOT_DESTROYED();
if (!GetDocument().Printing()) {
Expand Down
1 change: 0 additions & 1 deletion third_party/blink/renderer/core/layout/layout_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ class CORE_EXPORT LayoutView : public LayoutBlockFlow {

private:
bool CanHaveChildren() const override;
void UpdateBlockLayout(bool relayout_children) override;
void UpdateFromStyle() override;

Member<LocalFrameView> frame_view_;
Expand Down

0 comments on commit 4aed6d0

Please sign in to comment.