2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:30:37 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2004-04-18 18:30:37 +04: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-14 00:24:54 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04: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-14 00:24:54 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:30:37 +04: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-29 00:14:13 +04: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 18:30:37 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04: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 18:30:37 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsTableRowFrame_h__
|
|
|
|
#define nsTableRowFrame_h__
|
|
|
|
|
|
|
|
#include "nscore.h"
|
1998-10-20 21:45:07 +04:00
|
|
|
#include "nsHTMLContainerFrame.h"
|
2004-03-09 09:48:35 +03:00
|
|
|
#include "nsTablePainter.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-05-22 03:43:18 +04:00
|
|
|
class nsTableFrame;
|
1998-06-05 06:36:25 +04:00
|
|
|
class nsTableCellFrame;
|
2002-02-19 18:48:28 +03:00
|
|
|
struct nsTableCellReflowState;
|
1999-08-28 04:43:53 +04:00
|
|
|
|
2005-02-05 07:23:52 +03:00
|
|
|
// This is also used on rows, from nsTableRowGroupFrame.h
|
|
|
|
// #define NS_REPEATED_ROW_OR_ROWGROUP 0x10000000
|
2001-11-29 18:41:07 +03:00
|
|
|
|
2007-06-26 00:34:35 +04:00
|
|
|
// Indicates whether this row has any cells that have
|
|
|
|
// non-auto-height and rowspan=1
|
|
|
|
#define NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT 0x20000000
|
|
|
|
|
|
|
|
#define NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT 0x40000000
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
1998-04-15 01:45:28 +04: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-14 00:24:54 +04:00
|
|
|
*/
|
1998-10-20 21:45:07 +04:00
|
|
|
class nsTableRowFrame : public nsHTMLContainerFrame
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
public:
|
2001-01-25 18:55:51 +03:00
|
|
|
virtual ~nsTableRowFrame();
|
|
|
|
|
2006-03-09 21:55:21 +03:00
|
|
|
NS_IMETHOD Init(nsIContent* aContent,
|
1999-02-25 08:31:15 +03:00
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow);
|
|
|
|
|
2005-02-07 04:58:25 +03:00
|
|
|
NS_IMETHOD AppendFrames(nsIAtom* aListName,
|
1999-08-03 06:41:27 +04:00
|
|
|
nsIFrame* aFrameList);
|
2005-02-07 04:58:25 +03:00
|
|
|
NS_IMETHOD InsertFrames(nsIAtom* aListName,
|
1999-08-03 06:41:27 +04:00
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList);
|
2005-02-07 04:58:25 +03:00
|
|
|
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
|
1999-08-03 06:41:27 +04:00
|
|
|
nsIFrame* aOldFrame);
|
|
|
|
|
1998-04-15 01:45:28 +04:00
|
|
|
/** instantiate a new instance of nsTableRowFrame.
|
2005-11-04 05:38:33 +03:00
|
|
|
* @param aPresShell the pres shell for this frame
|
1998-04-15 01:45:28 +04:00
|
|
|
*
|
2005-11-04 05:38:33 +03:00
|
|
|
* @return the frame that was created
|
1998-04-15 01:45:28 +04:00
|
|
|
*/
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-09-16 21:19:20 +04:00
|
|
|
|
2006-12-14 02:04:57 +03:00
|
|
|
virtual nsMargin GetUsedMargin() const;
|
|
|
|
virtual nsMargin GetUsedBorder() const;
|
|
|
|
virtual nsMargin GetUsedPadding() const;
|
|
|
|
|
2006-01-26 05:29:17 +03:00
|
|
|
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists);
|
2000-03-22 05:43:08 +03:00
|
|
|
|
2001-11-05 03:15:51 +03:00
|
|
|
nsTableCellFrame* GetFirstCell() ;
|
|
|
|
|
1998-05-25 21:31:49 +04:00
|
|
|
/** calls Reflow for all of its child cells.
|
1998-04-15 01:45:28 +04: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 21:31:49 +04:00
|
|
|
* @see nsIFrame::Reflow
|
1998-04-15 01:45:28 +04:00
|
|
|
* @see nsTableFrame::BalanceColumnWidths
|
|
|
|
* @see nsTableFrame::ShrinkWrapChildren
|
|
|
|
*/
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
2001-03-13 09:38:59 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
1998-10-02 08:10:00 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
2001-03-13 09:38:59 +03:00
|
|
|
nsReflowStatus& aStatus);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2007-01-28 01:22:24 +03:00
|
|
|
void DidResize();
|
1998-07-03 00:35:23 +04:00
|
|
|
|
2008-07-14 02:41:18 +04:00
|
|
|
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
|
|
|
|
{
|
|
|
|
return nsHTMLContainerFrame::IsFrameOfType(aFlags &
|
|
|
|
~nsIFrame::eExcludesIgnorableWhitespace);
|
|
|
|
}
|
|
|
|
|
1999-02-24 08:54:31 +03:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
2007-01-30 03:06:41 +03:00
|
|
|
* @see nsGkAtoms::tableRowFrame
|
1999-02-24 08:54:31 +03:00
|
|
|
*/
|
2003-10-31 23:19:18 +03:00
|
|
|
virtual nsIAtom* GetType() const;
|
1999-02-24 08:54:31 +03:00
|
|
|
|
1999-09-01 05:02:16 +04:00
|
|
|
#ifdef DEBUG
|
2001-11-14 04:33:42 +03:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
1999-09-01 05:02:16 +04:00
|
|
|
#endif
|
2000-05-26 02:40:21 +04:00
|
|
|
|
2001-11-05 03:15:51 +03:00
|
|
|
void UpdateHeight(nscoord aHeight,
|
|
|
|
nscoord aAscent,
|
|
|
|
nscoord aDescent,
|
|
|
|
nsTableFrame* aTableFrame = nsnull,
|
|
|
|
nsTableCellFrame* aCellFrame = nsnull);
|
2000-05-26 02:40:21 +04:00
|
|
|
|
2001-11-05 03:15:51 +03:00
|
|
|
void ResetHeight(nscoord aRowStyleHeight);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2001-11-05 03:15:51 +03: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-14 00:24:54 +04:00
|
|
|
|
2000-06-05 12:25:11 +04:00
|
|
|
// Support for cells with 'vertical-align: baseline'.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* returns the max-ascent amongst all the cells that have
|
2000-07-28 13:19:26 +04:00
|
|
|
* 'vertical-align: baseline', *including* cells with rowspans.
|
2000-06-05 12:25:11 +04:00
|
|
|
* returns 0 if we don't have any cell with 'vertical-align: baseline'
|
|
|
|
*/
|
|
|
|
nscoord GetMaxCellAscent() const;
|
2005-10-04 19:47:21 +04:00
|
|
|
|
|
|
|
/* return the row ascent
|
|
|
|
*/
|
2007-01-23 07:06:56 +03:00
|
|
|
nscoord GetRowBaseline();
|
2000-06-05 12:25:11 +04:00
|
|
|
|
1998-06-17 20:38:24 +04: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 07:31:38 +03:00
|
|
|
void SetRowIndex (int aRowIndex);
|
1998-06-17 20:38:24 +04:00
|
|
|
|
2001-04-16 18:51:52 +04:00
|
|
|
/** used by row group frame code */
|
2004-08-01 03:15:21 +04:00
|
|
|
nscoord ReflowCellFrame(nsPresContext* aPresContext,
|
2001-04-16 18:51:52 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
2007-02-21 22:42:21 +03:00
|
|
|
PRBool aIsTopOfPage,
|
2001-04-16 18:51:52 +04:00
|
|
|
nsTableCellFrame* aCellFrame,
|
|
|
|
nscoord aAvailableHeight,
|
|
|
|
nsReflowStatus& aStatus);
|
2006-03-04 08:26:57 +03:00
|
|
|
/**
|
|
|
|
* Collapse the row if required, apply col and colgroup visibility: collapse
|
|
|
|
* info to the cells in the row.
|
|
|
|
* @return he amount to shift up all following rows
|
|
|
|
* @param aRowOffset - shift the row up by this amount
|
|
|
|
* @param aWidth - new width of the row
|
|
|
|
* @param aCollapseGroup - parent rowgroup is collapsed so this row needs
|
|
|
|
* to be collapsed
|
|
|
|
* @param aDidCollapse - the row has been collapsed
|
|
|
|
*/
|
|
|
|
nscoord CollapseRowIfNecessary(nscoord aRowOffset,
|
|
|
|
nscoord aWidth,
|
|
|
|
PRBool aCollapseGroup,
|
|
|
|
PRBool& aDidCollapse);
|
2001-04-16 18:51:52 +04:00
|
|
|
|
2001-03-13 09:38:59 +03:00
|
|
|
void InsertCellFrame(nsTableCellFrame* aFrame,
|
|
|
|
nsTableCellFrame* aPrevSibling);
|
1999-02-22 06:28:00 +03:00
|
|
|
|
2001-04-16 18:51:52 +04:00
|
|
|
void InsertCellFrame(nsTableCellFrame* aFrame,
|
|
|
|
PRInt32 aColIndex);
|
|
|
|
|
|
|
|
void RemoveCellFrame(nsTableCellFrame* aFrame);
|
|
|
|
|
2001-11-05 03:15:51 +03:00
|
|
|
nsresult CalculateCellActualSize(nsIFrame* aRowFrame,
|
|
|
|
nscoord& aDesiredWidth,
|
|
|
|
nscoord& aDesiredHeight,
|
|
|
|
nscoord aAvailWidth);
|
2000-02-03 17:04:49 +03:00
|
|
|
|
2001-08-06 18:48:09 +04:00
|
|
|
PRBool IsFirstInserted() const;
|
|
|
|
void SetFirstInserted(PRBool aValue);
|
|
|
|
|
2001-11-05 03:15:51 +03:00
|
|
|
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 18:15:24 +03:00
|
|
|
void SetPctHeight(float aPctValue,
|
|
|
|
PRBool aForce = PR_FALSE);
|
2001-11-05 03:15:51 +03:00
|
|
|
|
|
|
|
nscoord GetHeight(nscoord aBasis = 0) const;
|
|
|
|
|
|
|
|
nsTableRowFrame* GetNextRow() const;
|
|
|
|
|
2001-11-29 18:41:07 +03:00
|
|
|
PRBool HasUnpaginatedHeight();
|
|
|
|
void SetHasUnpaginatedHeight(PRBool aValue);
|
2004-08-01 03:15:21 +04:00
|
|
|
nscoord GetUnpaginatedHeight(nsPresContext* aPresContext);
|
|
|
|
void SetUnpaginatedHeight(nsPresContext* aPresContext, nscoord aValue);
|
2001-11-29 18:41:07 +03:00
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
nscoord GetTopBCBorderWidth();
|
2004-03-09 09:48:35 +03:00
|
|
|
void SetTopBCBorderWidth(BCPixelSize aWidth);
|
2007-02-07 10:46:44 +03:00
|
|
|
nscoord GetBottomBCBorderWidth();
|
2004-03-09 09:48:35 +03:00
|
|
|
void SetBottomBCBorderWidth(BCPixelSize aWidth);
|
2007-02-07 10:46:44 +03:00
|
|
|
nsMargin* GetBCBorderWidth(nsMargin& aBorder);
|
2004-03-09 09:48:35 +03: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
|
|
|
|
*/
|
2007-02-07 10:46:44 +03:00
|
|
|
void GetContinuousBCBorderWidth(nsMargin& aBorder);
|
2004-03-09 09:48:35 +03:00
|
|
|
/**
|
|
|
|
* @returns outer top bc border == prev row's bottom inner
|
|
|
|
*/
|
2007-02-07 10:46:44 +03:00
|
|
|
nscoord GetOuterTopContBCBorderWidth();
|
2004-03-09 09:48:35 +03:00
|
|
|
/**
|
|
|
|
* 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-14 00:24:54 +04:00
|
|
|
protected:
|
|
|
|
|
1998-04-15 01:45:28 +04:00
|
|
|
/** protected constructor.
|
|
|
|
* @see NewFrame
|
|
|
|
*/
|
2006-03-27 01:30:36 +04:00
|
|
|
nsTableRowFrame(nsStyleContext *aContext);
|
1998-04-23 21:29:07 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
void InitChildReflowState(nsPresContext& aPresContext,
|
2002-02-19 18:48:28 +03:00
|
|
|
const nsSize& aAvailSize,
|
|
|
|
PRBool aBorderCollapse,
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nsTableCellReflowState& aReflowState);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
1998-10-20 21:45:07 +04:00
|
|
|
/** implement abstract method on nsHTMLContainerFrame */
|
|
|
|
virtual PRIntn GetSkipSides() const;
|
|
|
|
|
1998-06-24 23:13:19 +04:00
|
|
|
// row-specific methods
|
|
|
|
|
2001-03-13 09:38:59 +03:00
|
|
|
nscoord ComputeCellXOffset(const nsHTMLReflowState& aState,
|
|
|
|
nsIFrame* aKidFrame,
|
|
|
|
const nsMargin& aKidMargin) const;
|
1998-04-23 21:29:07 +04:00
|
|
|
/**
|
2001-03-13 09:38:59 +03:00
|
|
|
* Called for incremental/dirty and resize reflows. If aDirtyOnly is true then
|
|
|
|
* only reflow dirty cells.
|
1998-04-23 21:29:07 +04:00
|
|
|
*/
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD ReflowChildren(nsPresContext* aPresContext,
|
2001-03-13 09:38:59 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsTableFrame& aTableFrame,
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nsReflowStatus& aStatus);
|
1999-08-22 00:16:32 +04:00
|
|
|
|
2001-11-05 03:15:51 +03:00
|
|
|
private:
|
1999-10-24 03:08:30 +04:00
|
|
|
struct RowBits {
|
2001-11-05 03:15:51 +03: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-24 03:08:30 +04:00
|
|
|
|
2003-01-05 17:16:58 +03: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 12:25:11 +04: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 18:55:51 +03:00
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
// border widths in pixels in the collapsing border model of the *inner*
|
|
|
|
// half of the border only
|
2004-03-09 09:48:35 +03:00
|
|
|
BCPixelSize mTopBorderWidth;
|
|
|
|
BCPixelSize mBottomBorderWidth;
|
|
|
|
BCPixelSize mRightContBorderWidth;
|
|
|
|
BCPixelSize mTopContBorderWidth;
|
|
|
|
BCPixelSize mLeftContBorderWidth;
|
2007-06-26 00:34:35 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT bit to indicate whether
|
|
|
|
* this row has any cells that have non-auto-height. (Row-spanning
|
|
|
|
* cells are ignored.)
|
|
|
|
*/
|
|
|
|
void InitHasCellWithStyleHeight(nsTableFrame* aTableFrame);
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
1998-06-17 20:38:24 +04:00
|
|
|
inline PRInt32 nsTableRowFrame::GetRowIndex() const
|
|
|
|
{
|
1999-10-24 03:08:30 +04:00
|
|
|
return PRInt32(mBits.mRowIndex);
|
1998-06-17 20:38:24 +04:00
|
|
|
}
|
|
|
|
|
1998-12-16 07:31:38 +03:00
|
|
|
inline void nsTableRowFrame::SetRowIndex (int aRowIndex)
|
|
|
|
{
|
1999-10-31 06:15:52 +03:00
|
|
|
mBits.mRowIndex = aRowIndex;
|
1998-12-16 07:31:38 +03:00
|
|
|
}
|
|
|
|
|
2001-08-06 18:48:09 +04:00
|
|
|
inline PRBool nsTableRowFrame::IsFirstInserted() const
|
|
|
|
{
|
|
|
|
return PRBool(mBits.mFirstInserted);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableRowFrame::SetFirstInserted(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mFirstInserted = aValue;
|
|
|
|
}
|
|
|
|
|
2001-11-05 03:15:51 +03: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 17:16:58 +03:00
|
|
|
if (mBits.mHasFixedHeight)
|
|
|
|
return mStyleFixedHeight;
|
2001-11-05 03:15:51 +03:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline float nsTableRowFrame::GetPctHeight() const
|
|
|
|
{
|
|
|
|
if (mBits.mHasPctHeight)
|
2003-01-05 17:16:58 +03:00
|
|
|
return (float)mStylePctHeight / 100.0f;
|
2001-11-05 03:15:51 +03:00
|
|
|
else
|
|
|
|
return 0.0f;
|
|
|
|
}
|
2001-11-29 18:41:07 +03: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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
inline nscoord nsTableRowFrame::GetTopBCBorderWidth()
|
2002-02-19 18:48:28 +03:00
|
|
|
{
|
2007-02-07 10:46:44 +03:00
|
|
|
return mTopBorderWidth;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2004-03-09 09:48:35 +03:00
|
|
|
inline void nsTableRowFrame::SetTopBCBorderWidth(BCPixelSize aWidth)
|
2002-02-19 18:48:28 +03:00
|
|
|
{
|
|
|
|
mTopBorderWidth = aWidth;
|
|
|
|
}
|
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
inline nscoord nsTableRowFrame::GetBottomBCBorderWidth()
|
2002-02-19 18:48:28 +03:00
|
|
|
{
|
2007-02-07 10:46:44 +03:00
|
|
|
return mBottomBorderWidth;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2004-03-09 09:48:35 +03:00
|
|
|
inline void nsTableRowFrame::SetBottomBCBorderWidth(BCPixelSize aWidth)
|
2002-02-19 18:48:28 +03:00
|
|
|
{
|
|
|
|
mBottomBorderWidth = aWidth;
|
|
|
|
}
|
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
inline nsMargin* nsTableRowFrame::GetBCBorderWidth(nsMargin& aBorder)
|
2002-02-19 18:48:28 +03:00
|
|
|
{
|
|
|
|
aBorder.left = aBorder.right = 0;
|
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
aBorder.top = nsPresContext::CSSPixelsToAppUnits(mTopBorderWidth);
|
|
|
|
aBorder.bottom = nsPresContext::CSSPixelsToAppUnits(mBottomBorderWidth);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
|
|
|
return &aBorder;
|
|
|
|
}
|
|
|
|
|
2004-03-09 09:48:35 +03:00
|
|
|
inline void
|
2007-02-07 10:46:44 +03:00
|
|
|
nsTableRowFrame::GetContinuousBCBorderWidth(nsMargin& aBorder)
|
2004-03-09 09:48:35 +03:00
|
|
|
{
|
2007-02-07 10:46:44 +03:00
|
|
|
PRInt32 aPixelsToTwips = nsPresContext::AppUnitsPerCSSPixel();
|
2004-03-09 09:48:35 +03:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
inline nscoord nsTableRowFrame::GetOuterTopContBCBorderWidth()
|
2004-03-09 09:48:35 +03:00
|
|
|
{
|
2007-02-07 10:46:44 +03:00
|
|
|
PRInt32 aPixelsToTwips = nsPresContext::AppUnitsPerCSSPixel();
|
2004-03-09 09:48:35 +03:00
|
|
|
return BC_BORDER_TOP_HALF_COORD(aPixelsToTwips, mTopContBorderWidth);
|
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif
|