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 nsTableCellFrame_h__
|
|
|
|
#define nsTableCellFrame_h__
|
|
|
|
|
1999-02-11 01:16:28 +00:00
|
|
|
#include "nsITableCellLayout.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
#include "nscore.h"
|
1998-10-20 17:45:07 +00:00
|
|
|
#include "nsHTMLContainerFrame.h"
|
1998-07-11 00:00:31 +00:00
|
|
|
#include "nsTableRowFrame.h" // need to actually include this here to inline GetRowIndex
|
2003-02-22 00:32:13 +00:00
|
|
|
#include "nsStyleContext.h"
|
2001-12-07 14:51:12 +00:00
|
|
|
#include "nsIPercentHeightObserver.h"
|
2007-01-30 00:06:41 +00:00
|
|
|
#include "nsGkAtoms.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 "nsLayoutUtils.h"
|
2009-02-05 09:09:50 +00:00
|
|
|
#include "nsTArray.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-11-11 19:56:02 +00:00
|
|
|
class nsTableFrame;
|
1998-06-23 23:23:21 +00:00
|
|
|
|
1999-10-15 03:14:59 +00:00
|
|
|
/**
|
|
|
|
* Additional frame-state bits
|
|
|
|
*/
|
2010-06-09 05:28:14 +00:00
|
|
|
#define NS_TABLE_CELL_CONTENT_EMPTY NS_FRAME_STATE_BIT(31)
|
|
|
|
#define NS_TABLE_CELL_HAD_SPECIAL_REFLOW NS_FRAME_STATE_BIT(29)
|
|
|
|
#define NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT NS_FRAME_STATE_BIT(28)
|
1999-10-15 03:14:59 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
|
|
|
* nsTableCellFrame
|
|
|
|
* data structure to maintain information about a single table cell's frame
|
|
|
|
*
|
1999-02-11 01:16:28 +00:00
|
|
|
* NOTE: frames are not ref counted. We expose addref and release here
|
|
|
|
* so we can change that decsion in the future. Users of nsITableCellLayout
|
|
|
|
* should refcount correctly as if this object is being ref counted, though
|
|
|
|
* no actual support is under the hood.
|
|
|
|
*
|
1998-04-13 20:24:54 +00:00
|
|
|
* @author sclark
|
|
|
|
*/
|
2010-04-27 16:15:01 +00:00
|
|
|
class nsTableCellFrame : public nsHTMLContainerFrame,
|
|
|
|
public nsITableCellLayout,
|
2001-12-07 14:51:12 +00:00
|
|
|
public nsIPercentHeightObserver
|
1998-04-13 20:24:54 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsTableCellFrame)
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
1999-02-11 01:16:28 +00:00
|
|
|
|
1999-10-08 18:52:19 +00:00
|
|
|
// default constructor supplied by the compiler
|
1998-12-03 20:19:01 +00:00
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsTableCellFrame(nsStyleContext* aContext);
|
1999-10-17 03:30:11 +00:00
|
|
|
~nsTableCellFrame();
|
|
|
|
|
2006-03-09 18:55:21 +00:00
|
|
|
NS_IMETHOD Init(nsIContent* aContent,
|
1999-02-25 05:31:15 +00:00
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow);
|
|
|
|
|
2001-08-17 03:13:07 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
2010-06-28 12:02:03 +00:00
|
|
|
virtual already_AddRefed<nsAccessible> CreateAccessible();
|
2001-08-17 03:13:07 +00:00
|
|
|
#endif
|
2001-05-17 23:52:32 +00:00
|
|
|
|
2005-09-07 16:49:21 +00:00
|
|
|
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
2000-01-04 05:31:56 +00:00
|
|
|
nsIAtom* aAttribute,
|
2003-07-11 21:16:12 +00:00
|
|
|
PRInt32 aModType);
|
2000-01-04 05:31:56 +00:00
|
|
|
|
2008-10-26 10:11:34 +00:00
|
|
|
/** @see nsIFrame::DidSetStyleContext */
|
|
|
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
|
2010-04-27 16:15:01 +00:00
|
|
|
|
2009-01-04 19:52:38 +00:00
|
|
|
// table cells contain a block frame which does most of the work, and
|
1999-08-01 22:21:03 +00:00
|
|
|
// so these functions should never be called. They assert and return
|
|
|
|
// NS_ERROR_NOT_IMPLEMENTED
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD AppendFrames(nsIAtom* aListName,
|
2009-07-30 17:23:32 +00:00
|
|
|
nsFrameList& aFrameList);
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD InsertFrames(nsIAtom* aListName,
|
1999-08-01 22:21:03 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
2009-07-30 17:23:32 +00:00
|
|
|
nsFrameList& aFrameList);
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
|
1999-08-01 22:21:03 +00:00
|
|
|
nsIFrame* aOldFrame);
|
|
|
|
|
2004-07-18 12:02:53 +00:00
|
|
|
virtual nsIFrame* GetContentInsertionFrame() {
|
|
|
|
return GetFirstChild(nsnull)->GetContentInsertionFrame();
|
|
|
|
}
|
|
|
|
|
2006-12-13 23:04:57 +00:00
|
|
|
virtual nsMargin GetUsedMargin() const;
|
|
|
|
|
2002-04-10 21:32:41 +00:00
|
|
|
virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState);
|
2001-12-07 14:51:12 +00:00
|
|
|
|
2002-04-10 21:32:41 +00:00
|
|
|
virtual PRBool NeedsToObserve(const nsHTMLReflowState& aReflowState);
|
1998-12-21 06:38:18 +00:00
|
|
|
|
2005-11-04 02:38:33 +00:00
|
|
|
/** instantiate a new instance of nsTableRowFrame.
|
|
|
|
* @param aPresShell the pres shell for this frame
|
1998-09-15 17:58:24 +00:00
|
|
|
*
|
2005-11-04 02:38:33 +00:00
|
|
|
* @return the frame that was created
|
1998-09-15 17:58:24 +00:00
|
|
|
*/
|
2006-03-26 21:30:36 +00:00
|
|
|
friend nsIFrame* NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2006-01-26 02:29:17 +00:00
|
|
|
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists);
|
2010-04-27 16:15:01 +00:00
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
void PaintCellBackground(nsRenderingContext& aRenderingContext,
|
2009-09-12 22:44:18 +00:00
|
|
|
const nsRect& aDirtyRect, nsPoint aPt,
|
|
|
|
PRUint32 aFlags);
|
2000-03-22 02:43:08 +00:00
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext);
|
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext);
|
2006-12-17 14:06:42 +00:00
|
|
|
virtual IntrinsicWidthOffsetData
|
2011-04-08 01:04:40 +00:00
|
|
|
IntrinsicWidthOffsets(nsRenderingContext* 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
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
1998-10-01 04:46:11 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
1998-10-02 04:10:00 +00:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
1998-05-25 17:31:49 +00:00
|
|
|
nsReflowStatus& aStatus);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1999-02-24 05:54:31 +00:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsLayoutAtoms::tableCellFrame
|
|
|
|
*/
|
2003-10-31 20:19:18 +00:00
|
|
|
virtual nsIAtom* GetType() const;
|
1999-02-24 05:54:31 +00:00
|
|
|
|
2007-01-27 18:45:35 +00:00
|
|
|
virtual PRBool IsContainingBlock() const;
|
|
|
|
|
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
|
1999-08-31 03:09:40 +00:00
|
|
|
|
2007-01-27 22:22:24 +00:00
|
|
|
void VerticallyAlignChild(nscoord aMaxAscent);
|
2000-06-05 08:25:11 +00:00
|
|
|
|
2010-08-31 16:05:12 +00:00
|
|
|
/*
|
|
|
|
* Get the value of vertical-align adjusted for CSS 2's rules for a
|
|
|
|
* table cell, which means the result is always
|
|
|
|
* NS_STYLE_VERTICAL_ALIGN_{TOP,MIDDLE,BOTTOM,BASELINE}.
|
|
|
|
*/
|
|
|
|
PRUint8 GetVerticalAlign() const;
|
|
|
|
|
|
|
|
PRBool HasVerticalAlignBaseline() const {
|
|
|
|
return GetVerticalAlign() == NS_STYLE_VERTICAL_ALIGN_BASELINE;
|
|
|
|
}
|
2010-04-27 16:15:01 +00:00
|
|
|
|
|
|
|
PRBool CellHasVisibleContent(nscoord height,
|
2008-09-13 14:38:29 +00:00
|
|
|
nsTableFrame* tableFrame,
|
|
|
|
nsIFrame* kidFrame);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2007-01-23 04:06:56 +00:00
|
|
|
/**
|
|
|
|
* Get the first-line baseline of the cell relative to its top border
|
|
|
|
* edge, as if the cell were vertically aligned to the top of the row.
|
|
|
|
*/
|
|
|
|
nscoord GetCellBaseline() const;
|
|
|
|
|
1999-02-21 19:55:22 +00:00
|
|
|
/**
|
|
|
|
* return the cell's specified row span. this is what was specified in the
|
|
|
|
* content model or in the style info, and is always >= 1.
|
|
|
|
* to get the effective row span (the actual value that applies), use GetEffectiveRowSpan()
|
|
|
|
* @see nsTableFrame::GetEffectiveRowSpan()
|
|
|
|
*/
|
1998-04-13 20:24:54 +00:00
|
|
|
virtual PRInt32 GetRowSpan();
|
|
|
|
|
1998-07-11 00:00:31 +00:00
|
|
|
// there is no set row index because row index depends on the cell's parent row only
|
|
|
|
|
1999-08-01 16:20:14 +00:00
|
|
|
/*---------------- nsITableCellLayout methods ------------------------*/
|
|
|
|
|
1999-02-21 19:55:22 +00:00
|
|
|
/**
|
|
|
|
* return the cell's starting row index (starting at 0 for the first row).
|
|
|
|
* for continued cell frames the row index is that of the cell's first-in-flow
|
1999-08-04 02:04:45 +00:00
|
|
|
* and the column index (starting at 0 for the first column
|
1999-02-21 19:55:22 +00:00
|
|
|
*/
|
1999-08-04 02:04:45 +00:00
|
|
|
NS_IMETHOD GetCellIndexes(PRInt32 &aRowIndex, PRInt32 &aColIndex);
|
|
|
|
|
|
|
|
/** return the mapped cell's row index (starting at 0 for the first row) */
|
1999-08-19 19:52:37 +00:00
|
|
|
virtual nsresult GetRowIndex(PRInt32 &aRowIndex) const;
|
1998-07-11 00:00:31 +00:00
|
|
|
|
1999-02-21 19:55:22 +00:00
|
|
|
/**
|
|
|
|
* return the cell's specified col span. this is what was specified in the
|
|
|
|
* content model or in the style info, and is always >= 1.
|
|
|
|
* to get the effective col span (the actual value that applies), use GetEffectiveColSpan()
|
|
|
|
* @see nsTableFrame::GetEffectiveColSpan()
|
|
|
|
*/
|
1998-04-23 17:29:07 +00:00
|
|
|
virtual PRInt32 GetColSpan();
|
2010-04-27 16:15:01 +00:00
|
|
|
|
1999-02-21 19:55:22 +00:00
|
|
|
/** return the cell's column index (starting at 0 for the first column) */
|
1999-08-19 19:52:37 +00:00
|
|
|
virtual nsresult GetColIndex(PRInt32 &aColIndex) const;
|
2004-04-21 15:49:29 +00:00
|
|
|
void SetColIndex(PRInt32 aColIndex);
|
1998-04-23 17:29:07 +00:00
|
|
|
|
1998-07-11 00:00:31 +00:00
|
|
|
/** return the available width given to this frame during its last reflow */
|
2007-01-23 04:06:56 +00:00
|
|
|
inline nscoord GetPriorAvailWidth();
|
2010-04-27 16:15:01 +00:00
|
|
|
|
1998-07-11 00:00:31 +00:00
|
|
|
/** set the available width given to this frame during its last reflow */
|
2007-01-23 04:06:56 +00:00
|
|
|
inline void SetPriorAvailWidth(nscoord aPriorAvailWidth);
|
1998-07-02 17:40:56 +00:00
|
|
|
|
1998-07-11 00:00:31 +00:00
|
|
|
/** return the desired size returned by this frame during its last reflow */
|
2007-01-23 04:06:56 +00:00
|
|
|
inline nsSize GetDesiredSize();
|
1998-07-11 00:00:31 +00:00
|
|
|
|
|
|
|
/** set the desired size returned by this frame during its last reflow */
|
2007-01-23 04:06:56 +00:00
|
|
|
inline void SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize);
|
1998-07-11 00:00:31 +00:00
|
|
|
|
1998-12-10 19:57:42 +00:00
|
|
|
PRBool GetContentEmpty();
|
|
|
|
void SetContentEmpty(PRBool aContentEmpty);
|
|
|
|
|
2001-11-28 00:50:08 +00:00
|
|
|
PRBool HasPctOverHeight();
|
|
|
|
void SetHasPctOverHeight(PRBool aValue);
|
|
|
|
|
2001-11-05 00:15:51 +00:00
|
|
|
nsTableCellFrame* GetNextCell() const;
|
|
|
|
|
2007-02-07 07:46:44 +00:00
|
|
|
virtual nsMargin* GetBorderWidth(nsMargin& aBorder) const;
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
virtual void PaintBackground(nsRenderingContext& aRenderingContext,
|
2006-01-26 02:29:17 +00:00
|
|
|
const nsRect& aDirtyRect,
|
2009-09-12 22:44:18 +00:00
|
|
|
nsPoint aPt,
|
|
|
|
PRUint32 aFlags);
|
2006-01-26 02:29:17 +00:00
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
void DecorateForSelection(nsRenderingContext& aRenderingContext,
|
2006-01-26 02:29:17 +00:00
|
|
|
nsPoint aPt);
|
2010-04-27 16:15:01 +00:00
|
|
|
|
1998-10-20 17:45:07 +00:00
|
|
|
protected:
|
|
|
|
/** implement abstract method on nsHTMLContainerFrame */
|
|
|
|
virtual PRIntn GetSkipSides() const;
|
|
|
|
|
2005-03-18 02:15:44 +00:00
|
|
|
/**
|
2010-10-07 04:25:46 +00:00
|
|
|
* GetBorderOverflow says how far the cell's own borders extend
|
|
|
|
* outside its own bounds. In the separated borders model this should
|
|
|
|
* just be zero (as it is for most frames), but in the collapsed
|
2005-03-18 02:15:44 +00:00
|
|
|
* borders model (for which nsBCTableCellFrame overrides this virtual
|
2010-10-07 04:25:46 +00:00
|
|
|
* method), it considers the extents of the collapsed border.
|
2005-03-18 02:15:44 +00:00
|
|
|
*/
|
2010-10-07 04:25:46 +00:00
|
|
|
virtual nsMargin GetBorderOverflow();
|
2005-03-18 02:15:44 +00:00
|
|
|
|
2000-11-15 16:01:26 +00:00
|
|
|
friend class nsTableRowFrame;
|
1999-01-03 19:22:40 +00:00
|
|
|
|
2010-04-27 16:15:01 +00:00
|
|
|
PRUint32 mColIndex; // the starting column for this cell
|
1998-07-02 17:40:56 +00:00
|
|
|
|
2001-11-30 15:05:51 +00:00
|
|
|
nscoord mPriorAvailWidth; // the avail width during the last reflow
|
|
|
|
nsSize mDesiredSize; // the last desired width & height
|
1998-12-21 06:38:18 +00:00
|
|
|
};
|
1998-06-11 00:13:18 +00:00
|
|
|
|
1998-07-02 17:40:56 +00:00
|
|
|
inline nscoord nsTableCellFrame::GetPriorAvailWidth()
|
|
|
|
{ return mPriorAvailWidth;}
|
|
|
|
|
|
|
|
inline void nsTableCellFrame::SetPriorAvailWidth(nscoord aPriorAvailWidth)
|
|
|
|
{ mPriorAvailWidth = aPriorAvailWidth;}
|
|
|
|
|
1998-07-11 00:00:31 +00:00
|
|
|
inline nsSize nsTableCellFrame::GetDesiredSize()
|
|
|
|
{ return mDesiredSize; }
|
|
|
|
|
1998-10-01 04:46:11 +00:00
|
|
|
inline void nsTableCellFrame::SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize)
|
2010-04-27 16:15:01 +00:00
|
|
|
{
|
1998-07-11 00:00:31 +00:00
|
|
|
mDesiredSize.width = aDesiredSize.width;
|
|
|
|
mDesiredSize.height = aDesiredSize.height;
|
|
|
|
}
|
|
|
|
|
1999-10-08 18:52:19 +00:00
|
|
|
inline PRBool nsTableCellFrame::GetContentEmpty()
|
|
|
|
{
|
2001-11-05 00:15:51 +00:00
|
|
|
return (mState & NS_TABLE_CELL_CONTENT_EMPTY) ==
|
|
|
|
NS_TABLE_CELL_CONTENT_EMPTY;
|
1999-10-08 18:52:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableCellFrame::SetContentEmpty(PRBool aContentEmpty)
|
|
|
|
{
|
1999-10-15 03:14:59 +00:00
|
|
|
if (aContentEmpty) {
|
2001-11-05 00:15:51 +00:00
|
|
|
mState |= NS_TABLE_CELL_CONTENT_EMPTY;
|
1999-10-15 03:14:59 +00:00
|
|
|
} else {
|
2001-11-05 00:15:51 +00:00
|
|
|
mState &= ~NS_TABLE_CELL_CONTENT_EMPTY;
|
1999-10-15 03:14:59 +00:00
|
|
|
}
|
1999-10-08 18:52:19 +00:00
|
|
|
}
|
|
|
|
|
2001-11-28 00:50:08 +00:00
|
|
|
inline PRBool nsTableCellFrame::HasPctOverHeight()
|
|
|
|
{
|
2001-12-07 14:51:12 +00:00
|
|
|
return (mState & NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT) ==
|
|
|
|
NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT;
|
2001-11-28 00:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsTableCellFrame::SetHasPctOverHeight(PRBool aValue)
|
|
|
|
{
|
|
|
|
if (aValue) {
|
2001-12-07 14:51:12 +00:00
|
|
|
mState |= NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT;
|
2001-11-28 00:50:08 +00:00
|
|
|
} else {
|
2001-12-07 14:51:12 +00:00
|
|
|
mState &= ~NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT;
|
2001-11-28 00:50:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
// nsBCTableCellFrame
|
|
|
|
class nsBCTableCellFrame : public nsTableCellFrame
|
|
|
|
{
|
|
|
|
public:
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsBCTableCellFrame(nsStyleContext* aContext);
|
2002-02-19 15:48:28 +00:00
|
|
|
|
|
|
|
~nsBCTableCellFrame();
|
|
|
|
|
2003-10-31 20:19:18 +00:00
|
|
|
virtual nsIAtom* GetType() const;
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2006-12-13 23:04:57 +00:00
|
|
|
virtual nsMargin GetUsedBorder() const;
|
2010-09-07 22:20:35 +00:00
|
|
|
virtual PRBool GetBorderRadii(nscoord aRadii[8]) const;
|
2006-12-13 23:04:57 +00:00
|
|
|
|
2005-04-07 18:04:38 +00:00
|
|
|
// Get the *inner half of the border only*, in twips.
|
2007-02-07 07:46:44 +00:00
|
|
|
virtual nsMargin* GetBorderWidth(nsMargin& aBorder) const;
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2005-04-07 18:04:38 +00:00
|
|
|
// Get the *inner half of the border only*, in pixels.
|
2010-04-27 16:15:02 +00:00
|
|
|
BCPixelSize GetBorderWidth(mozilla::css::Side aSide) const;
|
2005-04-07 18:04:38 +00:00
|
|
|
|
|
|
|
// Set the full (both halves) width of the border
|
2010-04-27 16:15:02 +00:00
|
|
|
void SetBorderWidth(mozilla::css::Side aSide, BCPixelSize aPixelValue);
|
2002-02-19 15:48:28 +00:00
|
|
|
|
2010-10-07 04:25:46 +00:00
|
|
|
virtual nsMargin GetBorderOverflow();
|
2005-03-18 02:15:44 +00:00
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
|
|
|
#endif
|
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
virtual void PaintBackground(nsRenderingContext& aRenderingContext,
|
2006-01-26 02:29:17 +00:00
|
|
|
const nsRect& aDirtyRect,
|
2009-09-12 22:44:18 +00:00
|
|
|
nsPoint aPt,
|
|
|
|
PRUint32 aFlags);
|
2002-03-07 15:23:08 +00:00
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
private:
|
2010-04-27 16:15:01 +00:00
|
|
|
|
2005-04-07 18:04:38 +00:00
|
|
|
// These are the entire width of the border (the cell edge contains only
|
|
|
|
// the inner half, per the macros in nsTablePainter.h).
|
|
|
|
BCPixelSize mTopBorder;
|
|
|
|
BCPixelSize mRightBorder;
|
|
|
|
BCPixelSize mBottomBorder;
|
|
|
|
BCPixelSize mLeftBorder;
|
2002-02-19 15:48:28 +00:00
|
|
|
};
|
|
|
|
|
1998-10-14 22:23:26 +00:00
|
|
|
#endif
|