Commit 611db0b3 authored by Ting-Yu Lin's avatar Ting-Yu Lin
Browse files

Bug 1463977 Part 1 - Mark SizeComputationInput::mFrame const, and assert its validity. r=dholbert

mFrame is public and used throughout the layout, but it shouldn't be modified
post constructor.

Differential Revision: https://phabricator.services.mozilla.com/D155320
parent f6c6b4b2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -113,7 +113,9 @@ SizeComputationInput::SizeComputationInput(nsIFrame* aFrame,
      mWritingMode(aFrame->GetWritingMode()),
      mComputedMargin(mWritingMode),
      mComputedBorderPadding(mWritingMode),
      mComputedPadding(mWritingMode) {}
      mComputedPadding(mWritingMode) {
  MOZ_ASSERT(mFrame);
}

SizeComputationInput::SizeComputationInput(
    nsIFrame* aFrame, gfxContext* aRenderingContext,
@@ -270,7 +272,6 @@ bool ReflowInput::ShouldReflowAllKids() const {
}

void ReflowInput::SetComputedISize(nscoord aComputedISize) {
  NS_ASSERTION(mFrame, "Must have a frame!");
  // It'd be nice to assert that |frame| is not in reflow, but this fails for
  // two reasons:
  //
@@ -295,7 +296,6 @@ void ReflowInput::SetComputedISize(nscoord aComputedISize) {
}

void ReflowInput::SetComputedBSize(nscoord aComputedBSize) {
  NS_ASSERTION(mFrame, "Must have a frame!");
  // It'd be nice to assert that |frame| is not in reflow, but this fails
  // because:
  //
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ namespace mozilla {
struct SizeComputationInput {
 public:
  // The frame being reflowed.
  nsIFrame* mFrame;
  nsIFrame* const mFrame;

  // Rendering context to use for measurement.
  gfxContext* mRenderingContext;