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 nsTableFrame_h__
|
|
|
|
#define nsTableFrame_h__
|
|
|
|
|
|
|
|
#include "nscore.h"
|
2009-02-05 09:09:50 +00:00
|
|
|
#include "nsTPtrArray.h"
|
1998-10-20 17:45:07 +00:00
|
|
|
#include "nsHTMLContainerFrame.h"
|
1998-06-05 06:09:09 +00:00
|
|
|
#include "nsStyleCoord.h"
|
1998-10-11 09:18:27 +00:00
|
|
|
#include "nsStyleConsts.h"
|
1999-07-31 22:11:50 +00:00
|
|
|
#include "nsITableLayout.h"
|
1999-12-14 00:24:33 +00:00
|
|
|
#include "nsTableColFrame.h"
|
|
|
|
#include "nsTableColGroupFrame.h"
|
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 05:38:33 +00:00
|
|
|
#include "nsCellMap.h"
|
2007-01-30 00:06:41 +00:00
|
|
|
#include "nsGkAtoms.h"
|
2008-04-06 11:34:14 +00:00
|
|
|
#include "nsDisplayList.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
class nsTableCellFrame;
|
1998-06-05 02:36:25 +00:00
|
|
|
class nsTableColFrame;
|
1998-07-01 22:22:28 +00:00
|
|
|
class nsTableRowGroupFrame;
|
1998-06-17 16:38:24 +00:00
|
|
|
class nsTableRowFrame;
|
1998-10-14 22:51:50 +00:00
|
|
|
class nsTableColGroupFrame;
|
1998-04-30 17:57:09 +00:00
|
|
|
class nsITableLayoutStrategy;
|
2003-02-22 00:32:13 +00:00
|
|
|
class nsStyleContext;
|
1999-10-28 04:09:39 +00:00
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
struct nsTableReflowState;
|
1998-04-25 18:48:48 +00:00
|
|
|
struct nsStylePosition;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-12-03 18:01:35 +00:00
|
|
|
/**
|
|
|
|
* Child list name indices
|
|
|
|
* @see #GetAdditionalChildListName()
|
|
|
|
*/
|
|
|
|
#define NS_TABLE_FRAME_COLGROUP_LIST_INDEX 0
|
2006-12-10 06:46:17 +00:00
|
|
|
#define NS_TABLE_FRAME_OVERFLOW_LIST_INDEX 1
|
|
|
|
#define NS_TABLE_FRAME_LAST_LIST_INDEX NS_TABLE_FRAME_OVERFLOW_LIST_INDEX
|
1998-12-03 18:01:35 +00:00
|
|
|
|
2007-01-30 00:06:41 +00:00
|
|
|
static inline PRBool IS_TABLE_CELL(nsIAtom* frameType) {
|
|
|
|
return nsGkAtoms::tableCellFrame == frameType ||
|
|
|
|
nsGkAtoms::bcTableCellFrame == frameType;
|
|
|
|
}
|
|
|
|
|
2008-04-06 11:34:14 +00:00
|
|
|
class nsDisplayTableItem : public nsDisplayItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDisplayTableItem(nsIFrame* aFrame) : nsDisplayItem(aFrame),
|
|
|
|
mPartHasFixedBackground(PR_FALSE) {}
|
|
|
|
|
2008-04-21 22:00:48 +00:00
|
|
|
virtual PRBool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder);
|
2008-04-06 11:34:14 +00:00
|
|
|
// With collapsed borders, parts of the collapsed border can extend outside
|
|
|
|
// the table part frames, so allow this display element to blow out to our
|
|
|
|
// overflow rect. This is also useful for row frames that have spanning
|
|
|
|
// cells extending outside them.
|
|
|
|
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
|
|
|
|
|
|
|
|
void UpdateForFrameBackground(nsIFrame* aFrame);
|
|
|
|
|
|
|
|
private:
|
|
|
|
PRPackedBool mPartHasFixedBackground;
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsAutoPushCurrentTableItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsAutoPushCurrentTableItem() : mBuilder(nsnull) {}
|
|
|
|
|
|
|
|
void Push(nsDisplayListBuilder* aBuilder, nsDisplayTableItem* aPushItem)
|
|
|
|
{
|
|
|
|
mBuilder = aBuilder;
|
|
|
|
mOldCurrentItem = aBuilder->GetCurrentTableItem();
|
|
|
|
aBuilder->SetCurrentTableItem(aPushItem);
|
|
|
|
#ifdef DEBUG
|
|
|
|
mPushedItem = aPushItem;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
~nsAutoPushCurrentTableItem() {
|
|
|
|
if (!mBuilder)
|
|
|
|
return;
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_ASSERTION(mBuilder->GetCurrentTableItem() == mPushedItem,
|
|
|
|
"Someone messed with the current table item behind our back!");
|
|
|
|
#endif
|
|
|
|
mBuilder->SetCurrentTableItem(mOldCurrentItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsDisplayListBuilder* mBuilder;
|
|
|
|
nsDisplayTableItem* mOldCurrentItem;
|
|
|
|
#ifdef DEBUG
|
|
|
|
nsDisplayTableItem* mPushedItem;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
1998-07-06 21:00:11 +00:00
|
|
|
/* ============================================================================ */
|
|
|
|
|
1998-04-14 21:45:28 +00:00
|
|
|
/** nsTableFrame maps the inner portion of a table (everything except captions.)
|
1998-12-04 03:14:28 +00:00
|
|
|
* Used as a pseudo-frame within nsTableOuterFrame, it may also be used
|
|
|
|
* stand-alone as the top-level frame.
|
|
|
|
*
|
1999-01-27 19:29:24 +00:00
|
|
|
* The flowed child list contains row group frames. There is also an additional
|
1998-12-04 03:14:28 +00:00
|
|
|
* named child list:
|
|
|
|
* - "ColGroup-list" which contains the col group frames
|
1998-04-14 21:45:28 +00:00
|
|
|
*
|
2007-01-30 00:06:41 +00:00
|
|
|
* @see nsGkAtoms::colGroupList
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
1999-07-31 22:11:50 +00:00
|
|
|
class nsTableFrame : public nsHTMLContainerFrame, public nsITableLayout
|
1998-04-13 20:24:54 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_DECL_QUERYFRAME
|
1999-07-31 22:11:50 +00:00
|
|
|
|
1998-04-14 21:45:28 +00:00
|
|
|
/** nsTableOuterFrame has intimate knowledge of the inner table frame */
|
1998-04-13 20:24:54 +00:00
|
|
|
friend class nsTableOuterFrame;
|
|
|
|
|
2005-11-04 02:38:33 +00:00
|
|
|
/** instantiate a new instance of nsTableRowFrame.
|
|
|
|
* @param aPresShell the pres shell for this frame
|
1998-04-14 21:45:28 +00:00
|
|
|
*
|
2005-11-04 02:38:33 +00:00
|
|
|
* @return the frame that was created
|
1998-04-14 21:45:28 +00:00
|
|
|
*/
|
2006-03-26 21:30:36 +00:00
|
|
|
friend nsIFrame* NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1999-01-27 19:29:24 +00:00
|
|
|
/** sets defaults for table-specific style.
|
|
|
|
* @see nsIFrame::Init
|
|
|
|
*/
|
2006-03-09 18:55:21 +00:00
|
|
|
NS_IMETHOD Init(nsIContent* aContent,
|
1999-01-14 05:16:23 +00:00
|
|
|
nsIFrame* aParent,
|
1999-02-25 03:27:57 +00:00
|
|
|
nsIFrame* aPrevInFlow);
|
1998-12-05 05:27:21 +00:00
|
|
|
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
static void* GetProperty(nsIFrame* aFrame,
|
2001-11-29 15:41:07 +00:00
|
|
|
nsIAtom* aPropertyName,
|
|
|
|
PRBool aCreateIfNecessary = PR_FALSE);
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
static float GetTwipsToPixels(nsPresContext* aPresContext);
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2007-06-25 20:34:35 +00:00
|
|
|
// Return true if aParentReflowState.frame or any of its ancestors within
|
|
|
|
// the containing table have non-auto height. (e.g. pct or fixed height)
|
|
|
|
static PRBool AncestorsHaveStyleHeight(const nsHTMLReflowState& aParentReflowState);
|
|
|
|
|
2002-04-01 06:46:17 +00:00
|
|
|
// See if a special height reflow will occur due to having a pct height when
|
|
|
|
// the pct height basis may not yet be valid.
|
|
|
|
static void CheckRequestSpecialHeightReflow(const nsHTMLReflowState& aReflowState);
|
|
|
|
|
|
|
|
// Notify the frame and its ancestors (up to the containing table) that a special
|
|
|
|
// height reflow will occur.
|
|
|
|
static void RequestSpecialHeightReflow(const nsHTMLReflowState& aReflowState);
|
|
|
|
|
2004-03-12 04:40:17 +00:00
|
|
|
virtual PRBool IsContainingBlock() const;
|
2000-02-12 01:55:40 +00:00
|
|
|
|
2004-12-27 15:05:18 +00:00
|
|
|
static void RePositionViews(nsIFrame* aFrame);
|
2001-03-13 06:38:59 +00:00
|
|
|
|
2002-03-17 21:35:08 +00:00
|
|
|
static PRBool PageBreakAfter(nsIFrame& aSourceFrame,
|
|
|
|
nsIFrame* aNextFrame);
|
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
nsPoint GetFirstSectionOrigin(const nsHTMLReflowState& aReflowState) const;
|
2000-01-04 05:31:56 +00:00
|
|
|
/*
|
|
|
|
* Notification that aAttribute has changed for content inside a table (cell, row, etc)
|
|
|
|
*/
|
2005-02-07 01:58:25 +00:00
|
|
|
void AttributeChangedFor(nsIFrame* aFrame,
|
2000-01-04 05:31:56 +00:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIAtom* aAttribute);
|
|
|
|
|
1999-07-22 02:24:52 +00:00
|
|
|
/** @see nsIFrame::Destroy */
|
2006-04-10 00:16:29 +00:00
|
|
|
virtual void Destroy();
|
2008-10-18 17:25:26 +00:00
|
|
|
|
|
|
|
/** @see nsIFrame::DidSetStyleContext */
|
2008-10-26 10:11:34 +00:00
|
|
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
|
1998-12-04 03:14:28 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD AppendFrames(nsIAtom* aListName,
|
1999-08-19 03:51:25 +00:00
|
|
|
nsIFrame* aFrameList);
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD InsertFrames(nsIAtom* aListName,
|
1999-08-19 03:51:25 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList);
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
|
1999-08-19 03:51:25 +00:00
|
|
|
nsIFrame* aOldFrame);
|
|
|
|
|
2006-12-13 23:04:57 +00:00
|
|
|
virtual nsMargin GetUsedBorder() const;
|
|
|
|
virtual nsMargin GetUsedPadding() const;
|
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
// Get the offset from the border box to the area where the row groups fit
|
2003-12-28 17:02:40 +00:00
|
|
|
nsMargin GetChildAreaOffset(const nsHTMLReflowState* aReflowState) const;
|
2002-02-19 15:48:28 +00:00
|
|
|
|
1998-09-24 16:37:22 +00:00
|
|
|
/** helper method to find the table parent of any table frame object */
|
2006-03-04 05:26:57 +00:00
|
|
|
static nsTableFrame* GetTableFrame(nsIFrame* aSourceFrame);
|
2006-01-26 02:29:17 +00:00
|
|
|
|
2006-09-22 01:56:04 +00:00
|
|
|
typedef nsresult (* DisplayGenericTablePartTraversal)
|
|
|
|
(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
|
|
|
|
const nsRect& aDirtyRect, const nsDisplayListSet& aLists);
|
|
|
|
static nsresult GenericTraversal(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
|
|
|
|
const nsRect& aDirtyRect, const nsDisplayListSet& aLists);
|
|
|
|
|
2006-01-26 02:29:17 +00:00
|
|
|
/**
|
|
|
|
* Helper method to handle display common to table frames, rowgroup frames
|
|
|
|
* and row frames. It creates a background display item for handling events
|
|
|
|
* if necessary, an outline display item if necessary, and displays
|
|
|
|
* all the the frame's children.
|
2008-04-06 11:34:14 +00:00
|
|
|
* @param aDisplayItem the display item created for this part, or null
|
|
|
|
* if this part's border/background painting is delegated to an ancestor
|
2006-09-22 01:56:04 +00:00
|
|
|
* @param aTraversal a function that gets called to traverse the table
|
|
|
|
* part's child frames and add their display list items to a
|
|
|
|
* display list set.
|
2006-01-26 02:29:17 +00:00
|
|
|
*/
|
|
|
|
static nsresult DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
|
2006-04-17 22:16:24 +00:00
|
|
|
nsFrame* aFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists,
|
2008-04-06 11:34:14 +00:00
|
|
|
nsDisplayTableItem* aDisplayItem,
|
2006-09-19 21:39:33 +00:00
|
|
|
DisplayGenericTablePartTraversal aTraversal = GenericTraversal);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
|
|
|
// Return the closest sibling of aPriorChildFrame (including aPriroChildFrame)
|
|
|
|
// of type aChildType.
|
2004-01-18 10:28:40 +00:00
|
|
|
static nsIFrame* GetFrameAtOrBefore(nsIFrame* aParentFrame,
|
2000-01-22 01:16:50 +00:00
|
|
|
nsIFrame* aPriorChildFrame,
|
|
|
|
nsIAtom* aChildType);
|
2001-03-13 06:38:59 +00:00
|
|
|
PRBool IsAutoWidth(PRBool* aIsPctWidth = nsnull);
|
2001-05-14 14:28:00 +00:00
|
|
|
PRBool IsAutoHeight();
|
2003-02-22 00:32:13 +00:00
|
|
|
static PRBool IsPctHeight(nsStyleContext* aStyleContext);
|
1998-10-11 09:18:27 +00:00
|
|
|
|
1999-01-27 19:29:24 +00:00
|
|
|
/** @return PR_TRUE if aDisplayType represents a rowgroup of any sort
|
1998-10-11 09:18:27 +00:00
|
|
|
* (header, footer, or body)
|
|
|
|
*/
|
1998-11-20 01:01:25 +00:00
|
|
|
PRBool IsRowGroup(PRInt32 aDisplayType) const;
|
1998-06-05 02:36:25 +00:00
|
|
|
|
1999-01-27 19:29:24 +00:00
|
|
|
/** Initialize the table frame with a set of children.
|
|
|
|
* @see nsIFrame::SetInitialChildList
|
|
|
|
*/
|
2006-04-10 00:16:29 +00:00
|
|
|
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
|
1998-11-10 06:05:32 +00:00
|
|
|
nsIFrame* aChildList);
|
1998-09-16 17:19:20 +00:00
|
|
|
|
1999-01-27 19:29:24 +00:00
|
|
|
/** return the first child belonging to the list aListName.
|
2004-01-09 14:20:53 +00:00
|
|
|
* @see nsIFrame::GetFirstChild
|
1999-01-27 19:29:24 +00:00
|
|
|
*/
|
2004-01-09 14:20:53 +00:00
|
|
|
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;
|
1998-12-03 18:01:35 +00:00
|
|
|
|
1999-01-27 19:29:24 +00:00
|
|
|
/** @see nsIFrame::GetAdditionalChildListName */
|
2004-01-09 14:20:53 +00:00
|
|
|
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
|
1998-12-03 18:01:35 +00:00
|
|
|
|
2006-01-26 02:29:17 +00:00
|
|
|
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2006-01-26 02:29:17 +00:00
|
|
|
/**
|
|
|
|
* Paint the background of the table and its parts (column groups,
|
|
|
|
* columns, row groups, rows, and cells), and the table border, and all
|
|
|
|
* internal borders if border-collapse is on.
|
|
|
|
*/
|
|
|
|
void PaintTableBorderBackground(nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsPoint aPt);
|
2002-02-26 00:27:42 +00:00
|
|
|
|
2009-02-08 16:46:42 +00:00
|
|
|
/** Get the outer half (i.e., the part outside the height and width of
|
|
|
|
* the table) of the largest segment (?) of border-collapsed border on
|
|
|
|
* the table on each side, or 0 for non border-collapsed tables.
|
|
|
|
*/
|
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 05:38:33 +00:00
|
|
|
nsMargin GetOuterBCBorder() const;
|
|
|
|
|
2009-02-08 16:46:42 +00:00
|
|
|
/** Same as above, but only if it's included from the border-box width
|
|
|
|
* of the table.
|
|
|
|
*/
|
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 05:38:33 +00:00
|
|
|
nsMargin GetIncludedOuterBCBorder() const;
|
2003-09-13 16:26:30 +00:00
|
|
|
|
2009-02-08 16:46:42 +00:00
|
|
|
/** Same as above, but only if it's excluded from the border-box width
|
|
|
|
* of the table. This is the area that leaks out into the margin
|
|
|
|
* (or potentially past it, if there is no margin).
|
|
|
|
*/
|
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 05:38:33 +00:00
|
|
|
nsMargin GetExcludedOuterBCBorder() const;
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2009-07-22 00:44:52 +00:00
|
|
|
/**
|
|
|
|
* In quirks mode, the size of the table background is reduced
|
|
|
|
* by the outer BC border. Compute the reduction needed.
|
|
|
|
*/
|
|
|
|
nsMargin GetDeflationForBackground(nsPresContext* aPresContext) const;
|
|
|
|
|
2004-03-09 06:48:35 +00:00
|
|
|
/** Get width of table + colgroup + col collapse: elements that
|
|
|
|
* continue along the length of the whole left side.
|
|
|
|
* see nsTablePainter about continuous borders
|
|
|
|
*/
|
2007-02-07 07:46:44 +00:00
|
|
|
nscoord GetContinuousLeftBCBorderWidth() const;
|
2009-06-21 16:31:40 +00:00
|
|
|
void SetContinuousLeftBCBorderWidth(nscoord aValue);
|
|
|
|
|
2008-10-26 10:11:34 +00:00
|
|
|
friend class nsDelayedCalcBCBorders;
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
void SetBCDamageArea(const nsRect& aValue);
|
2008-10-26 10:11:34 +00:00
|
|
|
PRBool BCRecalcNeeded(nsStyleContext* aOldStyleContext,
|
|
|
|
nsStyleContext* aNewStyleContext);
|
2005-02-07 01:58:25 +00:00
|
|
|
void PaintBCBorders(nsIRenderingContext& aRenderingContext,
|
2002-02-19 15:48:28 +00:00
|
|
|
const nsRect& aDirtyRect);
|
|
|
|
|
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 05:38:33 +00:00
|
|
|
virtual void MarkIntrinsicWidthsDirty();
|
|
|
|
// For border-collapse tables, the caller must not add padding and
|
|
|
|
// border to the results of these functions.
|
|
|
|
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
|
|
|
|
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
|
2006-12-17 14:06:42 +00:00
|
|
|
virtual IntrinsicWidthOffsetData
|
|
|
|
IntrinsicWidthOffsets(nsIRenderingContext* aRenderingContext);
|
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 05:38:33 +00:00
|
|
|
|
|
|
|
virtual nsSize ComputeSize(nsIRenderingContext *aRenderingContext,
|
|
|
|
nsSize aCBSize, nscoord aAvailableWidth,
|
|
|
|
nsSize aMargin, nsSize aBorder, nsSize aPadding,
|
|
|
|
PRBool aShrinkWrap);
|
|
|
|
virtual nsSize ComputeAutoSize(nsIRenderingContext *aRenderingContext,
|
|
|
|
nsSize aCBSize, nscoord aAvailableWidth,
|
|
|
|
nsSize aMargin, nsSize aBorder,
|
|
|
|
nsSize aPadding, PRBool aShrinkWrap);
|
|
|
|
/**
|
|
|
|
* A copy of nsFrame::ShrinkWidthToFit that calls a different
|
|
|
|
* GetPrefWidth, since tables have two different ones.
|
|
|
|
*/
|
|
|
|
nscoord TableShrinkWidthToFit(nsIRenderingContext *aRenderingContext,
|
|
|
|
nscoord aWidthInCB);
|
|
|
|
|
|
|
|
// XXXldb REWRITE THIS COMMENT!
|
1998-04-14 21:45:28 +00:00
|
|
|
/** inner tables are reflowed in two steps.
|
|
|
|
* <pre>
|
|
|
|
* if mFirstPassValid is false, this is our first time through since content was last changed
|
|
|
|
* set pass to 1
|
|
|
|
* do pass 1
|
|
|
|
* get min/max info for all cells in an infinite space
|
|
|
|
* do column balancing
|
|
|
|
* set mFirstPassValid to true
|
|
|
|
* do pass 2
|
1998-05-25 17:31:49 +00:00
|
|
|
* use column widths to Reflow cells
|
1998-04-14 21:45:28 +00:00
|
|
|
* </pre>
|
|
|
|
*
|
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 05:38:33 +00:00
|
|
|
* @see nsIFrame::Reflow
|
1998-04-14 21:45:28 +00:00
|
|
|
*/
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
1998-10-20 20:05:44 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
1998-10-02 04:10:00 +00:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
1998-10-20 20:05:44 +00:00
|
|
|
nsReflowStatus& aStatus);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
nsresult ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
|
2001-08-08 01:13:35 +00:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nscoord aAvailHeight,
|
2002-03-04 15:48:56 +00:00
|
|
|
nsIFrame*& aLastChildReflowed,
|
2001-08-08 01:13:35 +00:00
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
1999-12-13 22:56:31 +00:00
|
|
|
nsFrameList& GetColGroups();
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext,
|
2002-03-27 02:38:13 +00:00
|
|
|
nsIFrame** aProviderFrame,
|
|
|
|
PRBool* aIsChild);
|
|
|
|
|
1999-02-24 05:54:31 +00:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
2007-01-30 00:06:41 +00:00
|
|
|
* @see nsGkAtoms::tableFrame
|
1999-02-24 05:54:31 +00:00
|
|
|
*/
|
2003-10-31 20:19:18 +00:00
|
|
|
virtual nsIAtom* GetType() const;
|
1998-12-23 15:47:43 +00:00
|
|
|
|
1999-11-01 22:12:45 +00:00
|
|
|
#ifdef DEBUG
|
1999-01-27 19:29:24 +00:00
|
|
|
/** @see nsIFrame::GetFrameName */
|
2001-11-14 01:33:42 +00:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
1999-09-01 01:02:16 +00:00
|
|
|
#endif
|
1999-08-31 03:09:40 +00:00
|
|
|
|
1998-04-14 21:45:28 +00:00
|
|
|
/** return the width of the column at aColIndex */
|
1998-05-29 22:08:19 +00:00
|
|
|
virtual PRInt32 GetColumnWidth(PRInt32 aColIndex);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-04-14 21:45:28 +00:00
|
|
|
/** set the width of the column at aColIndex to aWidth */
|
1998-06-05 18:11:20 +00:00
|
|
|
virtual void SetColumnWidth(PRInt32 aColIndex, nscoord aWidth);
|
1998-07-16 23:23:31 +00:00
|
|
|
|
1998-12-09 06:37:18 +00:00
|
|
|
/** helper to get the cell spacing X style value */
|
|
|
|
virtual nscoord GetCellSpacingX();
|
|
|
|
|
|
|
|
/** helper to get the cell spacing Y style value */
|
|
|
|
virtual nscoord GetCellSpacingY();
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2007-01-23 04:06:56 +00:00
|
|
|
virtual nscoord GetBaseline() const;
|
1998-06-24 19:13:19 +00:00
|
|
|
/** return the row span of a cell, taking into account row span magic at the bottom
|
2000-02-01 03:23:29 +00:00
|
|
|
* of a table. The row span equals the number of rows spanned by aCell starting at
|
|
|
|
* aStartRowIndex, and can be smaller if aStartRowIndex is greater than the row
|
|
|
|
* index in which aCell originates.
|
1998-07-16 23:23:31 +00:00
|
|
|
*
|
2000-02-01 03:23:29 +00:00
|
|
|
* @param aStartRowIndex the cell
|
|
|
|
* @param aCell the cell
|
1998-07-16 23:23:31 +00:00
|
|
|
*
|
1998-06-24 19:13:19 +00:00
|
|
|
* @return the row span, correcting for row spans that extend beyond the bottom
|
|
|
|
* of the table.
|
|
|
|
*/
|
2000-02-01 03:23:29 +00:00
|
|
|
virtual PRInt32 GetEffectiveRowSpan(PRInt32 aStartRowIndex,
|
|
|
|
const nsTableCellFrame& aCell) const;
|
2002-03-05 15:23:28 +00:00
|
|
|
virtual PRInt32 GetEffectiveRowSpan(const nsTableCellFrame& aCell,
|
|
|
|
nsCellMap* aCellMap = nsnull);
|
1998-06-24 19:13:19 +00:00
|
|
|
|
1998-07-16 23:23:31 +00:00
|
|
|
/** return the col span of a cell, taking into account col span magic at the edge
|
|
|
|
* of a table.
|
|
|
|
*
|
|
|
|
* @param aCell the cell
|
|
|
|
*
|
|
|
|
* @return the col span, correcting for col spans that extend beyond the edge
|
|
|
|
* of the table.
|
|
|
|
*/
|
2002-03-05 15:23:28 +00:00
|
|
|
virtual PRInt32 GetEffectiveColSpan(const nsTableCellFrame& aCell,
|
|
|
|
nsCellMap* aCellMap = nsnull) const;
|
1998-07-16 23:23:31 +00:00
|
|
|
|
2004-04-13 06:21:16 +00:00
|
|
|
/** indicate whether the row has more than one cell that either originates
|
|
|
|
* or is spanned from the rows above
|
|
|
|
*/
|
|
|
|
PRBool HasMoreThanOneCell(PRInt32 aRowIndex) const;
|
|
|
|
|
1998-07-22 03:53:43 +00:00
|
|
|
/** return the value of the COLS attribute, adjusted for the
|
|
|
|
* actual number of columns in the table
|
|
|
|
*/
|
1998-08-26 17:26:38 +00:00
|
|
|
PRInt32 GetEffectiveCOLSAttribute();
|
|
|
|
|
2004-05-03 18:31:34 +00:00
|
|
|
/** return the column frame associated with aColIndex
|
|
|
|
* returns nsnull if the col frame has not yet been allocated, or if
|
|
|
|
* aColIndex is out of range
|
|
|
|
*/
|
1999-12-13 22:56:31 +00:00
|
|
|
nsTableColFrame* GetColFrame(PRInt32 aColIndex) const;
|
|
|
|
|
2004-05-03 18:31:34 +00:00
|
|
|
/** Insert a col frame reference into the colframe cache and adapt the cellmap
|
|
|
|
* @param aColFrame - the column frame
|
|
|
|
* @param aColIndex - index where the column should be inserted into the
|
|
|
|
* colframe cache
|
|
|
|
*/
|
2005-02-07 01:58:25 +00:00
|
|
|
void InsertCol(nsTableColFrame& aColFrame,
|
1999-12-13 22:56:31 +00:00
|
|
|
PRInt32 aColIndex);
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
nsTableColGroupFrame* CreateAnonymousColGroupFrame(nsTableColGroupType aType);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
PRInt32 DestroyAnonymousColFrames(PRInt32 aNumFrames);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2009-07-12 17:47:10 +00:00
|
|
|
void AppendAnonymousColFrames(PRInt32 aNumColsToAdd);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
void CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
|
1999-12-13 22:56:31 +00:00
|
|
|
PRInt32 aNumColsToAdd,
|
|
|
|
nsTableColType aColType,
|
|
|
|
PRBool aAddToColGroupAndTable,
|
|
|
|
nsIFrame* aPrevCol,
|
|
|
|
nsIFrame** aFirstNewFrame);
|
|
|
|
|
2006-08-28 17:39:36 +00:00
|
|
|
void MatchCellMapToColCache(nsTableCellMap* aCellMap);
|
1999-12-13 22:56:31 +00:00
|
|
|
/** empty the column frame cache */
|
|
|
|
void ClearColCache();
|
|
|
|
|
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 05:38:33 +00:00
|
|
|
void DidResizeColumns();
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
virtual void AppendCell(nsTableCellFrame& aCellFrame,
|
2002-02-19 15:48:28 +00:00
|
|
|
PRInt32 aRowIndex);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2009-02-05 09:09:50 +00:00
|
|
|
virtual void InsertCells(nsTArray<nsTableCellFrame*>& aCellFrames,
|
|
|
|
PRInt32 aRowIndex,
|
|
|
|
PRInt32 aColIndexBefore);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
virtual void RemoveCell(nsTableCellFrame* aCellFrame,
|
1999-12-13 22:56:31 +00:00
|
|
|
PRInt32 aRowIndex);
|
|
|
|
|
2009-02-05 09:09:50 +00:00
|
|
|
void AppendRows(nsTableRowGroupFrame& aRowGroupFrame,
|
|
|
|
PRInt32 aRowIndex,
|
|
|
|
nsTArray<nsTableRowFrame*>& aRowFrames);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
PRInt32 InsertRow(nsTableRowGroupFrame& aRowGroupFrame,
|
2000-01-13 05:29:38 +00:00
|
|
|
nsIFrame& aFrame,
|
|
|
|
PRInt32 aRowIndex,
|
|
|
|
PRBool aConsiderSpans);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2009-02-05 09:09:50 +00:00
|
|
|
PRInt32 InsertRows(nsTableRowGroupFrame& aRowGroupFrame,
|
|
|
|
nsTArray<nsTableRowFrame*>& aFrames,
|
|
|
|
PRInt32 aRowIndex,
|
|
|
|
PRBool aConsiderSpans);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
virtual void RemoveRows(nsTableRowFrame& aFirstRowFrame,
|
2001-03-13 06:38:59 +00:00
|
|
|
PRInt32 aNumRowsToRemove,
|
|
|
|
PRBool aConsiderSpans);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2006-08-04 19:15:50 +00:00
|
|
|
/** Insert multiple rowgroups into the table cellmap handling
|
|
|
|
* @param aFirstRowGroupFrame - first row group to be inserted all siblings
|
|
|
|
* will be appended too.
|
|
|
|
*/
|
2005-02-07 01:58:25 +00:00
|
|
|
void AppendRowGroups(nsIFrame* aFirstRowGroupFrame);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2006-08-04 19:15:50 +00:00
|
|
|
/** Insert multiple rowgroups into the table cellmap handling
|
|
|
|
* @param aFirstRowGroupFrame - first row group to be inserted
|
|
|
|
* @param aLastRowGroupFrame - when inserting the siblings of
|
|
|
|
* aFirstRowGroupFrame stop at this row group
|
|
|
|
*/
|
2005-02-07 01:58:25 +00:00
|
|
|
void InsertRowGroups(nsIFrame* aFirstRowGroupFrame,
|
2000-09-14 06:49:47 +00:00
|
|
|
nsIFrame* aLastRowGroupFrame);
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
void InsertColGroups(PRInt32 aColIndex,
|
1999-12-13 22:56:31 +00:00
|
|
|
nsIFrame* aFirstFrame,
|
|
|
|
nsIFrame* aLastFrame = nsnull);
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
virtual void RemoveCol(nsTableColGroupFrame* aColGroupFrame,
|
1999-12-13 22:56:31 +00:00
|
|
|
PRInt32 aColIndex,
|
|
|
|
PRBool aRemoveFromCache,
|
|
|
|
PRBool aRemoveFromCellMap);
|
1998-08-31 21:23:28 +00:00
|
|
|
|
2008-02-07 07:03:26 +00:00
|
|
|
NS_IMETHOD GetIndexByRowAndColumn(PRInt32 aRow, PRInt32 aColumn, PRInt32 *aIndex);
|
|
|
|
NS_IMETHOD GetRowAndColumnByIndex(PRInt32 aIndex, PRInt32 *aRow, PRInt32 *aColumn);
|
2008-09-24 17:14:35 +00:00
|
|
|
|
|
|
|
PRBool ColumnHasCellSpacingBefore(PRInt32 aColIndex) const;
|
1999-07-28 08:09:02 +00:00
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
PRBool HasPctCol() const;
|
|
|
|
void SetHasPctCol(PRBool aValue);
|
|
|
|
|
2000-09-09 01:46:44 +00:00
|
|
|
PRBool HasCellSpanningPctCol() const;
|
|
|
|
void SetHasCellSpanningPctCol(PRBool aValue);
|
2001-11-05 00:15:51 +00:00
|
|
|
|
2008-02-08 09:36:32 +00:00
|
|
|
/**
|
|
|
|
* To be called on a frame by its parent after setting its size/position and
|
|
|
|
* calling DidReflow (possibly via FinishReflowChild()). This can also be
|
|
|
|
* used for child frames which are not being reflown but did have their size
|
|
|
|
* or position changed.
|
|
|
|
*
|
|
|
|
* @param aFrame The frame to invalidate
|
|
|
|
* @param aOrigRect The original rect of aFrame (before the change).
|
2008-03-16 20:32:48 +00:00
|
|
|
* @param aOrigOverflowRect The original overflow rect of aFrame.
|
2008-02-08 09:36:32 +00:00
|
|
|
* @param aIsFirstReflow True if the size/position change is due to the
|
|
|
|
* first reflow of aFrame.
|
|
|
|
*/
|
2008-03-16 20:32:48 +00:00
|
|
|
static void InvalidateFrame(nsIFrame* aFrame,
|
|
|
|
const nsRect& aOrigRect,
|
|
|
|
const nsRect& aOrigOverflowRect,
|
2008-02-08 09:36:32 +00:00
|
|
|
PRBool aIsFirstReflow);
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
protected:
|
|
|
|
|
2000-05-11 01:04:39 +00:00
|
|
|
/** protected constructor.
|
1998-04-14 21:45:28 +00:00
|
|
|
* @see NewFrame
|
|
|
|
*/
|
2006-03-26 21:30:36 +00:00
|
|
|
nsTableFrame(nsStyleContext* aContext);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
/** destructor, responsible for mColumnLayoutData */
|
1998-04-13 20:24:54 +00:00
|
|
|
virtual ~nsTableFrame();
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
void InitChildReflowState(nsHTMLReflowState& aReflowState);
|
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;
|
|
|
|
|
1999-06-15 01:19:18 +00:00
|
|
|
public:
|
2001-08-06 14:48:09 +00:00
|
|
|
PRBool IsRowInserted() const;
|
|
|
|
void SetRowInserted(PRBool aValue);
|
|
|
|
|
1999-06-15 01:19:18 +00:00
|
|
|
protected:
|
2007-12-05 02:32:56 +00:00
|
|
|
|
|
|
|
// A helper function to reflow a header or footer with unconstrained height
|
|
|
|
// to see if it should be made repeatable and also to determine its desired
|
|
|
|
// height.
|
|
|
|
nsresult SetupHeaderFooterChild(const nsTableReflowState& aReflowState,
|
|
|
|
nsTableRowGroupFrame* aFrame,
|
|
|
|
nscoord* aDesiredHeight);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_METHOD ReflowChildren(nsTableReflowState& aReflowState,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsReflowStatus& aStatus,
|
2002-03-04 15:48:56 +00:00
|
|
|
nsIFrame*& aLastChildReflowed,
|
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 05:38:33 +00:00
|
|
|
nsRect& aOverflowArea);
|
1998-10-11 09:18:27 +00:00
|
|
|
|
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 05:38:33 +00:00
|
|
|
// This calls the col group and column reflow methods, which do two things:
|
|
|
|
// (1) set all the dimensions to 0
|
|
|
|
// (2) notify the table about colgroups or columns with hidden visibility
|
|
|
|
void ReflowColGroups(nsIRenderingContext* aRenderingContext);
|
1999-02-11 06:22:33 +00:00
|
|
|
|
2006-03-04 05:26:57 +00:00
|
|
|
/** return the width of the table taking into account visibility collapse
|
|
|
|
* on columns and colgroups
|
|
|
|
* @param aBorderPadding the border and padding of the table
|
|
|
|
*/
|
|
|
|
nscoord GetCollapsedWidth(nsMargin aBorderPadding);
|
1999-06-14 08:01:00 +00:00
|
|
|
|
2006-03-04 05:26:57 +00:00
|
|
|
|
|
|
|
/** Adjust the table for visibilty.collapse set on rowgroups, rows, colgroups
|
|
|
|
* and cols
|
|
|
|
* @param aDesiredSize the metrics of the table
|
|
|
|
* @param aBorderPadding the border and padding of the table
|
|
|
|
*/
|
|
|
|
void AdjustForCollapsingRowsCols(nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
nsMargin aBorderPadding);
|
1999-02-11 06:22:33 +00:00
|
|
|
|
2008-09-24 17:14:35 +00:00
|
|
|
nsITableLayoutStrategy* LayoutStrategy() const {
|
2007-07-08 07:08:04 +00:00
|
|
|
return static_cast<nsTableFrame*>(GetFirstInFlow())->
|
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 05:38:33 +00:00
|
|
|
mTableLayoutStrategy;
|
|
|
|
}
|
1998-08-31 21:23:28 +00:00
|
|
|
|
2008-02-06 22:01:41 +00:00
|
|
|
private:
|
|
|
|
/* Handle a row that got inserted during reflow. aNewHeight is the
|
|
|
|
new height of the table after reflow. */
|
|
|
|
void ProcessRowInserted(nscoord aNewHeight);
|
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
// WIDTH AND HEIGHT CALCULATION
|
1998-11-20 01:01:25 +00:00
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
// calculate the computed height of aFrame including its border and padding given
|
|
|
|
// its reflow state.
|
2003-12-28 17:02:40 +00:00
|
|
|
nscoord CalcBorderBoxHeight(const nsHTMLReflowState& aReflowState);
|
2001-03-13 06:38:59 +00:00
|
|
|
|
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 05:38:33 +00:00
|
|
|
protected:
|
2001-03-13 06:38:59 +00:00
|
|
|
|
2004-09-13 18:21:03 +00:00
|
|
|
// update the desired height of this table taking into account the current
|
|
|
|
// reflow state, the table attributes and the content driven rowgroup heights
|
|
|
|
// this function can change the overflow area
|
|
|
|
void CalcDesiredHeight(const nsHTMLReflowState& aReflowState, nsHTMLReflowMetrics& aDesiredSize);
|
2001-11-05 00:15:51 +00:00
|
|
|
|
|
|
|
// The following is a helper for CalcDesiredHeight
|
2001-03-13 06:38:59 +00:00
|
|
|
|
2003-12-28 17:02:40 +00:00
|
|
|
void DistributeHeightToRows(const nsHTMLReflowState& aReflowState,
|
2001-11-05 00:15:51 +00:00
|
|
|
nscoord aAmount);
|
1998-11-20 01:01:25 +00:00
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
void PlaceChild(nsTableReflowState& aReflowState,
|
2001-03-13 06:38:59 +00:00
|
|
|
nsIFrame* aKidFrame,
|
2008-02-08 09:36:32 +00:00
|
|
|
nsHTMLReflowMetrics& aKidDesiredSize,
|
2008-03-16 20:32:48 +00:00
|
|
|
const nsRect& aOriginalKidRect,
|
|
|
|
const nsRect& aOriginalKidOverflowRect);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1999-03-09 05:29:37 +00:00
|
|
|
nsIFrame* GetFirstBodyRowGroupFrame();
|
2004-07-31 23:15:21 +00:00
|
|
|
PRBool MoveOverflowToChildList(nsPresContext* aPresContext);
|
2005-02-16 20:02:14 +00:00
|
|
|
/**
|
|
|
|
* Push all our child frames from the aFrames array, in order, starting from the
|
|
|
|
* frame at aPushFrom to the end of the array. The frames are put on our overflow
|
|
|
|
* list or moved directly to our next-in-flow if one exists.
|
|
|
|
*/
|
2007-06-05 18:55:26 +00:00
|
|
|
typedef nsAutoTPtrArray<nsIFrame, 8> FrameArray;
|
|
|
|
void PushChildren(const FrameArray& aFrames, PRInt32 aPushFrom);
|
1999-03-09 05:29:37 +00:00
|
|
|
|
1998-10-14 16:32:45 +00:00
|
|
|
public:
|
2007-06-05 18:55:26 +00:00
|
|
|
// put the children frames in the display order (e.g. thead before tbodies
|
|
|
|
// before tfoot). This will handle calling GetRowGroupFrame() on the
|
|
|
|
// children, and not append nulls, so the array is guaranteed to contain
|
|
|
|
// nsTableRowGroupFrames. If there are multiple theads or tfoots, all but
|
|
|
|
// the first one are treated as tbodies instead.
|
|
|
|
typedef nsAutoTPtrArray<nsTableRowGroupFrame, 8> RowGroupArray;
|
|
|
|
void OrderRowGroups(RowGroupArray& aChildren) const;
|
2000-09-14 06:49:47 +00:00
|
|
|
|
2007-06-05 18:55:26 +00:00
|
|
|
// Return the thead, if any
|
|
|
|
nsTableRowGroupFrame* GetTHead() const;
|
|
|
|
|
|
|
|
// Return the tfoot, if any
|
|
|
|
nsTableRowGroupFrame* GetTFoot() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// As above, but does NOT actually call GetRowGroupFrame() on the kids, so
|
|
|
|
// returns an array of nsIFrames. This is to be used when you really want
|
|
|
|
// the flowable kids of the table, not the rowgroups. This outputs the thead
|
|
|
|
// and tfoot if they happen to be rowgroups. All the child nsIFrames of the
|
|
|
|
// table that return null if you call GetRowGroupFrame() on them will appear
|
|
|
|
// at the end of the array, after the tfoot, if any.
|
|
|
|
//
|
|
|
|
// aHead and aFoot must not be null.
|
|
|
|
//
|
|
|
|
// @return the number of frames in aChildren which return non-null if you
|
|
|
|
// call GetRowGroupFrame() on them.
|
|
|
|
//
|
|
|
|
// XXXbz why do we really care about the non-rowgroup kids?
|
|
|
|
PRUint32 OrderRowGroups(FrameArray& aChildren,
|
|
|
|
nsTableRowGroupFrame** aHead,
|
|
|
|
nsTableRowGroupFrame** aFoot) const;
|
|
|
|
|
|
|
|
public:
|
1999-08-19 19:52:37 +00:00
|
|
|
// Returns PR_TRUE if there are any cells above the row at
|
2005-11-04 18:41:32 +00:00
|
|
|
// aRowIndex and spanning into the row at aRowIndex, the number of
|
|
|
|
// effective columns limits the search up to that column
|
|
|
|
PRBool RowIsSpannedInto(PRInt32 aRowIndex, PRInt32 aNumEffCols);
|
1999-08-19 19:52:37 +00:00
|
|
|
|
|
|
|
// Returns PR_TRUE if there is a cell originating in aRowIndex
|
2005-11-04 18:41:32 +00:00
|
|
|
// which spans into the next row, the number of effective
|
|
|
|
// columns limits the search up to that column
|
|
|
|
PRBool RowHasSpanningCells(PRInt32 aRowIndex, PRInt32 aNumEffCols);
|
1999-08-19 19:52:37 +00:00
|
|
|
|
|
|
|
// Returns PR_TRUE if there are any cells to the left of the column at
|
|
|
|
// aColIndex and spanning into the column at aColIndex
|
|
|
|
PRBool ColIsSpannedInto(PRInt32 aColIndex);
|
|
|
|
|
|
|
|
// Returns PR_TRUE if there is a cell originating in aColIndex
|
|
|
|
// which spans into the next col
|
|
|
|
PRBool ColHasSpanningCells(PRInt32 aColIndex);
|
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
protected:
|
1998-10-15 21:07:37 +00:00
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
PRBool HaveReflowedColGroups() const;
|
|
|
|
void SetHaveReflowedColGroups(PRBool aValue);
|
2000-01-11 15:55:31 +00:00
|
|
|
|
1998-10-14 16:32:45 +00:00
|
|
|
public:
|
2002-02-19 15:48:28 +00:00
|
|
|
PRBool IsBorderCollapse() const;
|
|
|
|
|
|
|
|
PRBool NeedToCalcBCBorders() const;
|
|
|
|
void SetNeedToCalcBCBorders(PRBool aValue);
|
2006-03-04 05:26:57 +00:00
|
|
|
|
|
|
|
PRBool NeedToCollapse() const;
|
|
|
|
void SetNeedToCollapse(PRBool aValue);
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2006-10-20 07:37:24 +00:00
|
|
|
PRBool HasZeroColSpans() const;
|
|
|
|
void SetHasZeroColSpans(PRBool aValue);
|
|
|
|
|
|
|
|
PRBool NeedColSpanExpansion() const;
|
|
|
|
void SetNeedColSpanExpansion(PRBool aValue);
|
|
|
|
|
2007-05-18 06:04:43 +00:00
|
|
|
/** The GeometryDirty bit is similar to the NS_FRAME_IS_DIRTY frame
|
|
|
|
* state bit, which implies that all descendants are dirty. The
|
|
|
|
* GeometryDirty still implies that all the parts of the table are
|
|
|
|
* dirty, but resizing optimizations should still apply to the
|
|
|
|
* contents of the individual cells.
|
|
|
|
*/
|
2006-12-13 04:21:05 +00:00
|
|
|
void SetGeometryDirty() { mBits.mGeometryDirty = PR_TRUE; }
|
|
|
|
void ClearGeometryDirty() { mBits.mGeometryDirty = PR_FALSE; }
|
2006-12-13 03:45:28 +00:00
|
|
|
PRBool IsGeometryDirty() const { return mBits.mGeometryDirty; }
|
|
|
|
|
1999-07-28 08:09:02 +00:00
|
|
|
/** Get the cell map for this table frame. It is not always mCellMap.
|
|
|
|
* Only the firstInFlow has a legit cell map
|
|
|
|
*/
|
2000-01-13 05:29:38 +00:00
|
|
|
virtual nsTableCellMap* GetCellMap() const;
|
2006-08-04 19:15:50 +00:00
|
|
|
|
|
|
|
/** Iterate over the row groups and adjust the row indices of all rows
|
|
|
|
* whose index is >= aRowIndex.
|
|
|
|
* @param aRowIndex - start adjusting with this index
|
|
|
|
* @param aAdjustment - shift the row index by this amount
|
|
|
|
*/
|
2004-01-18 10:28:40 +00:00
|
|
|
void AdjustRowIndices(PRInt32 aRowIndex,
|
|
|
|
PRInt32 aAdjustment);
|
1999-08-30 00:01:09 +00:00
|
|
|
|
2006-08-04 19:15:50 +00:00
|
|
|
/** Reset the rowindices of all rows as they might have changed due to
|
|
|
|
* rowgroup reordering, exclude new row group frames that show in the
|
|
|
|
* reordering but are not yet inserted into the cellmap
|
|
|
|
* @param aFirstRowGroupFrame - first row group to be excluded
|
|
|
|
* @param aLastRowGroupFrame - last sibling of aFirstRowGroupFrame that
|
|
|
|
* should be excluded when reseting the row
|
|
|
|
* indices.
|
2006-06-28 19:00:01 +00:00
|
|
|
*/
|
2006-08-04 19:15:50 +00:00
|
|
|
void ResetRowIndices(nsIFrame* aFirstRowGroupFrame = nsnull,
|
|
|
|
nsIFrame* aLastRowGroupFrame = nsnull);
|
1999-09-02 00:07:14 +00:00
|
|
|
|
2009-02-05 09:09:50 +00:00
|
|
|
nsTArray<nsTableColFrame*>& GetColCache();
|
1999-12-13 22:56:31 +00:00
|
|
|
|
2004-03-09 06:48:35 +00:00
|
|
|
/** Return aFrame's child if aFrame is an nsScrollFrame, otherwise return aFrame
|
|
|
|
*/
|
|
|
|
static nsTableRowGroupFrame* GetRowGroupFrame(nsIFrame* aFrame,
|
|
|
|
nsIAtom* aFrameTypeIn = nsnull);
|
2000-01-13 05:29:38 +00:00
|
|
|
|
1998-10-14 16:32:45 +00:00
|
|
|
protected:
|
1998-06-17 16:38:24 +00:00
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
void SetBorderCollapse(PRBool aValue);
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
void CalcBCBorders();
|
2002-02-19 15:48:28 +00:00
|
|
|
|
|
|
|
void ExpandBCDamageArea(nsRect& aRect) const;
|
|
|
|
|
2004-01-18 10:28:40 +00:00
|
|
|
void SetColumnDimensions(nscoord aHeight,
|
2000-02-12 01:55:40 +00:00
|
|
|
const nsMargin& aReflowState);
|
1999-06-07 21:10:25 +00:00
|
|
|
|
2009-02-05 09:09:50 +00:00
|
|
|
PRInt32 CollectRows(nsIFrame* aFrame,
|
|
|
|
nsTArray<nsTableRowFrame*>& aCollection);
|
1999-01-17 23:35:56 +00:00
|
|
|
|
1998-07-11 00:00:31 +00:00
|
|
|
public: /* ----- Cell Map public methods ----- */
|
|
|
|
|
2000-09-14 06:49:47 +00:00
|
|
|
PRInt32 GetStartRowIndex(nsTableRowGroupFrame& aRowGroupFrame);
|
|
|
|
|
1998-06-17 16:38:24 +00:00
|
|
|
/** returns the number of rows in this table.
|
|
|
|
*/
|
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 05:38:33 +00:00
|
|
|
PRInt32 GetRowCount () const
|
|
|
|
{
|
|
|
|
return GetCellMap()->GetRowCount();
|
|
|
|
}
|
1998-06-17 16:38:24 +00:00
|
|
|
|
1999-07-28 08:09:02 +00:00
|
|
|
/** returns the number of columns in this table after redundant columns have been removed
|
1998-07-24 16:51:16 +00:00
|
|
|
*/
|
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 05:38:33 +00:00
|
|
|
PRInt32 GetEffectiveColCount() const;
|
|
|
|
|
|
|
|
/* return the col count including dead cols */
|
|
|
|
PRInt32 GetColCount () const
|
|
|
|
{
|
|
|
|
return GetCellMap()->GetColCount();
|
|
|
|
}
|
1998-07-24 16:51:16 +00:00
|
|
|
|
2001-05-17 12:40:27 +00:00
|
|
|
// return the last col index which isn't of type eColAnonymousCell
|
|
|
|
PRInt32 GetIndexOfLastRealCol();
|
1998-06-17 16:38:24 +00:00
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
/** returns PR_TRUE if table-layout:auto */
|
2000-11-15 14:59:47 +00:00
|
|
|
virtual PRBool IsAutoLayout();
|
1998-10-20 20:05:44 +00:00
|
|
|
|
1999-07-31 22:11:50 +00:00
|
|
|
/*---------------- nsITableLayout methods ------------------------*/
|
1999-08-01 16:20:14 +00:00
|
|
|
|
|
|
|
/** Get the cell and associated data for a table cell from the frame's cellmap */
|
1999-07-31 22:11:50 +00:00
|
|
|
NS_IMETHOD GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
|
|
|
|
nsIDOMElement* &aCell, //out params
|
|
|
|
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
|
|
|
PRInt32& aRowSpan, PRInt32& aColSpan,
|
2000-01-26 14:56:06 +00:00
|
|
|
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
1999-07-31 22:11:50 +00:00
|
|
|
PRBool& aIsSelected);
|
|
|
|
|
1999-08-01 16:20:14 +00:00
|
|
|
/** Get the number of rows and column for a table from the frame's cellmap
|
|
|
|
* Some rows may not have enough cells (the number returned is the maximum possible),
|
|
|
|
* which displays as a ragged-right edge table
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetTableSize(PRInt32& aRowCount, PRInt32& aColCount);
|
|
|
|
|
|
|
|
/*------------end of nsITableLayout methods -----------------------*/
|
|
|
|
|
1998-12-03 18:01:35 +00:00
|
|
|
public:
|
2005-03-05 16:43:07 +00:00
|
|
|
|
2002-03-06 15:56:32 +00:00
|
|
|
#ifdef DEBUG
|
2003-12-28 17:02:40 +00:00
|
|
|
void Dump(PRBool aDumpRows,
|
2000-01-22 01:16:50 +00:00
|
|
|
PRBool aDumpCols,
|
|
|
|
PRBool aDumpCellMap);
|
2001-09-24 14:48:38 +00:00
|
|
|
#endif
|
|
|
|
|
1999-02-03 22:35:03 +00:00
|
|
|
protected:
|
2002-03-06 15:56:32 +00:00
|
|
|
#ifdef DEBUG
|
2004-01-18 10:28:40 +00:00
|
|
|
void DumpRowGroup(nsIFrame* aChildFrame);
|
2002-03-06 15:56:32 +00:00
|
|
|
#endif
|
2001-03-13 06:38:59 +00:00
|
|
|
// DATA MEMBERS
|
2009-02-05 09:09:50 +00:00
|
|
|
nsAutoTPtrArray<nsTableColFrame, 8> mColFrames;
|
1999-10-04 23:48:05 +00:00
|
|
|
|
|
|
|
struct TableBits {
|
2004-03-09 06:48:35 +00:00
|
|
|
PRUint32 mHaveReflowedColGroups:1; // have the col groups gotten their initial reflow
|
|
|
|
PRUint32 mHasPctCol:1; // does any cell or col have a pct width
|
|
|
|
PRUint32 mCellSpansPctCol:1; // does any cell span a col with a pct width (or containing a cell with a pct width)
|
|
|
|
PRUint32 mIsBorderCollapse:1; // border collapsing model vs. separate model
|
|
|
|
PRUint32 mRowInserted:1;
|
|
|
|
PRUint32 mNeedToCalcBCBorders:1;
|
2006-12-13 03:45:28 +00:00
|
|
|
PRUint32 mGeometryDirty:1;
|
2004-03-09 06:48:35 +00:00
|
|
|
PRUint32 mLeftContBCBorder:8;
|
2006-03-04 05:26:57 +00:00
|
|
|
PRUint32 mNeedToCollapse:1; // rows, cols that have visibility:collapse need to be collapsed
|
2006-10-20 07:37:24 +00:00
|
|
|
PRUint32 mHasZeroColSpans:1;
|
|
|
|
PRUint32 mNeedColSpanExpansion:1;
|
2006-12-16 02:11:38 +00:00
|
|
|
PRUint32 mResizedColumns:1; // have we resized columns since last reflow?
|
1999-10-04 23:48:05 +00:00
|
|
|
} mBits;
|
|
|
|
|
2000-07-06 13:37:28 +00:00
|
|
|
nsTableCellMap* mCellMap; // maintains the relationships between rows, cols, and cells
|
|
|
|
nsITableLayoutStrategy* mTableLayoutStrategy;// the layout strategy for this frame
|
|
|
|
nsFrameList mColGroups; // the list of colgroup frames
|
1998-04-13 20:24:54 +00:00
|
|
|
};
|
|
|
|
|
1998-09-29 23:15:01 +00:00
|
|
|
|
1998-11-20 01:01:25 +00:00
|
|
|
inline PRBool nsTableFrame::IsRowGroup(PRInt32 aDisplayType) const
|
1998-10-11 09:18:27 +00:00
|
|
|
{
|
|
|
|
return PRBool((NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == aDisplayType) ||
|
|
|
|
(NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == aDisplayType) ||
|
|
|
|
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == aDisplayType));
|
|
|
|
}
|
1998-10-14 22:12:06 +00:00
|
|
|
|
2001-03-13 06:38:59 +00:00
|
|
|
inline void nsTableFrame::SetHaveReflowedColGroups(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mHaveReflowedColGroups = aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableFrame::HaveReflowedColGroups() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mHaveReflowedColGroups;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableFrame::HasPctCol() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mHasPctCol;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableFrame::SetHasPctCol(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mHasPctCol = (unsigned)aValue;
|
|
|
|
}
|
|
|
|
|
2000-09-09 01:46:44 +00:00
|
|
|
inline PRBool nsTableFrame::HasCellSpanningPctCol() const
|
1999-10-04 05:19:32 +00:00
|
|
|
{
|
2000-09-09 01:46:44 +00:00
|
|
|
return (PRBool)mBits.mCellSpansPctCol;
|
1999-10-04 05:19:32 +00:00
|
|
|
}
|
|
|
|
|
2000-09-09 01:46:44 +00:00
|
|
|
inline void nsTableFrame::SetHasCellSpanningPctCol(PRBool aValue)
|
1999-10-04 05:19:32 +00:00
|
|
|
{
|
2000-09-09 01:46:44 +00:00
|
|
|
mBits.mCellSpansPctCol = (unsigned)aValue;
|
1999-10-04 05:19:32 +00:00
|
|
|
}
|
|
|
|
|
2001-08-06 14:48:09 +00:00
|
|
|
inline PRBool nsTableFrame::IsRowInserted() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mRowInserted;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableFrame::SetRowInserted(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mRowInserted = (unsigned)aValue;
|
|
|
|
}
|
|
|
|
|
2006-03-04 05:26:57 +00:00
|
|
|
inline void nsTableFrame::SetNeedToCollapse(PRBool aValue)
|
2004-04-28 16:42:59 +00:00
|
|
|
{
|
2009-06-21 16:34:03 +00:00
|
|
|
static_cast<nsTableFrame*>(GetFirstInFlow())->mBits.mNeedToCollapse = (unsigned)aValue;
|
2004-04-28 16:42:59 +00:00
|
|
|
}
|
|
|
|
|
2006-03-04 05:26:57 +00:00
|
|
|
inline PRBool nsTableFrame::NeedToCollapse() const
|
2004-04-28 16:42:59 +00:00
|
|
|
{
|
2009-06-21 16:34:03 +00:00
|
|
|
return (PRBool) static_cast<nsTableFrame*>(GetFirstInFlow())->mBits.mNeedToCollapse;
|
2004-04-28 16:42:59 +00:00
|
|
|
}
|
|
|
|
|
2006-10-20 07:37:24 +00:00
|
|
|
inline void nsTableFrame::SetHasZeroColSpans(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mHasZeroColSpans = (unsigned)aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableFrame::HasZeroColSpans() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mHasZeroColSpans;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableFrame::SetNeedColSpanExpansion(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mNeedColSpanExpansion = (unsigned)aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableFrame::NeedColSpanExpansion() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mNeedColSpanExpansion;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-13 22:56:31 +00:00
|
|
|
inline nsFrameList& nsTableFrame::GetColGroups()
|
|
|
|
{
|
2007-07-08 07:08:04 +00:00
|
|
|
return static_cast<nsTableFrame*>(GetFirstInFlow())->mColGroups;
|
1999-12-13 22:56:31 +00:00
|
|
|
}
|
|
|
|
|
2009-02-05 09:09:50 +00:00
|
|
|
inline nsTArray<nsTableColFrame*>& nsTableFrame::GetColCache()
|
1999-12-13 22:56:31 +00:00
|
|
|
{
|
|
|
|
return mColFrames;
|
|
|
|
}
|
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
inline PRBool nsTableFrame::IsBorderCollapse() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mIsBorderCollapse;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableFrame::SetBorderCollapse(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mIsBorderCollapse = aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool nsTableFrame::NeedToCalcBCBorders() const
|
|
|
|
{
|
|
|
|
return (PRBool)mBits.mNeedToCalcBCBorders;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableFrame::SetNeedToCalcBCBorders(PRBool aValue)
|
|
|
|
{
|
|
|
|
mBits.mNeedToCalcBCBorders = (unsigned)aValue;
|
|
|
|
}
|
2001-03-13 06:38:59 +00:00
|
|
|
|
2004-03-09 06:48:35 +00:00
|
|
|
inline nscoord
|
2007-02-07 07:46:44 +00:00
|
|
|
nsTableFrame::GetContinuousLeftBCBorderWidth() const
|
2004-03-09 06:48:35 +00:00
|
|
|
{
|
2007-02-07 07:46:44 +00:00
|
|
|
PRInt32 aPixelsToTwips = nsPresContext::AppUnitsPerCSSPixel();
|
2004-03-09 06:48:35 +00:00
|
|
|
return BC_BORDER_RIGHT_HALF_COORD(aPixelsToTwips, mBits.mLeftContBCBorder);
|
|
|
|
}
|
|
|
|
|
2009-06-21 16:31:40 +00:00
|
|
|
inline void nsTableFrame::SetContinuousLeftBCBorderWidth(nscoord aValue)
|
|
|
|
{
|
|
|
|
mBits.mLeftContBCBorder = (unsigned) aValue;
|
|
|
|
}
|
|
|
|
|
1999-04-22 03:51:58 +00:00
|
|
|
class nsTableIterator
|
|
|
|
{
|
|
|
|
public:
|
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 05:38:33 +00:00
|
|
|
nsTableIterator(nsIFrame& aSource);
|
|
|
|
nsTableIterator(nsFrameList& aSource);
|
1999-04-22 03:51:58 +00:00
|
|
|
nsIFrame* First();
|
|
|
|
nsIFrame* Next();
|
|
|
|
PRBool IsLeftToRight();
|
|
|
|
PRInt32 Count();
|
|
|
|
|
|
|
|
protected:
|
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 05:38:33 +00:00
|
|
|
void Init(nsIFrame* aFirstChild);
|
1999-04-22 03:51:58 +00:00
|
|
|
PRBool mLeftToRight;
|
|
|
|
nsIFrame* mFirstListChild;
|
|
|
|
nsIFrame* mFirstChild;
|
|
|
|
nsIFrame* mCurrentChild;
|
|
|
|
PRInt32 mCount;
|
|
|
|
};
|
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
#define ABORT0() \
|
|
|
|
{NS_ASSERTION(PR_FALSE, "CellIterator program error"); \
|
|
|
|
return;}
|
|
|
|
|
|
|
|
#define ABORT1(aReturn) \
|
|
|
|
{NS_ASSERTION(PR_FALSE, "CellIterator program error"); \
|
|
|
|
return aReturn;}
|
|
|
|
|
1998-10-14 22:12:06 +00:00
|
|
|
#endif
|