mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Fix for assertions being thrown when fixed layout tables are flowed at an
unconstrained width. Instead of asserting, intrinsic first row cell widths will be used to determine the widths of columns with percentage-specified sizes.
This commit is contained in:
parent
26a8529775
commit
fe2af9709a
@ -83,7 +83,7 @@ PRBool FixedTableLayoutStrategy::BalanceColumnWidths(nsIStyleContext *aTableStyl
|
||||
*/
|
||||
PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputedWidth)
|
||||
{
|
||||
NS_ASSERTION(aComputedWidth != NS_UNCONSTRAINEDSIZE, "bad computed width");
|
||||
// NS_ASSERTION(aComputedWidth != NS_UNCONSTRAINEDSIZE, "bad computed width");
|
||||
if (gsDebug==PR_TRUE) printf ("** %p: AssignPreliminaryColumnWidths **\n", mTableFrame);
|
||||
|
||||
const nsStylePosition* tablePosition;
|
||||
@ -123,7 +123,9 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
|
||||
if (eStyleUnit_Coord == colPosition->mWidth.GetUnit()) {
|
||||
colWidths[colX] = colPosition->mWidth.GetCoordValue();
|
||||
} // get the percentage width
|
||||
else if (eStyleUnit_Percent == colPosition->mWidth.GetUnit()) {
|
||||
else if ((eStyleUnit_Percent == colPosition->mWidth.GetUnit()) &&
|
||||
(aComputedWidth != NS_UNCONSTRAINEDSIZE)) {
|
||||
// Only apply percentages if we're unconstrained.
|
||||
float percent = colPosition->mWidth.GetPercentValue();
|
||||
colWidths[colX] = NSToCoordRound(percent * (float)availWidth);
|
||||
}
|
||||
@ -139,7 +141,8 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
|
||||
if (eStyleUnit_Coord == cellPosition->mWidth.GetUnit()) {
|
||||
colWidths[colX] = cellPosition->mWidth.GetCoordValue() / colSpan;
|
||||
}
|
||||
else if (eStyleUnit_Percent == cellPosition->mWidth.GetUnit()) {
|
||||
else if ((eStyleUnit_Percent == cellPosition->mWidth.GetUnit()) &&
|
||||
(aComputedWidth != NS_UNCONSTRAINEDSIZE)) {
|
||||
float percent = cellPosition->mWidth.GetPercentValue();
|
||||
colWidths[colX] = NSToCoordRound(percent * (float)availWidth / (float)colSpan);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ PRBool FixedTableLayoutStrategy::BalanceColumnWidths(nsIStyleContext *aTableStyl
|
||||
*/
|
||||
PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputedWidth)
|
||||
{
|
||||
NS_ASSERTION(aComputedWidth != NS_UNCONSTRAINEDSIZE, "bad computed width");
|
||||
// NS_ASSERTION(aComputedWidth != NS_UNCONSTRAINEDSIZE, "bad computed width");
|
||||
if (gsDebug==PR_TRUE) printf ("** %p: AssignPreliminaryColumnWidths **\n", mTableFrame);
|
||||
|
||||
const nsStylePosition* tablePosition;
|
||||
@ -123,7 +123,9 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
|
||||
if (eStyleUnit_Coord == colPosition->mWidth.GetUnit()) {
|
||||
colWidths[colX] = colPosition->mWidth.GetCoordValue();
|
||||
} // get the percentage width
|
||||
else if (eStyleUnit_Percent == colPosition->mWidth.GetUnit()) {
|
||||
else if ((eStyleUnit_Percent == colPosition->mWidth.GetUnit()) &&
|
||||
(aComputedWidth != NS_UNCONSTRAINEDSIZE)) {
|
||||
// Only apply percentages if we're unconstrained.
|
||||
float percent = colPosition->mWidth.GetPercentValue();
|
||||
colWidths[colX] = NSToCoordRound(percent * (float)availWidth);
|
||||
}
|
||||
@ -139,7 +141,8 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
|
||||
if (eStyleUnit_Coord == cellPosition->mWidth.GetUnit()) {
|
||||
colWidths[colX] = cellPosition->mWidth.GetCoordValue() / colSpan;
|
||||
}
|
||||
else if (eStyleUnit_Percent == cellPosition->mWidth.GetUnit()) {
|
||||
else if ((eStyleUnit_Percent == cellPosition->mWidth.GetUnit()) &&
|
||||
(aComputedWidth != NS_UNCONSTRAINEDSIZE)) {
|
||||
float percent = cellPosition->mWidth.GetPercentValue();
|
||||
colWidths[colX] = NSToCoordRound(percent * (float)availWidth / (float)colSpan);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user