Skip to content

Commit

Permalink
[FlexNG] DCHECK that flex base border box includes border+padding
Browse files Browse the repository at this point in the history
We can do this now that issue 1094311 is fixed.

The new DCHECK is triggered by issue 1102183 earlier than the one in the
report. The real fix for this issue will come later.

Bug: 1102183
Change-Id: I5235ece346e31724c103a3fb53a5bf920ec8a657
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2311040
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791104}
  • Loading branch information
davidsgrogan authored and Commit Bot committed Jul 23, 2020
1 parent cda879a commit 3d633e9
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,12 +609,9 @@ void NGFlexLayoutAlgorithm::ConstructAndAppendFlexItems() {
// https://www.w3.org/TR/css-flexbox-1/#algo-main-item
// Blink's FlexibleBoxAlgorithm expects it to be content + scrollbar widths,
// but no padding or border.
// The ClampNegativeToZero is needed for the last canvas element in
// flexbox-flex-basis-content-001a.html. It's possibly only needed because
// we don't properly account for borders+padding when multiplying by the
// aspect ratio.
DCHECK_GE(flex_base_border_box, main_axis_border_padding);
LayoutUnit flex_base_content_size =
(flex_base_border_box - main_axis_border_padding).ClampNegativeToZero();
flex_base_border_box - main_axis_border_padding;

const Length& min = is_horizontal_flow_ ? child.Style().MinWidth()
: child.Style().MinHeight();
Expand Down

0 comments on commit 3d633e9

Please sign in to comment.