зеркало из https://github.com/mozilla/gecko-dev.git
Reduced size of table cell member data by 4 bytes by only storing the
maximum width and not both the width and height. The height was never used so this wans't an issue
This commit is contained in:
Родитель
17c627bc23
Коммит
b3f6ab293f
|
@ -462,7 +462,7 @@ BasicTableLayoutStrategy::ComputeColspanWidths(PRInt32 aWidthIndex,
|
|||
cellWidth = aCellFrame->GetPass1MaxElementSize().width;
|
||||
}
|
||||
else if (DES_CON == aWidthIndex) {
|
||||
cellWidth = aCellFrame->GetPass1DesiredSize().width;
|
||||
cellWidth = aCellFrame->GetMaximumWidth();
|
||||
}
|
||||
else { // FIX width
|
||||
// see if the cell has a style width specified
|
||||
|
@ -738,7 +738,7 @@ PRBool BasicTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aMaxWidth
|
|||
}
|
||||
// these values include borders and padding
|
||||
minWidth = PR_MAX(minWidth, cellFrame->GetPass1MaxElementSize().width);
|
||||
nscoord cellDesWidth = cellFrame->GetPass1DesiredSize().width;
|
||||
nscoord cellDesWidth = cellFrame->GetMaximumWidth();
|
||||
if (cellDesWidth > desWidth) {
|
||||
desContributor = cellFrame;
|
||||
desWidth = cellDesWidth;
|
||||
|
@ -1781,7 +1781,7 @@ PRBool BasicTableLayoutStrategy::ColumnsAreValidFor(const nsTableCellFrame& aCel
|
|||
nscoord colSpan = mTableFrame->GetEffectiveColSpan(&aCellFrame);
|
||||
|
||||
nscoord cellMin = aCellFrame.GetPass1MaxElementSize().width;
|
||||
nscoord cellDes = aCellFrame.GetPass1DesiredSize().width;
|
||||
nscoord cellDes = aCellFrame.GetMaximumWidth();
|
||||
nscoord colMin = colFrame->GetMinWidth();
|
||||
nscoord colDes = colFrame->GetDesWidth();
|
||||
|
||||
|
|
|
@ -178,11 +178,11 @@ public:
|
|||
/** set the desired size returned by this frame during its last reflow */
|
||||
virtual void SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize);
|
||||
|
||||
/** return the desired size returned by this frame during its last reflow */
|
||||
virtual nsSize GetPass1DesiredSize() const;
|
||||
/** return the maximum width of the cell */
|
||||
virtual nscoord GetMaximumWidth() const;
|
||||
|
||||
/** set the desired size returned by this frame during its last reflow */
|
||||
virtual void SetPass1DesiredSize(const nsHTMLReflowMetrics & aDesiredSize);
|
||||
/** set the maximum width of the cell */
|
||||
virtual void SetMaximumWidth(nscoord aMaximumWidth);
|
||||
|
||||
/** return the MaxElement size returned by this frame during its last reflow
|
||||
* not counting reflows where MaxElementSize is not requested.
|
||||
|
@ -248,8 +248,8 @@ protected:
|
|||
/** these are the last computed desired and max element sizes */
|
||||
nsSize mDesiredSize;
|
||||
|
||||
/** these are the Pass 1 unconstrained desired and max element sizes */
|
||||
nsSize mPass1DesiredSize;
|
||||
/** these are the Pass 1 maximum width and max element sizes */
|
||||
nscoord mMaximumWidth;
|
||||
nsSize mPass1MaxElementSize;
|
||||
|
||||
public:
|
||||
|
@ -298,13 +298,12 @@ inline void nsTableCellFrame::SetDesiredSize(const nsHTMLReflowMetrics & aDesire
|
|||
mDesiredSize.height = aDesiredSize.height;
|
||||
}
|
||||
|
||||
inline nsSize nsTableCellFrame::GetPass1DesiredSize() const
|
||||
{ return mPass1DesiredSize; }
|
||||
inline nscoord nsTableCellFrame::GetMaximumWidth() const
|
||||
{ return mMaximumWidth; }
|
||||
|
||||
inline void nsTableCellFrame::SetPass1DesiredSize(const nsHTMLReflowMetrics & aDesiredSize)
|
||||
inline void nsTableCellFrame::SetMaximumWidth(nscoord aMaximumWidth)
|
||||
{
|
||||
mPass1DesiredSize.width = aDesiredSize.width;
|
||||
mPass1DesiredSize.height = aDesiredSize.height;
|
||||
mMaximumWidth = aMaximumWidth;
|
||||
}
|
||||
|
||||
inline nsSize nsTableCellFrame::GetPass1MaxElementSize() const
|
||||
|
|
|
@ -844,7 +844,7 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||
|
||||
if (eReflowReason_Initial == reason) {
|
||||
// Save the pass1 reflow information
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetMaximumWidth(desiredSize.width);
|
||||
if (kidMaxElementSize) {
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(*kidMaxElementSize);
|
||||
}
|
||||
|
@ -1008,7 +1008,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||
kidSize.height = kidMaxElementSize.height;
|
||||
}
|
||||
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetMaximumWidth(kidSize.width);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "unexpected child reflow status");
|
||||
|
||||
|
@ -1243,7 +1243,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||
|
||||
// Remember the current desired size, we'll need it later
|
||||
nsSize oldMinSize = ((nsTableCellFrame*)aNextFrame)->GetPass1MaxElementSize();
|
||||
nsSize oldDesiredSize = ((nsTableCellFrame*)aNextFrame)->GetPass1DesiredSize();
|
||||
nscoord oldMaximumWidth = ((nsTableCellFrame*)aNextFrame)->GetMaximumWidth();
|
||||
|
||||
// Reflow the cell passing it the incremental reflow command. We can't pass
|
||||
// in a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
|
@ -1302,14 +1302,14 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||
#endif
|
||||
|
||||
// Update the cell layout data.
|
||||
((nsTableCellFrame *)aNextFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)aNextFrame)->SetMaximumWidth(desiredSize.width);
|
||||
}
|
||||
|
||||
// Now that we know the minimum and preferred widths see if the column
|
||||
// widths need to be rebalanced
|
||||
if (aReflowState.tableFrame->ColumnsAreValidFor(*(nsTableCellFrame*)aNextFrame,
|
||||
oldMinSize.width,
|
||||
oldDesiredSize.width)) {
|
||||
oldMaximumWidth)) {
|
||||
// The column widths don't need to be rebalanced. Now reflow the cell
|
||||
// again this time constraining the width back to the column width again
|
||||
kidReflowState.reason = eReflowReason_Resize;
|
||||
|
|
|
@ -462,7 +462,7 @@ BasicTableLayoutStrategy::ComputeColspanWidths(PRInt32 aWidthIndex,
|
|||
cellWidth = aCellFrame->GetPass1MaxElementSize().width;
|
||||
}
|
||||
else if (DES_CON == aWidthIndex) {
|
||||
cellWidth = aCellFrame->GetPass1DesiredSize().width;
|
||||
cellWidth = aCellFrame->GetMaximumWidth();
|
||||
}
|
||||
else { // FIX width
|
||||
// see if the cell has a style width specified
|
||||
|
@ -738,7 +738,7 @@ PRBool BasicTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aMaxWidth
|
|||
}
|
||||
// these values include borders and padding
|
||||
minWidth = PR_MAX(minWidth, cellFrame->GetPass1MaxElementSize().width);
|
||||
nscoord cellDesWidth = cellFrame->GetPass1DesiredSize().width;
|
||||
nscoord cellDesWidth = cellFrame->GetMaximumWidth();
|
||||
if (cellDesWidth > desWidth) {
|
||||
desContributor = cellFrame;
|
||||
desWidth = cellDesWidth;
|
||||
|
@ -1781,7 +1781,7 @@ PRBool BasicTableLayoutStrategy::ColumnsAreValidFor(const nsTableCellFrame& aCel
|
|||
nscoord colSpan = mTableFrame->GetEffectiveColSpan(&aCellFrame);
|
||||
|
||||
nscoord cellMin = aCellFrame.GetPass1MaxElementSize().width;
|
||||
nscoord cellDes = aCellFrame.GetPass1DesiredSize().width;
|
||||
nscoord cellDes = aCellFrame.GetMaximumWidth();
|
||||
nscoord colMin = colFrame->GetMinWidth();
|
||||
nscoord colDes = colFrame->GetDesWidth();
|
||||
|
||||
|
|
|
@ -178,11 +178,11 @@ public:
|
|||
/** set the desired size returned by this frame during its last reflow */
|
||||
virtual void SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize);
|
||||
|
||||
/** return the desired size returned by this frame during its last reflow */
|
||||
virtual nsSize GetPass1DesiredSize() const;
|
||||
/** return the maximum width of the cell */
|
||||
virtual nscoord GetMaximumWidth() const;
|
||||
|
||||
/** set the desired size returned by this frame during its last reflow */
|
||||
virtual void SetPass1DesiredSize(const nsHTMLReflowMetrics & aDesiredSize);
|
||||
/** set the maximum width of the cell */
|
||||
virtual void SetMaximumWidth(nscoord aMaximumWidth);
|
||||
|
||||
/** return the MaxElement size returned by this frame during its last reflow
|
||||
* not counting reflows where MaxElementSize is not requested.
|
||||
|
@ -248,8 +248,8 @@ protected:
|
|||
/** these are the last computed desired and max element sizes */
|
||||
nsSize mDesiredSize;
|
||||
|
||||
/** these are the Pass 1 unconstrained desired and max element sizes */
|
||||
nsSize mPass1DesiredSize;
|
||||
/** these are the Pass 1 maximum width and max element sizes */
|
||||
nscoord mMaximumWidth;
|
||||
nsSize mPass1MaxElementSize;
|
||||
|
||||
public:
|
||||
|
@ -298,13 +298,12 @@ inline void nsTableCellFrame::SetDesiredSize(const nsHTMLReflowMetrics & aDesire
|
|||
mDesiredSize.height = aDesiredSize.height;
|
||||
}
|
||||
|
||||
inline nsSize nsTableCellFrame::GetPass1DesiredSize() const
|
||||
{ return mPass1DesiredSize; }
|
||||
inline nscoord nsTableCellFrame::GetMaximumWidth() const
|
||||
{ return mMaximumWidth; }
|
||||
|
||||
inline void nsTableCellFrame::SetPass1DesiredSize(const nsHTMLReflowMetrics & aDesiredSize)
|
||||
inline void nsTableCellFrame::SetMaximumWidth(nscoord aMaximumWidth)
|
||||
{
|
||||
mPass1DesiredSize.width = aDesiredSize.width;
|
||||
mPass1DesiredSize.height = aDesiredSize.height;
|
||||
mMaximumWidth = aMaximumWidth;
|
||||
}
|
||||
|
||||
inline nsSize nsTableCellFrame::GetPass1MaxElementSize() const
|
||||
|
|
|
@ -844,7 +844,7 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||
|
||||
if (eReflowReason_Initial == reason) {
|
||||
// Save the pass1 reflow information
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetMaximumWidth(desiredSize.width);
|
||||
if (kidMaxElementSize) {
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(*kidMaxElementSize);
|
||||
}
|
||||
|
@ -1008,7 +1008,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext* aPresContext,
|
|||
kidSize.height = kidMaxElementSize.height;
|
||||
}
|
||||
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetMaximumWidth(kidSize.width);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "unexpected child reflow status");
|
||||
|
||||
|
@ -1243,7 +1243,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||
|
||||
// Remember the current desired size, we'll need it later
|
||||
nsSize oldMinSize = ((nsTableCellFrame*)aNextFrame)->GetPass1MaxElementSize();
|
||||
nsSize oldDesiredSize = ((nsTableCellFrame*)aNextFrame)->GetPass1DesiredSize();
|
||||
nscoord oldMaximumWidth = ((nsTableCellFrame*)aNextFrame)->GetMaximumWidth();
|
||||
|
||||
// Reflow the cell passing it the incremental reflow command. We can't pass
|
||||
// in a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
|
@ -1302,14 +1302,14 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||
#endif
|
||||
|
||||
// Update the cell layout data.
|
||||
((nsTableCellFrame *)aNextFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)aNextFrame)->SetMaximumWidth(desiredSize.width);
|
||||
}
|
||||
|
||||
// Now that we know the minimum and preferred widths see if the column
|
||||
// widths need to be rebalanced
|
||||
if (aReflowState.tableFrame->ColumnsAreValidFor(*(nsTableCellFrame*)aNextFrame,
|
||||
oldMinSize.width,
|
||||
oldDesiredSize.width)) {
|
||||
oldMaximumWidth)) {
|
||||
// The column widths don't need to be rebalanced. Now reflow the cell
|
||||
// again this time constraining the width back to the column width again
|
||||
kidReflowState.reason = eReflowReason_Resize;
|
||||
|
|
Загрузка…
Ссылка в новой задаче