diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp
index 070f36caf9fe..5f13b402f29b 100644
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -359,13 +359,6 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext,
"very large sizes, not attempts at intrinsic inline-size "
"calculation");
- if (AvailableBSize() != NS_UNCONSTRAINEDSIZE && parentReflowState &&
- parentReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
- // Orthogonal frames are always reflowed with unconstrained block-size,
- // to avoid incomplete reflow across an orthogonal boundary.
- AvailableBSize() = NS_UNCONSTRAINEDSIZE;
- }
-
mStylePosition = frame->StylePosition();
mStyleDisplay = frame->StyleDisplay();
mStyleVisibility = frame->StyleVisibility();
@@ -439,6 +432,13 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext,
}
}
+ if (AvailableBSize() != NS_UNCONSTRAINEDSIZE && parentReflowState &&
+ parentReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
+ // Orthogonal frames are always reflowed with unconstrained block-size,
+ // to avoid incomplete reflow across an orthogonal boundary.
+ AvailableBSize() = NS_UNCONSTRAINEDSIZE;
+ }
+
NS_WARN_IF_FALSE((mFrameType == NS_CSS_FRAME_TYPE_INLINE &&
!frame->IsFrameOfType(nsIFrame::eReplaced)) ||
type == nsGkAtoms::textFrame ||