Bug 1113216 - Avoid assertions/crashes by treating enumerated block-size values as auto, pending proper implementation of all the values. r=dbaron

This commit is contained in:
Jonathan Kew 2015-01-15 11:56:51 +00:00
parent e2f83ce0e3
commit 8699f8544e
2 changed files with 13 additions and 3 deletions

View File

@ -1396,6 +1396,16 @@ public:
nsStyleUnit unit = aCoord.GetUnit();
return unit == eStyleUnit_Auto || // only for 'height'
unit == eStyleUnit_None || // only for 'max-height'
// The enumerated values were originally aimed at inline-size
// (or width, as it was before logicalization). For now, let them
// return true here, so that we don't call ComputeBSizeValue with
// value types that it doesn't understand. (See bug 1113216.)
//
// FIXME (bug 567039, bug 527285)
// This isn't correct for the 'fill' value or for the 'min-*' or
// 'max-*' properties, which need to be handled differently by
// the callers of IsAutoBSize().
unit == eStyleUnit_Enumerated ||
(aCBBSize == nscoord_MAX && aCoord.HasPercent());
}

View File

@ -355,9 +355,9 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
DO_GLOBAL_REFLOW_COUNT("nsFieldSetFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_PRECONDITION(aReflowState.ComputedWidth() != NS_INTRINSICSIZE,
"Should have a precomputed width!");
NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
"Should have a precomputed inline-size!");
// Initialize OUT parameter
aStatus = NS_FRAME_COMPLETE;