Some more changes of nsIPresContext* to nsIPresContext&
This commit is contained in:
@@ -272,7 +272,7 @@ void nsTableRowFrame::FixMinCellHeight()
|
|||||||
// Position and size aKidFrame and update our reflow state. The origin of
|
// Position and size aKidFrame and update our reflow state. The origin of
|
||||||
// aKidRect is relative to the upper-left origin of our frame, and includes
|
// aKidRect is relative to the upper-left origin of our frame, and includes
|
||||||
// any left/top margin.
|
// any left/top margin.
|
||||||
void nsTableRowFrame::PlaceChild(nsIPresContext* aPresContext,
|
void nsTableRowFrame::PlaceChild(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
const nsRect& aKidRect,
|
const nsRect& aKidRect,
|
||||||
@@ -323,7 +323,7 @@ void nsTableRowFrame::PlaceChild(nsIPresContext* aPresContext,
|
|||||||
* Called for a resize reflow. Typically because the column widths have
|
* Called for a resize reflow. Typically because the column widths have
|
||||||
* changed. Reflows all the existing table cell frames
|
* changed. Reflows all the existing table cell frames
|
||||||
*/
|
*/
|
||||||
nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsresult nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize)
|
nsReflowMetrics& aDesiredSize)
|
||||||
{
|
{
|
||||||
@@ -399,11 +399,11 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsSize kidAvailSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
nsSize kidAvailSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||||
|
|
||||||
// Reflow the child
|
// Reflow the child
|
||||||
kidFrame->WillReflow(*aPresContext);
|
kidFrame->WillReflow(aPresContext);
|
||||||
kidFrame->MoveTo(aState.x, kidMargin.top);
|
kidFrame->MoveTo(aState.x, kidMargin.top);
|
||||||
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||||
eReflowReason_Resize);
|
eReflowReason_Resize);
|
||||||
nsReflowStatus status = ReflowChild(kidFrame, aPresContext, desiredSize,
|
nsReflowStatus status = ReflowChild(kidFrame, &aPresContext, desiredSize,
|
||||||
kidReflowState);
|
kidReflowState);
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nscoord specifiedHeight = 0;
|
nscoord specifiedHeight = 0;
|
||||||
nscoord cellHeight = desiredSize.height;
|
nscoord cellHeight = desiredSize.height;
|
||||||
nsIStyleContextPtr kidSC;
|
nsIStyleContextPtr kidSC;
|
||||||
kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef());
|
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||||
kidSC->GetStyleData(eStyleStruct_Position);
|
kidSC->GetStyleData(eStyleStruct_Position);
|
||||||
switch (kidPosition->mHeight.GetUnit()) {
|
switch (kidPosition->mHeight.GetUnit()) {
|
||||||
@@ -482,7 +482,7 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
* reflows it to gets its minimum and maximum sizes
|
* reflows it to gets its minimum and maximum sizes
|
||||||
*/
|
*/
|
||||||
nsresult
|
nsresult
|
||||||
nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize)
|
nsReflowMetrics& aDesiredSize)
|
||||||
{
|
{
|
||||||
@@ -506,11 +506,11 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a child frame -- always an nsTableCell frame
|
// Create a child frame -- always an nsTableCell frame
|
||||||
nsIStyleContext* kidSC = aPresContext->ResolveStyleContextFor(cell, this, PR_TRUE);
|
nsIStyleContext* kidSC = aPresContext.ResolveStyleContextFor(cell, this, PR_TRUE);
|
||||||
nsIContentDelegate* kidDel = cell->GetDelegate(aPresContext);
|
nsIContentDelegate* kidDel = cell->GetDelegate(&aPresContext);
|
||||||
nsIFrame* kidFrame;
|
nsIFrame* kidFrame;
|
||||||
|
|
||||||
nsresult result = kidDel->CreateFrame(aPresContext, cell, this, kidSC, kidFrame);
|
nsresult result = kidDel->CreateFrame(&aPresContext, cell, this, kidSC, kidFrame);
|
||||||
NS_RELEASE(kidDel);
|
NS_RELEASE(kidDel);
|
||||||
NS_RELEASE(cell);
|
NS_RELEASE(cell);
|
||||||
if (NS_FAILED(result)) {
|
if (NS_FAILED(result)) {
|
||||||
@@ -561,8 +561,8 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||||||
eReflowReason_Initial);
|
eReflowReason_Initial);
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
kidFrame->WillReflow(*aPresContext);
|
kidFrame->WillReflow(aPresContext);
|
||||||
status = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, kidSize, kidReflowState);
|
||||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
||||||
@@ -613,7 +613,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||||||
// - maxCellHeight
|
// - maxCellHeight
|
||||||
// - maxVertCellSpace
|
// - maxVertCellSpace
|
||||||
// - x
|
// - x
|
||||||
nsresult nsTableRowFrame::RecoverState(nsIPresContext* aPresContext,
|
nsresult nsTableRowFrame::RecoverState(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
nscoord& aMaxCellTopMargin,
|
nscoord& aMaxCellTopMargin,
|
||||||
@@ -643,7 +643,7 @@ nsresult nsTableRowFrame::RecoverState(nsIPresContext* aPresContext,
|
|||||||
// See if it has a specified height that overrides the desired size
|
// See if it has a specified height that overrides the desired size
|
||||||
nscoord specifiedHeight = 0;
|
nscoord specifiedHeight = 0;
|
||||||
nsIStyleContextPtr kidSC;
|
nsIStyleContextPtr kidSC;
|
||||||
frame->GetStyleContext(aPresContext, kidSC.AssignRef());
|
frame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||||
kidSC->GetStyleData(eStyleStruct_Position);
|
kidSC->GetStyleData(eStyleStruct_Position);
|
||||||
switch (kidPosition->mHeight.GetUnit()) {
|
switch (kidPosition->mHeight.GetUnit()) {
|
||||||
@@ -697,7 +697,7 @@ nsresult nsTableRowFrame::RecoverState(nsIPresContext* aPresContext,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize)
|
nsReflowMetrics& aDesiredSize)
|
||||||
{
|
{
|
||||||
@@ -752,14 +752,14 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsSize kidMaxElementSize;
|
nsSize kidMaxElementSize;
|
||||||
nsReflowMetrics desiredSize(&kidMaxElementSize);
|
nsReflowMetrics desiredSize(&kidMaxElementSize);
|
||||||
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
||||||
kidFrame->WillReflow(*aPresContext);
|
kidFrame->WillReflow(aPresContext);
|
||||||
kidFrame->MoveTo(aState.x, kidMargin.top);
|
kidFrame->MoveTo(aState.x, kidMargin.top);
|
||||||
|
|
||||||
// XXX Unfortunately we need to reflow the child several times.
|
// XXX Unfortunately we need to reflow the child several times.
|
||||||
// The first time is for the incremental reflow command. We can't pass in
|
// 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
|
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||||
// the width of the previous reflow...
|
// the width of the previous reflow...
|
||||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||||
|
|
||||||
// Now do the regular pass 1 reflow and gather the max width and max element
|
// Now do the regular pass 1 reflow and gather the max width and max element
|
||||||
// size.
|
// size.
|
||||||
@@ -768,7 +768,7 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
kidReflowState.reason = eReflowReason_Resize;
|
kidReflowState.reason = eReflowReason_Resize;
|
||||||
kidReflowState.reflowCommand = nsnull;
|
kidReflowState.reflowCommand = nsnull;
|
||||||
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
||||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||||
|
|
||||||
// Update the cell layout data.
|
// Update the cell layout data.
|
||||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||||
@@ -777,16 +777,16 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
// Now reflow the cell again this time constraining the width
|
// Now reflow the cell again this time constraining the width
|
||||||
// XXX Ignore for now the possibility that the column width has changed...
|
// XXX Ignore for now the possibility that the column width has changed...
|
||||||
kidReflowState.maxSize.width = availWidth;
|
kidReflowState.maxSize.width = availWidth;
|
||||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||||
|
|
||||||
// Place the child after taking into account it's margin and attributes
|
// Place the child after taking into account it's margin and attributes
|
||||||
// XXX We need to ask the table (or the table layout strategy) if the column
|
// XXX We need to ask the table (or the table layout strategy) if the column
|
||||||
// widths have changed. If so we just bail and return a status indicating
|
// widths have changed. If so, we just bail and return a status indicating
|
||||||
// what happened and let the table reflow all the table cells...
|
// what happened and let the table reflow all the table cells...
|
||||||
nscoord specifiedHeight = 0;
|
nscoord specifiedHeight = 0;
|
||||||
nscoord cellHeight = desiredSize.height;
|
nscoord cellHeight = desiredSize.height;
|
||||||
nsIStyleContextPtr kidSC;
|
nsIStyleContextPtr kidSC;
|
||||||
kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef());
|
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||||
kidSC->GetStyleData(eStyleStruct_Position);
|
kidSC->GetStyleData(eStyleStruct_Position);
|
||||||
switch (kidPosition->mHeight.GetUnit()) {
|
switch (kidPosition->mHeight.GetUnit()) {
|
||||||
@@ -864,17 +864,17 @@ nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
|
|||||||
switch (aReflowState.reason) {
|
switch (aReflowState.reason) {
|
||||||
case eReflowReason_Initial:
|
case eReflowReason_Initial:
|
||||||
NS_ASSERTION(nsnull == mFirstChild, "unexpected reflow reason");
|
NS_ASSERTION(nsnull == mFirstChild, "unexpected reflow reason");
|
||||||
result = InitialReflow(&aPresContext, state, aDesiredSize);
|
result = InitialReflow(aPresContext, state, aDesiredSize);
|
||||||
GetMinRowSpan();
|
GetMinRowSpan();
|
||||||
FixMinCellHeight();
|
FixMinCellHeight();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eReflowReason_Resize:
|
case eReflowReason_Resize:
|
||||||
result = ResizeReflow(&aPresContext, state, aDesiredSize);
|
result = ResizeReflow(aPresContext, state, aDesiredSize);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eReflowReason_Incremental:
|
case eReflowReason_Incremental:
|
||||||
result = IncrementalReflow(&aPresContext, state, aDesiredSize);
|
result = IncrementalReflow(aPresContext, state, aDesiredSize);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,13 +127,13 @@ protected:
|
|||||||
|
|
||||||
void FixMinCellHeight();
|
void FixMinCellHeight();
|
||||||
|
|
||||||
nsresult RecoverState(nsIPresContext* aPresContext,
|
nsresult RecoverState(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
nscoord& aMaxCellTopMargin,
|
nscoord& aMaxCellTopMargin,
|
||||||
nscoord& aMaxCellBottomMargin);
|
nscoord& aMaxCellBottomMargin);
|
||||||
|
|
||||||
void PlaceChild(nsIPresContext* aPresContext,
|
void PlaceChild(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
const nsRect& aKidRect,
|
const nsRect& aKidRect,
|
||||||
@@ -150,7 +150,7 @@ protected:
|
|||||||
* Called for a resize reflow. Typically because the column widths have
|
* Called for a resize reflow. Typically because the column widths have
|
||||||
* changed. Reflows all the existing table cell frames
|
* changed. Reflows all the existing table cell frames
|
||||||
*/
|
*/
|
||||||
nsresult ResizeReflow(nsIPresContext* aPresContext,
|
nsresult ResizeReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize);
|
nsReflowMetrics& aDesiredSize);
|
||||||
|
|
||||||
@@ -158,14 +158,14 @@ protected:
|
|||||||
* Called for the initial reflow. Creates each table cell frame, and
|
* Called for the initial reflow. Creates each table cell frame, and
|
||||||
* reflows the cell frame to gets its minimum and maximum sizes
|
* reflows the cell frame to gets its minimum and maximum sizes
|
||||||
*/
|
*/
|
||||||
nsresult InitialReflow(nsIPresContext* aPresContext,
|
nsresult InitialReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize);
|
nsReflowMetrics& aDesiredSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called for incremental reflow
|
* Called for incremental reflow
|
||||||
*/
|
*/
|
||||||
nsresult IncrementalReflow(nsIPresContext* aPresContext,
|
nsresult IncrementalReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize);
|
nsReflowMetrics& aDesiredSize);
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ void nsTableRowFrame::FixMinCellHeight()
|
|||||||
// Position and size aKidFrame and update our reflow state. The origin of
|
// Position and size aKidFrame and update our reflow state. The origin of
|
||||||
// aKidRect is relative to the upper-left origin of our frame, and includes
|
// aKidRect is relative to the upper-left origin of our frame, and includes
|
||||||
// any left/top margin.
|
// any left/top margin.
|
||||||
void nsTableRowFrame::PlaceChild(nsIPresContext* aPresContext,
|
void nsTableRowFrame::PlaceChild(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
const nsRect& aKidRect,
|
const nsRect& aKidRect,
|
||||||
@@ -323,7 +323,7 @@ void nsTableRowFrame::PlaceChild(nsIPresContext* aPresContext,
|
|||||||
* Called for a resize reflow. Typically because the column widths have
|
* Called for a resize reflow. Typically because the column widths have
|
||||||
* changed. Reflows all the existing table cell frames
|
* changed. Reflows all the existing table cell frames
|
||||||
*/
|
*/
|
||||||
nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsresult nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize)
|
nsReflowMetrics& aDesiredSize)
|
||||||
{
|
{
|
||||||
@@ -399,11 +399,11 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsSize kidAvailSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
nsSize kidAvailSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||||
|
|
||||||
// Reflow the child
|
// Reflow the child
|
||||||
kidFrame->WillReflow(*aPresContext);
|
kidFrame->WillReflow(aPresContext);
|
||||||
kidFrame->MoveTo(aState.x, kidMargin.top);
|
kidFrame->MoveTo(aState.x, kidMargin.top);
|
||||||
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||||
eReflowReason_Resize);
|
eReflowReason_Resize);
|
||||||
nsReflowStatus status = ReflowChild(kidFrame, aPresContext, desiredSize,
|
nsReflowStatus status = ReflowChild(kidFrame, &aPresContext, desiredSize,
|
||||||
kidReflowState);
|
kidReflowState);
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nscoord specifiedHeight = 0;
|
nscoord specifiedHeight = 0;
|
||||||
nscoord cellHeight = desiredSize.height;
|
nscoord cellHeight = desiredSize.height;
|
||||||
nsIStyleContextPtr kidSC;
|
nsIStyleContextPtr kidSC;
|
||||||
kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef());
|
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||||
kidSC->GetStyleData(eStyleStruct_Position);
|
kidSC->GetStyleData(eStyleStruct_Position);
|
||||||
switch (kidPosition->mHeight.GetUnit()) {
|
switch (kidPosition->mHeight.GetUnit()) {
|
||||||
@@ -482,7 +482,7 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
* reflows it to gets its minimum and maximum sizes
|
* reflows it to gets its minimum and maximum sizes
|
||||||
*/
|
*/
|
||||||
nsresult
|
nsresult
|
||||||
nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize)
|
nsReflowMetrics& aDesiredSize)
|
||||||
{
|
{
|
||||||
@@ -506,11 +506,11 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a child frame -- always an nsTableCell frame
|
// Create a child frame -- always an nsTableCell frame
|
||||||
nsIStyleContext* kidSC = aPresContext->ResolveStyleContextFor(cell, this, PR_TRUE);
|
nsIStyleContext* kidSC = aPresContext.ResolveStyleContextFor(cell, this, PR_TRUE);
|
||||||
nsIContentDelegate* kidDel = cell->GetDelegate(aPresContext);
|
nsIContentDelegate* kidDel = cell->GetDelegate(&aPresContext);
|
||||||
nsIFrame* kidFrame;
|
nsIFrame* kidFrame;
|
||||||
|
|
||||||
nsresult result = kidDel->CreateFrame(aPresContext, cell, this, kidSC, kidFrame);
|
nsresult result = kidDel->CreateFrame(&aPresContext, cell, this, kidSC, kidFrame);
|
||||||
NS_RELEASE(kidDel);
|
NS_RELEASE(kidDel);
|
||||||
NS_RELEASE(cell);
|
NS_RELEASE(cell);
|
||||||
if (NS_FAILED(result)) {
|
if (NS_FAILED(result)) {
|
||||||
@@ -561,8 +561,8 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||||||
eReflowReason_Initial);
|
eReflowReason_Initial);
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
kidFrame->WillReflow(*aPresContext);
|
kidFrame->WillReflow(aPresContext);
|
||||||
status = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, kidSize, kidReflowState);
|
||||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
||||||
@@ -613,7 +613,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||||||
// - maxCellHeight
|
// - maxCellHeight
|
||||||
// - maxVertCellSpace
|
// - maxVertCellSpace
|
||||||
// - x
|
// - x
|
||||||
nsresult nsTableRowFrame::RecoverState(nsIPresContext* aPresContext,
|
nsresult nsTableRowFrame::RecoverState(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
nscoord& aMaxCellTopMargin,
|
nscoord& aMaxCellTopMargin,
|
||||||
@@ -643,7 +643,7 @@ nsresult nsTableRowFrame::RecoverState(nsIPresContext* aPresContext,
|
|||||||
// See if it has a specified height that overrides the desired size
|
// See if it has a specified height that overrides the desired size
|
||||||
nscoord specifiedHeight = 0;
|
nscoord specifiedHeight = 0;
|
||||||
nsIStyleContextPtr kidSC;
|
nsIStyleContextPtr kidSC;
|
||||||
frame->GetStyleContext(aPresContext, kidSC.AssignRef());
|
frame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||||
kidSC->GetStyleData(eStyleStruct_Position);
|
kidSC->GetStyleData(eStyleStruct_Position);
|
||||||
switch (kidPosition->mHeight.GetUnit()) {
|
switch (kidPosition->mHeight.GetUnit()) {
|
||||||
@@ -697,7 +697,7 @@ nsresult nsTableRowFrame::RecoverState(nsIPresContext* aPresContext,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize)
|
nsReflowMetrics& aDesiredSize)
|
||||||
{
|
{
|
||||||
@@ -752,14 +752,14 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsSize kidMaxElementSize;
|
nsSize kidMaxElementSize;
|
||||||
nsReflowMetrics desiredSize(&kidMaxElementSize);
|
nsReflowMetrics desiredSize(&kidMaxElementSize);
|
||||||
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
nsReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
||||||
kidFrame->WillReflow(*aPresContext);
|
kidFrame->WillReflow(aPresContext);
|
||||||
kidFrame->MoveTo(aState.x, kidMargin.top);
|
kidFrame->MoveTo(aState.x, kidMargin.top);
|
||||||
|
|
||||||
// XXX Unfortunately we need to reflow the child several times.
|
// XXX Unfortunately we need to reflow the child several times.
|
||||||
// The first time is for the incremental reflow command. We can't pass in
|
// 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
|
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||||
// the width of the previous reflow...
|
// the width of the previous reflow...
|
||||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||||
|
|
||||||
// Now do the regular pass 1 reflow and gather the max width and max element
|
// Now do the regular pass 1 reflow and gather the max width and max element
|
||||||
// size.
|
// size.
|
||||||
@@ -768,7 +768,7 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
kidReflowState.reason = eReflowReason_Resize;
|
kidReflowState.reason = eReflowReason_Resize;
|
||||||
kidReflowState.reflowCommand = nsnull;
|
kidReflowState.reflowCommand = nsnull;
|
||||||
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
||||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||||
|
|
||||||
// Update the cell layout data.
|
// Update the cell layout data.
|
||||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||||
@@ -777,16 +777,16 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
// Now reflow the cell again this time constraining the width
|
// Now reflow the cell again this time constraining the width
|
||||||
// XXX Ignore for now the possibility that the column width has changed...
|
// XXX Ignore for now the possibility that the column width has changed...
|
||||||
kidReflowState.maxSize.width = availWidth;
|
kidReflowState.maxSize.width = availWidth;
|
||||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||||
|
|
||||||
// Place the child after taking into account it's margin and attributes
|
// Place the child after taking into account it's margin and attributes
|
||||||
// XXX We need to ask the table (or the table layout strategy) if the column
|
// XXX We need to ask the table (or the table layout strategy) if the column
|
||||||
// widths have changed. If so we just bail and return a status indicating
|
// widths have changed. If so, we just bail and return a status indicating
|
||||||
// what happened and let the table reflow all the table cells...
|
// what happened and let the table reflow all the table cells...
|
||||||
nscoord specifiedHeight = 0;
|
nscoord specifiedHeight = 0;
|
||||||
nscoord cellHeight = desiredSize.height;
|
nscoord cellHeight = desiredSize.height;
|
||||||
nsIStyleContextPtr kidSC;
|
nsIStyleContextPtr kidSC;
|
||||||
kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef());
|
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||||
kidSC->GetStyleData(eStyleStruct_Position);
|
kidSC->GetStyleData(eStyleStruct_Position);
|
||||||
switch (kidPosition->mHeight.GetUnit()) {
|
switch (kidPosition->mHeight.GetUnit()) {
|
||||||
@@ -864,17 +864,17 @@ nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
|
|||||||
switch (aReflowState.reason) {
|
switch (aReflowState.reason) {
|
||||||
case eReflowReason_Initial:
|
case eReflowReason_Initial:
|
||||||
NS_ASSERTION(nsnull == mFirstChild, "unexpected reflow reason");
|
NS_ASSERTION(nsnull == mFirstChild, "unexpected reflow reason");
|
||||||
result = InitialReflow(&aPresContext, state, aDesiredSize);
|
result = InitialReflow(aPresContext, state, aDesiredSize);
|
||||||
GetMinRowSpan();
|
GetMinRowSpan();
|
||||||
FixMinCellHeight();
|
FixMinCellHeight();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eReflowReason_Resize:
|
case eReflowReason_Resize:
|
||||||
result = ResizeReflow(&aPresContext, state, aDesiredSize);
|
result = ResizeReflow(aPresContext, state, aDesiredSize);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eReflowReason_Incremental:
|
case eReflowReason_Incremental:
|
||||||
result = IncrementalReflow(&aPresContext, state, aDesiredSize);
|
result = IncrementalReflow(aPresContext, state, aDesiredSize);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,13 +127,13 @@ protected:
|
|||||||
|
|
||||||
void FixMinCellHeight();
|
void FixMinCellHeight();
|
||||||
|
|
||||||
nsresult RecoverState(nsIPresContext* aPresContext,
|
nsresult RecoverState(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
nscoord& aMaxCellTopMargin,
|
nscoord& aMaxCellTopMargin,
|
||||||
nscoord& aMaxCellBottomMargin);
|
nscoord& aMaxCellBottomMargin);
|
||||||
|
|
||||||
void PlaceChild(nsIPresContext* aPresContext,
|
void PlaceChild(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
const nsRect& aKidRect,
|
const nsRect& aKidRect,
|
||||||
@@ -150,7 +150,7 @@ protected:
|
|||||||
* Called for a resize reflow. Typically because the column widths have
|
* Called for a resize reflow. Typically because the column widths have
|
||||||
* changed. Reflows all the existing table cell frames
|
* changed. Reflows all the existing table cell frames
|
||||||
*/
|
*/
|
||||||
nsresult ResizeReflow(nsIPresContext* aPresContext,
|
nsresult ResizeReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize);
|
nsReflowMetrics& aDesiredSize);
|
||||||
|
|
||||||
@@ -158,14 +158,14 @@ protected:
|
|||||||
* Called for the initial reflow. Creates each table cell frame, and
|
* Called for the initial reflow. Creates each table cell frame, and
|
||||||
* reflows the cell frame to gets its minimum and maximum sizes
|
* reflows the cell frame to gets its minimum and maximum sizes
|
||||||
*/
|
*/
|
||||||
nsresult InitialReflow(nsIPresContext* aPresContext,
|
nsresult InitialReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize);
|
nsReflowMetrics& aDesiredSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called for incremental reflow
|
* Called for incremental reflow
|
||||||
*/
|
*/
|
||||||
nsresult IncrementalReflow(nsIPresContext* aPresContext,
|
nsresult IncrementalReflow(nsIPresContext& aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsReflowMetrics& aDesiredSize);
|
nsReflowMetrics& aDesiredSize);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user