Skip to content

Commit

Permalink
Change logic in LayoutBox::ComputeLogicalWidth
Browse files Browse the repository at this point in the history
Change logic in LayoutBox::ComputeLogicalWidth so that we check
treat_as_replaced just once.

Change-Id: Ide396a9397374d38168b94e025472b4d4e89f9f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2655426
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Rob Buis <rbuis@igalia.com>
Cr-Commit-Position: refs/heads/master@{#848084}
  • Loading branch information
rwlbuis authored and Chromium LUCI CQ committed Jan 28, 2021
1 parent c2977b3 commit fa1ae38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions third_party/blink/renderer/core/layout/layout_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4114,12 +4114,12 @@ void LayoutBox::ComputeLogicalWidth(
ContainerWidthInInlineDirection();
LayoutBlock* cb = ContainingBlock();

if (StyleRef().LogicalWidth().IsAuto() && !treat_as_replaced &&
ComputeLogicalWidthFromAspectRatio(&computed_values.extent_)) {
/* we're good */
} else if (treat_as_replaced) {
if (treat_as_replaced) {
computed_values.extent_ =
ComputeReplacedLogicalWidth() + BorderAndPaddingLogicalWidth();
} else if (StyleRef().LogicalWidth().IsAuto() &&
ComputeLogicalWidthFromAspectRatio(&computed_values.extent_)) {
/* we're good */
} else {
LayoutUnit preferred_width = ComputeLogicalWidthUsing(
kMainOrPreferredSize, style_to_use.LogicalWidth(),
Expand Down

0 comments on commit fa1ae38

Please sign in to comment.