#628: M1663642 M1663439
This commit is contained in:
parent
819a494138
commit
bc184b4c4d
|
@ -101,6 +101,14 @@ struct nsTableReflowState {
|
||||||
availSize.BSize(wm) = std::max(0, availSize.BSize(wm));
|
availSize.BSize(wm) = std::max(0, availSize.BSize(wm));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReduceAvailableBSizeBy(WritingMode aWM, nscoord aAmount) {
|
||||||
|
if (availSize.BSize(aWM) == NS_UNCONSTRAINEDSIZE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
availSize.BSize(aWM) -= aAmount;
|
||||||
|
availSize.BSize(aWM) = std::max(0, availSize.BSize(aWM));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
|
@ -2809,9 +2817,7 @@ nsTableFrame::PlaceChild(nsTableReflowState& aReflowState,
|
||||||
aReflowState.bCoord += aKidDesiredSize.BSize(wm);
|
aReflowState.bCoord += aKidDesiredSize.BSize(wm);
|
||||||
|
|
||||||
// If our bsize is constrained, then update the available bsize
|
// If our bsize is constrained, then update the available bsize
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.BSize(wm)) {
|
aReflowState.ReduceAvailableBSizeBy(wm, aKidDesiredSize.BSize(wm));
|
||||||
aReflowState.availSize.BSize(wm) -= aKidDesiredSize.BSize(wm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -3055,17 +3061,24 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
|
||||||
// using the footer's prev-in-flow's height instead of reflowing it again,
|
// using the footer's prev-in-flow's height instead of reflowing it again,
|
||||||
// but there's no real need.
|
// but there's no real need.
|
||||||
if (isPaginated) {
|
if (isPaginated) {
|
||||||
|
bool reorder = false;
|
||||||
if (thead && !GetPrevInFlow()) {
|
if (thead && !GetPrevInFlow()) {
|
||||||
|
reorder = thead->GetNextInFlow();
|
||||||
nscoord desiredHeight;
|
nscoord desiredHeight;
|
||||||
nsresult rv = SetupHeaderFooterChild(aReflowState, thead, &desiredHeight);
|
nsresult rv = SetupHeaderFooterChild(aReflowState, thead, &desiredHeight);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tfoot) {
|
if (tfoot) {
|
||||||
|
reorder = reorder || tfoot->GetNextInFlow();
|
||||||
nsresult rv = SetupHeaderFooterChild(aReflowState, tfoot, &footerHeight);
|
nsresult rv = SetupHeaderFooterChild(aReflowState, tfoot, &footerHeight);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (reorder) {
|
||||||
|
// Reorder row groups - the reflow may have changed the nextinflows.
|
||||||
|
OrderRowGroups(rowGroups, &thead, &tfoot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// if the child is a tbody in paginated mode reduce the height by a repeated footer
|
// if the child is a tbody in paginated mode reduce the height by a repeated footer
|
||||||
bool allowRepeatedFooter = false;
|
bool allowRepeatedFooter = false;
|
||||||
|
@ -3131,14 +3144,10 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
|
||||||
kidReflowState.mFlags.mIsTopOfPage = false;
|
kidReflowState.mFlags.mIsTopOfPage = false;
|
||||||
}
|
}
|
||||||
aReflowState.bCoord += cellSpacingB;
|
aReflowState.bCoord += cellSpacingB;
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.BSize(wm)) {
|
aReflowState.ReduceAvailableBSizeBy(wm, cellSpacingB);
|
||||||
aReflowState.availSize.BSize(wm) -= cellSpacingB;
|
|
||||||
}
|
|
||||||
// record the presence of a next in flow, it might get destroyed so we
|
// record the presence of a next in flow, it might get destroyed so we
|
||||||
// need to reorder the row group array
|
// need to reorder the row group array
|
||||||
bool reorder = false;
|
const bool reorder = kidFrame->GetNextInFlow();
|
||||||
if (kidFrame->GetNextInFlow())
|
|
||||||
reorder = true;
|
|
||||||
|
|
||||||
LogicalPoint kidPosition(wm, aReflowState.iCoord, aReflowState.bCoord);
|
LogicalPoint kidPosition(wm, aReflowState.iCoord, aReflowState.bCoord);
|
||||||
ReflowChild(kidFrame, presContext, desiredSize, kidReflowState,
|
ReflowChild(kidFrame, presContext, desiredSize, kidReflowState,
|
||||||
|
@ -3146,7 +3155,7 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
|
||||||
kidReflowState.ApplyRelativePositioning(&kidPosition, containerSize);
|
kidReflowState.ApplyRelativePositioning(&kidPosition, containerSize);
|
||||||
|
|
||||||
if (reorder) {
|
if (reorder) {
|
||||||
// reorder row groups the reflow may have changed the nextinflows
|
// Reorder row groups - the reflow may have changed the nextinflows.
|
||||||
OrderRowGroups(rowGroups, &thead, &tfoot);
|
OrderRowGroups(rowGroups, &thead, &tfoot);
|
||||||
childX = rowGroups.IndexOf(kidFrame);
|
childX = rowGroups.IndexOf(kidFrame);
|
||||||
if (childX == RowGroupArray::NoIndex) {
|
if (childX == RowGroupArray::NoIndex) {
|
||||||
|
@ -3294,10 +3303,7 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
|
||||||
}
|
}
|
||||||
aReflowState.bCoord += kidRect.BSize(wm);
|
aReflowState.bCoord += kidRect.BSize(wm);
|
||||||
|
|
||||||
// If our bsize is constrained then update the available bsize.
|
aReflowState.ReduceAvailableBSizeBy(wm, cellSpacingB + kidRect.BSize(wm));
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.BSize(wm)) {
|
|
||||||
aReflowState.availSize.BSize(wm) -= cellSpacingB + kidRect.BSize(wm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1319,6 +1319,9 @@ nsStandardURL::SetSpec(const nsACString &input)
|
||||||
|
|
||||||
// parse the given URL...
|
// parse the given URL...
|
||||||
nsresult rv = ParseURL(spec, specLength);
|
nsresult rv = ParseURL(spec, specLength);
|
||||||
|
if (mScheme.mLen <= 0) {
|
||||||
|
rv = NS_ERROR_MALFORMED_URI;
|
||||||
|
}
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
// finally, use the URLSegment member variables to build a normalized
|
// finally, use the URLSegment member variables to build a normalized
|
||||||
// copy of |spec|
|
// copy of |spec|
|
||||||
|
|
Loading…
Reference in New Issue