2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 14:30:37 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-28 20:14:13 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 14:30:37 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-28 20:14:13 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 14:30:37 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-28 20:14:13 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 14:30:37 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-28 20:14:13 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-04-13 20:24:54 +00:00
|
|
|
#ifndef nsTableRowFrame_h__
|
|
|
|
#define nsTableRowFrame_h__
|
|
|
|
|
|
|
|
#include "nscore.h"
|
1998-10-20 17:45:07 +00:00
|
|
|
#include "nsHTMLContainerFrame.h"
|
2004-03-09 06:48:35 +00:00
|
|
|
#include "nsTablePainter.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-21 23:43:18 +00:00
|
|
|
class nsTableFrame;
|
1998-06-05 02:36:25 +00:00
|
|
|
class nsTableCellFrame;
|
2002-02-19 15:48:28 +00:00
|
|
|
struct nsTableCellReflowState;
|
1999-08-28 00:43:53 +00:00
|
|
|
|
2001-01-25 15:55:51 +00:00
|
|
|
#ifdef DEBUG_TABLE_REFLOW_TIMING
|
|
|
|
class nsReflowTimer;
|
|
|
|
#endif
|
|
|
|
|
2001-11-29 15:41:07 +00:00
|
|
|
#define NS_ROW_NEED_SPECIAL_REFLOW 0x20000000
|
|
|
|
#define NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT 0x40000000
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
1998-04-14 21:45:28 +00:00
|
|
|
* nsTableRowFrame is the frame that maps table rows
|
|
|
|
* (HTML tag TR). This class cannot be reused
|
|
|
|
* outside of an nsTableRowGroupFrame. It assumes that its parent is an nsTableRowGroupFrame,
|
|
|
|
* and its children are nsTableCellFrames.
|
|
|
|
*
|
|
|
|
* @see nsTableFrame
|
|
|
|
* @see nsTableRowGroupFrame
|
|
|
|
* @see nsTableCellFrame
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
1998-10-20 17:45:07 +00:00
|
|
|
class nsTableRowFrame : public nsHTMLContainerFrame
|
1998-04-13 20:24:54 +00:00
|
|
|
{
|
|
|
|
public:
|
2001-01-25 15:55:51 +00:00
|
|
|
virtual ~nsTableRowFrame();
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Init(nsPresContext* aPresContext,
|
1999-02-25 05:31:15 +00:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
2003-02-22 00:32:13 +00:00
|
|
|
nsStyleContext* aContext,
|
1999-02-25 05:31:15 +00:00
|
|
|
nsIFrame* aPrevInFlow);
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD AppendFrames(nsPresContext* aPresContext,
|
1999-08-03 02:41:27 +00:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aFrameList);
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD InsertFrames(nsPresContext* aPresContext,
|
1999-08-03 02:41:27 +00:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList);
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD RemoveFrame(nsPresContext* aPresContext,
|
1999-08-03 02:41:27 +00:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame);
|
|
|
|
|
1998-04-14 21:45:28 +00:00
|
|
|
/** instantiate a new instance of nsTableRowFrame.
|
1998-09-15 17:58:24 +00:00
|
|
|
* @param aResult the new object is returned in this out-param
|
|
|
|
* @param aContent the table object to map
|
|
|
|
* @param aParent the parent of the new frame
|
1998-04-14 21:45:28 +00:00
|
|
|
*
|
|
|
|
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
|
|
|
*/
|
1998-09-15 17:58:24 +00:00
|
|
|
friend nsresult
|
1999-12-04 23:49:50 +00:00
|
|
|
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
1998-09-16 17:19:20 +00:00
|
|
|
|
1998-04-14 21:45:28 +00:00
|
|
|
/** @see nsIFrame::Paint */
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Paint(nsPresContext* aPresContext,
|
1998-04-17 01:41:24 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
1998-12-18 15:54:23 +00:00
|
|
|
const nsRect& aDirtyRect,
|
2001-09-19 12:35:19 +00:00
|
|
|
nsFramePaintLayer aWhichLayer,
|
|
|
|
PRUint32 aFlags = 0);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2004-03-01 08:17:59 +00:00
|
|
|
// rows don't paint their own background -- the cells do
|
|
|
|
virtual PRBool CanPaintBackground() { return PR_FALSE; }
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD GetFrameForPoint(nsPresContext* aPresContext,
|
2001-03-13 06:38:59 +00:00
|
|
|
const nsPoint& aPoint,
|
2000-03-22 02:43:08 +00:00
|
|
|
nsFramePaintLayer aWhichLayer,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsIFrame** aFrame);
|
2000-03-22 02:43:08 +00:00
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
nsTableCellFrame* GetFirstCell() ;
|
|
|
|
|
1998-05-25 17:31:49 +00:00
|
|
|
/** calls Reflow for all of its child cells.
|
1998-04-14 21:45:28 +00:00
|
|
|
* Cells with rowspan=1 are all set to the same height and stacked horizontally.
|
|
|
|
* <P> Cells are not split unless absolutely necessary.
|
|
|
|
* <P> Cells are resized in nsTableFrame::BalanceColumnWidths
|
|
|
|
* and nsTableFrame::ShrinkWrapChildren
|
|
|
|
*
|
|
|
|
* @param aDesiredSize width set to width of the sum of the cells, height set to
|
|
|
|
* height of cells with rowspan=1.
|
|
|
|
*
|
1998-05-25 17:31:49 +00:00
|
|
|
* @see nsIFrame::Reflow
|
1998-04-14 21:45:28 +00:00
|
|
|
* @see nsTableFrame::BalanceColumnWidths
|
|
|
|
* @see nsTableFrame::ShrinkWrapChildren
|
|
|
|
*/
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
1998-10-02 04:10:00 +00:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsReflowStatus& aStatus);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
void DidResize(nsPresContext* aPresContext,
|
2003-09-13 16:26:30 +00:00
|
|
|
const nsHTMLReflowState& aReflowState);
|
1998-07-02 20:35:23 +00:00
|
|
|
|
1999-02-24 05:54:31 +00:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsLayoutAtoms::tableRowFrame
|
|
|
|
*/
|
2003-10-31 20:19:18 +00:00
|
|
|
virtual nsIAtom* GetType() const;
|
1999-02-24 05:54:31 +00:00
|
|
|
|
1999-09-01 01:02:16 +00:00
|
|
|
#ifdef DEBUG
|
2001-11-14 01:33:42 +00:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
1999-09-01 01:02:16 +00:00
|
|
|
#endif
|
2000-05-25 22:40:21 +00:00
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
void UpdateHeight(nscoord aHeight,
|
|
|
|
nscoord aAscent,
|
|
|
|
nscoord aDescent,
|
|
|
|
nsTableFrame* aTableFrame = nsnull,
|
|
|
|
nsTableCellFrame* aCellFrame = nsnull);
|
2000-05-25 22:40:21 +00:00
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
void ResetHeight(nscoord aRowStyleHeight);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
// calculate the height, considering content height of the
|
|
|
|
// cells and the style height of the row and cells, excluding pct heights
|
|
|
|
nscoord CalcHeight(const nsHTMLReflowState& aReflowState);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2000-06-05 08:25:11 +00:00
|
|
|
// Support for cells with 'vertical-align: baseline'.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* returns the max-ascent amongst all the cells that have
|
2000-07-28 09:19:26 +00:00
|
|
|
* 'vertical-align: baseline', *including* cells with rowspans.
|
2000-06-05 08:25:11 +00:00
|
|
|
* returns 0 if we don't have any cell with 'vertical-align: baseline'
|
|
|
|
*/
|
|
|
|
nscoord GetMaxCellAscent() const;
|
|
|
|
|
1998-06-17 16:38:24 +00:00
|
|
|
/** returns the ordinal position of this row in its table */
|
|
|
|
virtual PRInt32 GetRowIndex() const;
|
|
|
|
|
|
|
|
/** set this row's starting row index */
|
1998-12-16 04:31:38 +00:00
|
|
|
void SetRowIndex (int aRowIndex);
|
1998-06-17 16:38:24 +00:00
|
|
|
|
2001-04-16 14:51:52 +00:00
|
|
|
/** used by row group frame code */
|
2004-07-31 23:15:21 +00:00
|
|
|
nscoord ReflowCellFrame(nsPresContext* aPresContext,
|
2001-04-16 14:51:52 +00:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsTableCellFrame* aCellFrame,
|
|
|
|
nscoord aAvailableHeight,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
void InsertCellFrame(nsTableCellFrame* aFrame,
|
|
|
|
nsTableCellFrame* aPrevSibling);
|
1999-02-22 03:28:00 +00:00
|
|
|
|
2001-04-16 14:51:52 +00:00
|
|
|
void InsertCellFrame(nsTableCellFrame* aFrame,
|
|
|
|
PRInt32 aColIndex);
|
|
|
|
|
|
|
|
void RemoveCellFrame(nsTableCellFrame* aFrame);
|
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
nsresult CalculateCellActualSize(nsIFrame* aRowFrame,
|
|
|
|
nscoord& aDesiredWidth,
|
|
|
|
nscoord& aDesiredHeight,
|
|
|
|
nscoord aAvailWidth);
|
2000-02-03 14:04:49 +00:00
|
|
|
|
2001-08-06 14:48:09 +00:00
|
|
|
PRBool IsFirstInserted() const;
|
|
|
|
void SetFirstInserted(PRBool aValue);
|
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
PRBool NeedSpecialReflow() const;
|
|
|
|
void SetNeedSpecialReflow(PRBool aValue);
|
|
|
|
|
|
|
|
PRBool GetContentHeight() const;
|
|
|
|
void SetContentHeight(nscoord aTwipValue);
|
|
|
|
|
|
|
|
PRBool HasStyleHeight() const;
|
|
|
|
|
|
|
|
PRBool HasFixedHeight() const;
|
|
|
|
void SetHasFixedHeight(PRBool aValue);
|
|
|
|
|
|
|
|
PRBool HasPctHeight() const;
|
|
|
|
void SetHasPctHeight(PRBool aValue);
|
|
|
|
|
|
|
|
nscoord GetFixedHeight() const;
|
|
|
|
void SetFixedHeight(nscoord aValue);
|
|
|
|
|
|
|
|
float GetPctHeight() const;
|
2001-11-05 15:15:24 +00:00
|
|
|
void SetPctHeight(float aPctValue,
|
|
|
|
PRBool aForce = PR_FALSE);
|
2001-11-05 00:15:51 +00:00
|
|
|
|
|
|
|
nscoord GetHeight(nscoord aBasis = 0) const;
|
|
|
|
|
|
|
|
nsTableRowFrame* GetNextRow() const;
|
|
|
|
|
2001-11-29 15:41:07 +00:00
|
|
|
PRBool HasUnpaginatedHeight();
|
|
|
|
void SetHasUnpaginatedHeight(PRBool aValue);
|
2004-07-31 23:15:21 +00:00
|
|
|
nscoord GetUnpaginatedHeight(nsPresContext* aPresContext);
|
|
|
|
void SetUnpaginatedHeight(nsPresContext* aPresContext, nscoord aValue);
|
2001-11-29 15:41:07 +00:00
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
nscoord GetTopBCBorderWidth(float* aPixelsToTwips = nsnull);
|
2004-03-09 06:48:35 +00:00
|
|
|
void SetTopBCBorderWidth(BCPixelSize aWidth);
|
2002-02-19 15:48:28 +00:00
|
|
|
nscoord GetBottomBCBorderWidth(float* aPixelsToTwips = nsnull);
|
2004-03-09 06:48:35 +00:00
|
|
|
void SetBottomBCBorderWidth(BCPixelSize aWidth);
|
2002-02-19 15:48:28 +00:00
|
|
|
nsMargin* GetBCBorderWidth(float aPixelsToTwips,
|
|
|
|
nsMargin& aBorder);
|
2004-03-09 06:48:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets inner border widths before collapsing with cell borders
|
|
|
|
* Caller must get bottom border from next row or from table
|
|
|
|
* GetContinuousBCBorderWidth will not overwrite aBorder.bottom
|
|
|
|
* see nsTablePainter about continuous borders
|
|
|
|
*/
|
|
|
|
void GetContinuousBCBorderWidth(float aPixelsToTwips,
|
|
|
|
nsMargin& aBorder);
|
|
|
|
/**
|
|
|
|
* @returns outer top bc border == prev row's bottom inner
|
|
|
|
*/
|
|
|
|
nscoord GetOuterTopContBCBorderWidth(float aPixelsToTwips);
|
|
|
|
/**
|
|
|
|
* Sets full border widths before collapsing with cell borders
|
|
|
|
* @param aForSide - side to set; only accepts right, left, and top
|
|
|
|
*/
|
|
|
|
void SetContinuousBCBorderWidth(PRUint8 aForSide,
|
|
|
|
BCPixelSize aPixelValue);
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
protected:
|
|
|
|
|
1998-04-14 21:45:28 +00:00
|
|
|
/** protected constructor.
|
|
|
|
* @see NewFrame
|
|
|
|
*/
|
1998-12-03 06:31:43 +00:00
|
|
|
nsTableRowFrame();
|
1998-04-23 17:29:07 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
void InitChildReflowState(nsPresContext& aPresContext,
|
2002-02-19 15:48:28 +00:00
|
|
|
const nsSize& aAvailSize,
|
|
|
|
PRBool aBorderCollapse,
|
|
|
|
float aPixelsToTwips,
|
2002-09-09 18:46:06 +00:00
|
|
|
nsTableCellReflowState& aReflowState,
|
|
|
|
PRBool aResetComputedWidth = PR_FALSE);
|
2002-02-19 15:48:28 +00:00
|
|
|
|
1998-10-20 17:45:07 +00:00
|
|
|
/** implement abstract method on nsHTMLContainerFrame */
|
|
|
|
virtual PRIntn GetSkipSides() const;
|
|
|
|
|
1998-10-14 16:32:45 +00:00
|
|
|
/** Incremental Reflow attempts to do column balancing with the minimum number of reflow
|
|
|
|
* commands to child elements. This is done by processing the reflow command,
|
|
|
|
* rebalancing column widths (if necessary), then comparing the resulting column widths
|
|
|
|
* to the prior column widths and reflowing only those cells that require a reflow.
|
|
|
|
*
|
|
|
|
* @see Reflow
|
|
|
|
*/
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD IncrementalReflow(nsPresContext* aPresContext,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsTableFrame& aTableFrame,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD IR_TargetIsChild(nsPresContext* aPresContext,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsTableFrame& aTableFrame,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame* aNextFrame);
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD IR_TargetIsMe(nsPresContext* aPresContext,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsTableFrame& aTableFrame,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD IR_StyleChanged(nsPresContext* aPresContext,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsTableFrame& aTableFrame,
|
|
|
|
nsReflowStatus& aStatus);
|
1999-08-03 02:41:27 +00:00
|
|
|
|
1998-06-24 19:13:19 +00:00
|
|
|
// row-specific methods
|
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
nscoord ComputeCellXOffset(const nsHTMLReflowState& aState,
|
|
|
|
nsIFrame* aKidFrame,
|
|
|
|
const nsMargin& aKidMargin) const;
|
1998-04-23 17:29:07 +00:00
|
|
|
/**
|
2001-03-13 06:38:59 +00:00
|
|
|
* Called for incremental/dirty and resize reflows. If aDirtyOnly is true then
|
|
|
|
* only reflow dirty cells.
|
1998-04-23 17:29:07 +00:00
|
|
|
*/
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD ReflowChildren(nsPresContext* aPresContext,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsTableFrame& aTableFrame,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
PRBool aDirtyOnly = PR_FALSE);
|
1999-08-21 20:16:32 +00:00
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
private:
|
1999-10-23 23:08:30 +00:00
|
|
|
struct RowBits {
|
2001-11-05 00:15:51 +00:00
|
|
|
unsigned mRowIndex:29;
|
|
|
|
unsigned mHasFixedHeight:1; // set if the dominating style height on the row or any cell is pixel based
|
|
|
|
unsigned mHasPctHeight:1; // set if the dominating style height on the row or any cell is pct based
|
|
|
|
unsigned mFirstInserted:1; // if true, then it was the top most newly inserted row
|
|
|
|
} mBits;
|
1999-10-23 23:08:30 +00:00
|
|
|
|
2003-01-05 14:16:58 +00:00
|
|
|
// the desired height based on the content of the tallest cell in the row
|
|
|
|
nscoord mContentHeight;
|
|
|
|
// the height based on a style percentage height on either the row or any cell
|
|
|
|
// if mHasPctHeight is set
|
|
|
|
nscoord mStylePctHeight;
|
|
|
|
// the height based on a style pixel height on the row or any
|
|
|
|
// cell if mHasFixedHeight is set
|
|
|
|
nscoord mStyleFixedHeight;
|
2000-06-05 08:25:11 +00:00
|
|
|
|
|
|
|
// max-ascent and max-descent amongst all cells that have 'vertical-align: baseline'
|
|
|
|
nscoord mMaxCellAscent; // does include cells with rowspan > 1
|
|
|
|
nscoord mMaxCellDescent; // does *not* include cells with rowspan > 1
|
2001-01-25 15:55:51 +00:00
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
// border widths in pixels in the collapsing border model
|
2004-03-09 06:48:35 +00:00
|
|
|
BCPixelSize mTopBorderWidth;
|
|
|
|
BCPixelSize mBottomBorderWidth;
|
|
|
|
BCPixelSize mRightContBorderWidth;
|
|
|
|
BCPixelSize mTopContBorderWidth;
|
|
|
|
BCPixelSize mLeftContBorderWidth;
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2001-01-25 15:55:51 +00:00
|
|
|
#ifdef DEBUG_TABLE_REFLOW_TIMING
|
|
|
|
public:
|
|
|
|
nsReflowTimer* mTimer;
|
|
|
|
#endif
|
1998-04-13 20:24:54 +00:00
|
|
|
};
|
|
|
|
|
1998-06-17 16:38:24 +00:00
|
|
|
inline PRInt32 nsTableRowFrame::GetRowIndex() const
|
|
|
|
{
|
1999-10-23 23:08:30 +00:00
|
|
|
return PRInt32(mBits.mRowIndex);
|
1998-06-17 16:38:24 +00:00
|
|
|
}
|
|
|
|
|
1998-12-16 04:31:38 +00:00
|
|
|
inline void nsTableRowFrame::SetRowIndex (int aRowIndex)
|
|
|
|
{
|
1999-10-31 03:15:52 +00:00
|
|
|
mBits.mRowIndex = aRowIndex;
|
1998-12-16 04:31:38 +00:00
|
|
|
}
|
|
|
|
|
2001-08-06 14:48:09 +00:00
|
|
|
inline PRBool nsTableRowFrame::IsFirstInserted() const
|
|
|
|
{
|
|
|
|
return PRBool(mBits.mFirstInserted);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableRowFrame::SetFirstInserted(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mFirstInserted = aValue;
|
|
|
|
}
|
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
inline PRBool nsTableRowFrame::HasStyleHeight() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mHasFixedHeight || (PRBool)mBits.mHasPctHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableRowFrame::HasFixedHeight() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mHasFixedHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableRowFrame::SetHasFixedHeight(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mHasFixedHeight = aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableRowFrame::HasPctHeight() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mHasPctHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableRowFrame::SetHasPctHeight(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mHasPctHeight = aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nscoord nsTableRowFrame::GetContentHeight() const
|
|
|
|
{
|
|
|
|
return mContentHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableRowFrame::SetContentHeight(nscoord aValue)
|
|
|
|
{
|
|
|
|
mContentHeight = aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nscoord nsTableRowFrame::GetFixedHeight() const
|
|
|
|
{
|
2003-01-05 14:16:58 +00:00
|
|
|
if (mBits.mHasFixedHeight)
|
|
|
|
return mStyleFixedHeight;
|
2001-11-05 00:15:51 +00:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline float nsTableRowFrame::GetPctHeight() const
|
|
|
|
{
|
|
|
|
if (mBits.mHasPctHeight)
|
2003-01-05 14:16:58 +00:00
|
|
|
return (float)mStylePctHeight / 100.0f;
|
2001-11-05 00:15:51 +00:00
|
|
|
else
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableRowFrame::NeedSpecialReflow() const
|
|
|
|
{
|
|
|
|
return (mState & NS_ROW_NEED_SPECIAL_REFLOW) == NS_ROW_NEED_SPECIAL_REFLOW;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableRowFrame::SetNeedSpecialReflow(PRBool aValue)
|
|
|
|
{
|
|
|
|
if (aValue) {
|
|
|
|
mState |= NS_ROW_NEED_SPECIAL_REFLOW;
|
|
|
|
} else {
|
|
|
|
mState &= ~NS_ROW_NEED_SPECIAL_REFLOW;
|
|
|
|
}
|
|
|
|
}
|
2001-11-29 15:41:07 +00:00
|
|
|
|
|
|
|
inline PRBool nsTableRowFrame::HasUnpaginatedHeight()
|
|
|
|
{
|
|
|
|
return (mState & NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT) ==
|
|
|
|
NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableRowFrame::SetHasUnpaginatedHeight(PRBool aValue)
|
|
|
|
{
|
|
|
|
if (aValue) {
|
|
|
|
mState |= NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT;
|
|
|
|
} else {
|
|
|
|
mState &= ~NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
inline nscoord nsTableRowFrame::GetTopBCBorderWidth(float* aPixelsToTwips)
|
|
|
|
{
|
|
|
|
nscoord width = (aPixelsToTwips) ? NSToCoordRound(*aPixelsToTwips * mTopBorderWidth) : mTopBorderWidth;
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
|
2004-03-09 06:48:35 +00:00
|
|
|
inline void nsTableRowFrame::SetTopBCBorderWidth(BCPixelSize aWidth)
|
2002-02-19 15:48:28 +00:00
|
|
|
{
|
|
|
|
mTopBorderWidth = aWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nscoord nsTableRowFrame::GetBottomBCBorderWidth(float* aPixelsToTwips)
|
|
|
|
{
|
|
|
|
nscoord width = (aPixelsToTwips) ? NSToCoordRound(*aPixelsToTwips * mBottomBorderWidth) : mBottomBorderWidth;
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
|
2004-03-09 06:48:35 +00:00
|
|
|
inline void nsTableRowFrame::SetBottomBCBorderWidth(BCPixelSize aWidth)
|
2002-02-19 15:48:28 +00:00
|
|
|
{
|
|
|
|
mBottomBorderWidth = aWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nsMargin* nsTableRowFrame::GetBCBorderWidth(float aPixelsToTwips,
|
|
|
|
nsMargin& aBorder)
|
|
|
|
{
|
|
|
|
aBorder.left = aBorder.right = 0;
|
|
|
|
|
|
|
|
aBorder.top = NSToCoordRound(aPixelsToTwips * mTopBorderWidth);
|
|
|
|
aBorder.bottom = NSToCoordRound(aPixelsToTwips * mBottomBorderWidth);
|
|
|
|
|
|
|
|
return &aBorder;
|
|
|
|
}
|
|
|
|
|
2004-03-09 06:48:35 +00:00
|
|
|
inline void
|
|
|
|
nsTableRowFrame::GetContinuousBCBorderWidth(float aPixelsToTwips,
|
|
|
|
nsMargin& aBorder)
|
|
|
|
{
|
|
|
|
aBorder.right = BC_BORDER_LEFT_HALF_COORD(aPixelsToTwips,
|
|
|
|
mLeftContBorderWidth);
|
|
|
|
aBorder.top = BC_BORDER_BOTTOM_HALF_COORD(aPixelsToTwips,
|
|
|
|
mTopContBorderWidth);
|
|
|
|
aBorder.left = BC_BORDER_RIGHT_HALF_COORD(aPixelsToTwips,
|
|
|
|
mRightContBorderWidth);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nscoord nsTableRowFrame::GetOuterTopContBCBorderWidth(float aPixelsToTwips)
|
|
|
|
{
|
|
|
|
return BC_BORDER_TOP_HALF_COORD(aPixelsToTwips, mTopContBorderWidth);
|
|
|
|
}
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#endif
|