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

This commit is contained in:
2021-03-03 10:12:43 +08:00
parent 5fe82ff0f2
commit c87f3d5918
+6 -2
View File
@@ -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<nsMargin*>
(kidFrame->Properties().Get(nsIFrame::ComputedOffsetProperty())));
nsMargin* computedOffsetProp = static_cast<nsMargin*>
(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);
}