Commit 2fe6eb09 authored by Ting-Yu Lin's avatar Ting-Yu Lin
Browse files

Bug 1611303 - Always assume a flex item needs a block-axis resize in final reflow. r=dholbert

In an incremental reflow, if a flex item has a valid bsize cache , we
skip its measuring reflow. However, we may still need to set relevant
bsize flags if the flex container is changing its definiteness in the
block-axis. See bug 1611303 comment 2 for an analysis.

This patch is playing safe by always calling SetHasBSizeChange() if we
override bsize for the item. Of course this can be solved in a more
sophisticated way by checking whether the item really has a block-axis
resize, but that means we'll need to duplicate a lot of logic in
FlexItem::NeedsFinalReflow().

Differential Revision: https://phabricator.services.mozilla.com/D122041
parent 6cbdd035
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -5557,10 +5557,12 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem(
    }
    FLEX_LOGV(" Cross size override: %d", aItem.CrossSize());
  }
  if (sizeOverrides.mStyleBSize && aItem.HadMeasuringReflow()) {
    // Because we are overriding the block-size, *and* we had an earlier
    // "measuring" reflow, then this upcoming reflow needs to be treated as a
    // resize. This sets relevant flags in ReflowInput::InitResizeFlags().
  if (sizeOverrides.mStyleBSize) {
    // We are overriding the block-size. For robustness, we always assume that
    // this represents a block-axis resize for the frame. This may be
    // conservative, but we do capture all the conditions in the block-axis
    // (checked in NeedsFinalReflow()) that make this item require a final
    // reflow. This sets relevant flags in ReflowInput::InitResizeFlags().
    aItem.Frame()->SetHasBSizeChange(true);
  }

+0 −2
Original line number Diff line number Diff line
[percentage-heights-010.html]
  expected: FAIL