Tweaks to be able to see the RowReflowState over in trees

git-svn-id: svn://10.0.0.236/trunk@44961 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com 1999-08-28 00:43:53 +00:00
parent 516ab81888
commit fe110b68b9
6 changed files with 66 additions and 68 deletions

View File

@ -43,39 +43,6 @@ static NS_DEFINE_IID(kIHTMLTableCellElementIID, NS_IHTMLTABLECELLELEMENT_IID);
NS_DEF_PTR(nsIStyleContext);
/* ----------- RowReflowState ---------- */
struct RowReflowState {
// Our reflow state
const nsHTMLReflowState& reflowState;
// The body's available size (computed from the body's parent)
nsSize availSize;
// the running x-offset
nscoord x;
// Height of tallest cell (excluding cells with rowspan > 1)
nscoord maxCellHeight; // just the height of the cell frame
nscoord maxCellVertSpace; // the maximum MAX(cellheight + topMargin + bottomMargin)
nsTableFrame *tableFrame;
RowReflowState(const nsHTMLReflowState& aReflowState,
nsTableFrame* aTableFrame)
: reflowState(aReflowState)
{
availSize.width = reflowState.availableWidth;
availSize.height = reflowState.availableHeight;
maxCellHeight = 0;
maxCellVertSpace = 0;
tableFrame = aTableFrame;
x=0;
}
};
/* ----------- nsTableRowpFrame ---------- */

View File

@ -23,7 +23,37 @@
class nsTableFrame;
class nsTableCellFrame;
struct RowReflowState;
/* ----------- RowReflowState ---------- */
struct RowReflowState {
// Our reflow state
const nsHTMLReflowState& reflowState;
// The body's available size (computed from the body's parent)
nsSize availSize;
// the running x-offset
nscoord x;
// Height of tallest cell (excluding cells with rowspan > 1)
nscoord maxCellHeight; // just the height of the cell frame
nscoord maxCellVertSpace; // the maximum MAX(cellheight + topMargin + bottomMargin)
nsTableFrame *tableFrame;
RowReflowState(const nsHTMLReflowState& aReflowState,
nsTableFrame* aTableFrame)
: reflowState(aReflowState)
{
availSize.width = reflowState.availableWidth;
availSize.height = reflowState.availableHeight;
maxCellHeight = 0;
maxCellVertSpace = 0;
tableFrame = aTableFrame;
x=0;
}
};
/**
* nsTableRowFrame is the frame that maps table rows

View File

@ -1474,6 +1474,8 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext& aPresConte
// Inform the row of its new height.
PRBool isJustSingleRow = PR_FALSE; /* how to determine this now? */
if (isJustSingleRow) {
// XXX If someone enables this, note that this is a bad cast, since your
// child could be a nested table row group (the tree widget strikes again).
((nsTableRowFrame*)aNextFrame)->DidResize(aPresContext, aReflowState.reflowState);
// Adjust the frames that follow...

View File

@ -43,39 +43,6 @@ static NS_DEFINE_IID(kIHTMLTableCellElementIID, NS_IHTMLTABLECELLELEMENT_IID);
NS_DEF_PTR(nsIStyleContext);
/* ----------- RowReflowState ---------- */
struct RowReflowState {
// Our reflow state
const nsHTMLReflowState& reflowState;
// The body's available size (computed from the body's parent)
nsSize availSize;
// the running x-offset
nscoord x;
// Height of tallest cell (excluding cells with rowspan > 1)
nscoord maxCellHeight; // just the height of the cell frame
nscoord maxCellVertSpace; // the maximum MAX(cellheight + topMargin + bottomMargin)
nsTableFrame *tableFrame;
RowReflowState(const nsHTMLReflowState& aReflowState,
nsTableFrame* aTableFrame)
: reflowState(aReflowState)
{
availSize.width = reflowState.availableWidth;
availSize.height = reflowState.availableHeight;
maxCellHeight = 0;
maxCellVertSpace = 0;
tableFrame = aTableFrame;
x=0;
}
};
/* ----------- nsTableRowpFrame ---------- */

View File

@ -23,7 +23,37 @@
class nsTableFrame;
class nsTableCellFrame;
struct RowReflowState;
/* ----------- RowReflowState ---------- */
struct RowReflowState {
// Our reflow state
const nsHTMLReflowState& reflowState;
// The body's available size (computed from the body's parent)
nsSize availSize;
// the running x-offset
nscoord x;
// Height of tallest cell (excluding cells with rowspan > 1)
nscoord maxCellHeight; // just the height of the cell frame
nscoord maxCellVertSpace; // the maximum MAX(cellheight + topMargin + bottomMargin)
nsTableFrame *tableFrame;
RowReflowState(const nsHTMLReflowState& aReflowState,
nsTableFrame* aTableFrame)
: reflowState(aReflowState)
{
availSize.width = reflowState.availableWidth;
availSize.height = reflowState.availableHeight;
maxCellHeight = 0;
maxCellVertSpace = 0;
tableFrame = aTableFrame;
x=0;
}
};
/**
* nsTableRowFrame is the frame that maps table rows

View File

@ -1474,6 +1474,8 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext& aPresConte
// Inform the row of its new height.
PRBool isJustSingleRow = PR_FALSE; /* how to determine this now? */
if (isJustSingleRow) {
// XXX If someone enables this, note that this is a bad cast, since your
// child could be a nested table row group (the tree widget strikes again).
((nsTableRowFrame*)aNextFrame)->DidResize(aPresContext, aReflowState.reflowState);
// Adjust the frames that follow...