From c87f3d5918db8956f2d8f4bcf13dcd896ef82d28 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Wed, 3 Mar 2021 10:12:43 +0800 Subject: [PATCH] partly imported Bug 1183896. Don't assume that relatively positioned table cells actually have positioned offsets computed, because in the case of position:sticky they don't. r=dholbert --- layout/tables/nsTableRowFrame.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index 5516caa0fc..bda622ef1a 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -991,8 +991,12 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext, // We didn't reflow. Do the positioning part of what // MovePositionBy does internally. (This codepath should really // be merged into the else below if we can.) - LogicalMargin computedOffsets(wm, *static_cast - (kidFrame->Properties().Get(nsIFrame::ComputedOffsetProperty()))); + nsMargin* computedOffsetProp = static_cast + (kidFrame->Properties().Get(nsIFrame::ComputedOffsetProperty())); + // Bug 975644: a position:sticky kid can end up with a null + // property value here. + LogicalMargin computedOffsets(wm, computedOffsetProp ? + *computedOffsetProp : nsMargin()); nsHTMLReflowState::ApplyRelativePositioning(kidFrame, wm, computedOffsets, &kidPosition, containerWidth); }