зеркало из https://github.com/mozilla/pjs.git
bug 2220; changed wording of some warnings.
This commit is contained in:
Родитель
b4199fb664
Коммит
661ba87dcb
|
@ -372,6 +372,32 @@ PRInt32 nsTableCellFrame::GetColSpan()
|
|||
}
|
||||
|
||||
|
||||
void DebugCheckChildSize(nsIFrame* aChild, nsHTMLReflowMetrics& aMet, nsSize& aAvailSize)
|
||||
{
|
||||
if (aMet.width > aAvailSize.width) {
|
||||
nsAutoString tmp;
|
||||
aChild->GetFrameName(tmp);
|
||||
printf("WARNING: cell %s content has desired width %d given avail width %d\n",
|
||||
tmp, aMet.width, aAvailSize.width);
|
||||
}
|
||||
if ((aMet.width < 0) || (aMet.width > 30000)) {
|
||||
printf("WARNING: cell content %X has large width %d \n", aChild, aMet.width);
|
||||
}
|
||||
if ((aMet.height < 0) || (aMet.height > 30000)) {
|
||||
printf("WARNING: cell content %X has large height %d \n", aChild, aMet.height);
|
||||
}
|
||||
if (aMet.maxElementSize) {
|
||||
nscoord tmp = aMet.maxElementSize->width;
|
||||
if ((tmp < 0) || (tmp > 30000)) {
|
||||
printf("WARNING: cell content %X has large max element width %d \n", aChild, tmp);
|
||||
}
|
||||
tmp = aMet.maxElementSize->height;
|
||||
if ((tmp < 0) || (tmp > 30000)) {
|
||||
printf("WARNING: cell content %X has large max element height %d \n", aChild, tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
||||
|
@ -430,7 +456,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (eReflowReason_Incremental == aReflowState.reason)
|
||||
{
|
||||
// XXX We *must* do this otherwise incremental reflow that's
|
||||
// We *must* do this otherwise incremental reflow that's
|
||||
// passing through will not work right.
|
||||
nsIFrame* next;
|
||||
aReflowState.reflowCommand->GetNext(next);
|
||||
|
@ -474,21 +500,13 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
ReflowChild(firstKid, aPresContext, kidSize, kidReflowState, aStatus);
|
||||
#ifdef NS_DEBUG
|
||||
if (kidSize.width > availSize.width)
|
||||
{
|
||||
printf("WARNING: cell ");
|
||||
nsAutoString tmp;
|
||||
firstKid->GetFrameName(tmp);
|
||||
fputs(tmp, stdout);
|
||||
printf(" content returned desired width %d given avail width %d\n",
|
||||
kidSize.width, availSize.width);
|
||||
}
|
||||
DebugCheckChildSize(firstKid, kidSize, availSize);
|
||||
#endif
|
||||
|
||||
// Nav4 hack for 0 dimensioned cells.
|
||||
// Empty cells are assigned a width and height of 4px
|
||||
// see testcase "cellHeights.html"
|
||||
if (eReflowReason_Initial == aReflowState.reason)
|
||||
if (NS_UNCONSTRAINEDSIZE == kidReflowState.availableWidth)
|
||||
{
|
||||
if ((0==kidSize.width) && (0==kidSize.height))
|
||||
SetContentEmpty(PR_TRUE);
|
||||
|
@ -497,7 +515,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
if (0==kidSize.width)
|
||||
{
|
||||
if (eReflowReason_Initial == aReflowState.reason)
|
||||
if (NS_UNCONSTRAINEDSIZE == kidReflowState.availableWidth)
|
||||
{
|
||||
float p2t;
|
||||
aPresContext.GetScaledPixelsToTwips(&p2t);
|
||||
|
|
|
@ -810,13 +810,15 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
|
|||
printf ("TR %p for cell %p Initial Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, kidSize.width, kidMaxElementSize.width);
|
||||
|
||||
// XXX the following alerts bugs in the content frames.
|
||||
// the following signals bugs in the content frames.
|
||||
if (kidMaxElementSize.width > kidSize.width) {
|
||||
printf("BUG - table cell content max element width greater than desired width \n");
|
||||
printf("WARNING - table cell content max element width %d greater than desired width %d\n",
|
||||
kidMaxElementSize.width, kidSize.width);
|
||||
kidSize.width = kidMaxElementSize.width;
|
||||
}
|
||||
if (kidMaxElementSize.height > kidSize.height) {
|
||||
printf("BUG - table cell content max element height greater than desired height \n");
|
||||
printf("Warning - table cell content max element height %d greater than desired height %d\n",
|
||||
kidMaxElementSize.height, kidSize.height);
|
||||
kidSize.height = kidMaxElementSize.height;
|
||||
}
|
||||
|
||||
|
@ -1289,7 +1291,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext& aPresContext,
|
|||
aReflowState.reflowState,
|
||||
aNextFrame, kidAvailSize);
|
||||
|
||||
// XXX Unfortunately we need to reflow the child several times.
|
||||
// Unfortunately we need to reflow the child several times.
|
||||
// The first time is for the incremental reflow command. We can't pass in
|
||||
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
// the width of the previous reflow...
|
||||
|
|
|
@ -372,6 +372,32 @@ PRInt32 nsTableCellFrame::GetColSpan()
|
|||
}
|
||||
|
||||
|
||||
void DebugCheckChildSize(nsIFrame* aChild, nsHTMLReflowMetrics& aMet, nsSize& aAvailSize)
|
||||
{
|
||||
if (aMet.width > aAvailSize.width) {
|
||||
nsAutoString tmp;
|
||||
aChild->GetFrameName(tmp);
|
||||
printf("WARNING: cell %s content has desired width %d given avail width %d\n",
|
||||
tmp, aMet.width, aAvailSize.width);
|
||||
}
|
||||
if ((aMet.width < 0) || (aMet.width > 30000)) {
|
||||
printf("WARNING: cell content %X has large width %d \n", aChild, aMet.width);
|
||||
}
|
||||
if ((aMet.height < 0) || (aMet.height > 30000)) {
|
||||
printf("WARNING: cell content %X has large height %d \n", aChild, aMet.height);
|
||||
}
|
||||
if (aMet.maxElementSize) {
|
||||
nscoord tmp = aMet.maxElementSize->width;
|
||||
if ((tmp < 0) || (tmp > 30000)) {
|
||||
printf("WARNING: cell content %X has large max element width %d \n", aChild, tmp);
|
||||
}
|
||||
tmp = aMet.maxElementSize->height;
|
||||
if ((tmp < 0) || (tmp > 30000)) {
|
||||
printf("WARNING: cell content %X has large max element height %d \n", aChild, tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
||||
|
@ -430,7 +456,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (eReflowReason_Incremental == aReflowState.reason)
|
||||
{
|
||||
// XXX We *must* do this otherwise incremental reflow that's
|
||||
// We *must* do this otherwise incremental reflow that's
|
||||
// passing through will not work right.
|
||||
nsIFrame* next;
|
||||
aReflowState.reflowCommand->GetNext(next);
|
||||
|
@ -474,21 +500,13 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
ReflowChild(firstKid, aPresContext, kidSize, kidReflowState, aStatus);
|
||||
#ifdef NS_DEBUG
|
||||
if (kidSize.width > availSize.width)
|
||||
{
|
||||
printf("WARNING: cell ");
|
||||
nsAutoString tmp;
|
||||
firstKid->GetFrameName(tmp);
|
||||
fputs(tmp, stdout);
|
||||
printf(" content returned desired width %d given avail width %d\n",
|
||||
kidSize.width, availSize.width);
|
||||
}
|
||||
DebugCheckChildSize(firstKid, kidSize, availSize);
|
||||
#endif
|
||||
|
||||
// Nav4 hack for 0 dimensioned cells.
|
||||
// Empty cells are assigned a width and height of 4px
|
||||
// see testcase "cellHeights.html"
|
||||
if (eReflowReason_Initial == aReflowState.reason)
|
||||
if (NS_UNCONSTRAINEDSIZE == kidReflowState.availableWidth)
|
||||
{
|
||||
if ((0==kidSize.width) && (0==kidSize.height))
|
||||
SetContentEmpty(PR_TRUE);
|
||||
|
@ -497,7 +515,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
if (0==kidSize.width)
|
||||
{
|
||||
if (eReflowReason_Initial == aReflowState.reason)
|
||||
if (NS_UNCONSTRAINEDSIZE == kidReflowState.availableWidth)
|
||||
{
|
||||
float p2t;
|
||||
aPresContext.GetScaledPixelsToTwips(&p2t);
|
||||
|
|
|
@ -810,13 +810,15 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
|
|||
printf ("TR %p for cell %p Initial Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, kidSize.width, kidMaxElementSize.width);
|
||||
|
||||
// XXX the following alerts bugs in the content frames.
|
||||
// the following signals bugs in the content frames.
|
||||
if (kidMaxElementSize.width > kidSize.width) {
|
||||
printf("BUG - table cell content max element width greater than desired width \n");
|
||||
printf("WARNING - table cell content max element width %d greater than desired width %d\n",
|
||||
kidMaxElementSize.width, kidSize.width);
|
||||
kidSize.width = kidMaxElementSize.width;
|
||||
}
|
||||
if (kidMaxElementSize.height > kidSize.height) {
|
||||
printf("BUG - table cell content max element height greater than desired height \n");
|
||||
printf("Warning - table cell content max element height %d greater than desired height %d\n",
|
||||
kidMaxElementSize.height, kidSize.height);
|
||||
kidSize.height = kidMaxElementSize.height;
|
||||
}
|
||||
|
||||
|
@ -1289,7 +1291,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext& aPresContext,
|
|||
aReflowState.reflowState,
|
||||
aNextFrame, kidAvailSize);
|
||||
|
||||
// XXX Unfortunately we need to reflow the child several times.
|
||||
// Unfortunately we need to reflow the child several times.
|
||||
// The first time is for the incremental reflow command. We can't pass in
|
||||
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
// the width of the previous reflow...
|
||||
|
|
Загрузка…
Ссылка в новой задаче