2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsTableCellFrame_h__
|
|
|
|
#define nsTableCellFrame_h__
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-08-08 17:05:17 +04:00
|
|
|
#include "celldata.h"
|
1999-02-11 04:16:28 +03:00
|
|
|
#include "nsITableCellLayout.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nscore.h"
|
2011-12-28 00:18:48 +04:00
|
|
|
#include "nsContainerFrame.h"
|
2003-02-22 03:32:13 +03:00
|
|
|
#include "nsStyleContext.h"
|
2001-12-07 17:51:12 +03:00
|
|
|
#include "nsIPercentHeightObserver.h"
|
2007-01-30 03:06:41 +03: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 08:38:33 +03:00
|
|
|
#include "nsLayoutUtils.h"
|
2009-02-05 12:09:50 +03:00
|
|
|
#include "nsTArray.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-11-11 22:56:02 +03:00
|
|
|
class nsTableFrame;
|
1998-06-24 03:23:21 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* nsTableCellFrame
|
|
|
|
* data structure to maintain information about a single table cell's frame
|
|
|
|
*
|
1999-02-11 04:16:28 +03: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-14 00:24:54 +04:00
|
|
|
* @author sclark
|
|
|
|
*/
|
2011-12-28 00:18:48 +04:00
|
|
|
class nsTableCellFrame : public nsContainerFrame,
|
2010-04-27 20:15:01 +04:00
|
|
|
public nsITableCellLayout,
|
2001-12-07 17:51:12 +03:00
|
|
|
public nsIPercentHeightObserver
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsTableCellFrame)
|
2009-01-12 22:20:59 +03:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
1999-02-11 04:16:28 +03:00
|
|
|
|
1999-10-08 22:52:19 +04:00
|
|
|
// default constructor supplied by the compiler
|
1998-12-03 23:19:01 +03:00
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
nsTableCellFrame(nsStyleContext* aContext);
|
1999-10-17 07:30:11 +04:00
|
|
|
~nsTableCellFrame();
|
|
|
|
|
2013-03-20 05:47:48 +04:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
1999-02-25 08:31:15 +03:00
|
|
|
|
2001-08-17 07:13:07 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2012-09-29 01:53:44 +04:00
|
|
|
virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
|
2001-08-17 07:13:07 +04:00
|
|
|
#endif
|
2001-05-18 03:52:32 +04:00
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2000-01-04 08:31:56 +03:00
|
|
|
|
2008-10-26 13:11:34 +03:00
|
|
|
/** @see nsIFrame::DidSetStyleContext */
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2009-01-04 22:52:38 +03:00
|
|
|
// table cells contain a block frame which does most of the work, and
|
1999-08-02 02:21:03 +04:00
|
|
|
// so these functions should never be called. They assert and return
|
|
|
|
// NS_ERROR_NOT_IMPLEMENTED
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult AppendFrames(ChildListID aListID,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsFrameList& aFrameList) MOZ_OVERRIDE;
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult InsertFrames(ChildListID aListID,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsFrameList& aFrameList) MOZ_OVERRIDE;
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult RemoveFrame(ChildListID aListID,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsIFrame* aOldFrame) MOZ_OVERRIDE;
|
1999-08-02 02:21:03 +04:00
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE {
|
2011-08-25 00:54:30 +04:00
|
|
|
return GetFirstPrincipalChild()->GetContentInsertionFrame();
|
2004-07-18 16:02:53 +04:00
|
|
|
}
|
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual nsMargin GetUsedMargin() const MOZ_OVERRIDE;
|
2006-12-14 02:04:57 +03:00
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) MOZ_OVERRIDE;
|
2001-12-07 17:51:12 +03:00
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual bool NeedsToObserve(const nsHTMLReflowState& aReflowState) MOZ_OVERRIDE;
|
1998-12-21 09:38:18 +03:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
/** instantiate a new instance of nsTableRowFrame.
|
|
|
|
* @param aPresShell the pres shell for this frame
|
1998-09-15 21:58:24 +04:00
|
|
|
*
|
2005-11-04 05:38:33 +03:00
|
|
|
* @return the frame that was created
|
1998-09-15 21:58:24 +04:00
|
|
|
*/
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2011-04-08 05:04:40 +04:00
|
|
|
void PaintCellBackground(nsRenderingContext& aRenderingContext,
|
2009-09-13 02:44:18 +04:00
|
|
|
const nsRect& aDirtyRect, nsPoint aPt,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aFlags);
|
2000-03-22 05:43:08 +03:00
|
|
|
|
2013-12-13 21:42:43 +04:00
|
|
|
|
|
|
|
virtual nsresult ProcessBorders(nsTableFrame* aFrame,
|
|
|
|
nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsDisplayListSet& aLists);
|
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
2006-12-17 17:06:42 +03:00
|
|
|
virtual IntrinsicWidthOffsetData
|
2013-05-14 20:33:23 +04:00
|
|
|
IntrinsicWidthOffsets(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
|
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
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult Reflow(nsPresContext* aPresContext,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-02-24 08:54:31 +03:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsLayoutAtoms::tableCellFrame
|
|
|
|
*/
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
1999-02-24 08:54:31 +03:00
|
|
|
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
1999-09-01 05:02:16 +04:00
|
|
|
#endif
|
1999-08-31 07:09:40 +04:00
|
|
|
|
2007-01-28 01:22:24 +03:00
|
|
|
void VerticallyAlignChild(nscoord aMaxAscent);
|
2000-06-05 12:25:11 +04:00
|
|
|
|
2010-08-31 20:05:12 +04: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}.
|
|
|
|
*/
|
2013-12-13 21:42:43 +04:00
|
|
|
virtual uint8_t GetVerticalAlign() const;
|
2010-08-31 20:05:12 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool HasVerticalAlignBaseline() const {
|
2010-08-31 20:05:12 +04:00
|
|
|
return GetVerticalAlign() == NS_STYLE_VERTICAL_ALIGN_BASELINE;
|
|
|
|
}
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool CellHasVisibleContent(nscoord height,
|
2008-09-13 18:38:29 +04:00
|
|
|
nsTableFrame* tableFrame,
|
|
|
|
nsIFrame* kidFrame);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2007-01-23 07:06:56 +03: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 22:55:22 +03: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()
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual int32_t GetRowSpan();
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
// there is no set row index because row index depends on the cell's parent row only
|
|
|
|
|
1999-08-01 20:20:14 +04:00
|
|
|
/*---------------- nsITableCellLayout methods ------------------------*/
|
|
|
|
|
1999-02-21 22:55:22 +03: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 06:04:45 +04:00
|
|
|
* and the column index (starting at 0 for the first column
|
1999-02-21 22:55:22 +03:00
|
|
|
*/
|
2013-05-14 20:33:23 +04:00
|
|
|
NS_IMETHOD GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex) MOZ_OVERRIDE;
|
1999-08-04 06:04:45 +04:00
|
|
|
|
|
|
|
/** return the mapped cell's row index (starting at 0 for the first row) */
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsresult GetRowIndex(int32_t &aRowIndex) const MOZ_OVERRIDE;
|
1998-07-11 04:00:31 +04:00
|
|
|
|
1999-02-21 22:55:22 +03: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()
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual int32_t GetColSpan();
|
2010-04-27 20:15:01 +04:00
|
|
|
|
1999-02-21 22:55:22 +03:00
|
|
|
/** return the cell's column index (starting at 0 for the first column) */
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsresult GetColIndex(int32_t &aColIndex) const MOZ_OVERRIDE;
|
2012-08-22 19:56:38 +04:00
|
|
|
void SetColIndex(int32_t aColIndex);
|
1998-04-23 21:29:07 +04:00
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
/** return the available width given to this frame during its last reflow */
|
2007-01-23 07:06:56 +03:00
|
|
|
inline nscoord GetPriorAvailWidth();
|
2010-04-27 20:15:01 +04:00
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
/** set the available width given to this frame during its last reflow */
|
2007-01-23 07:06:56 +03:00
|
|
|
inline void SetPriorAvailWidth(nscoord aPriorAvailWidth);
|
1998-07-02 21:40:56 +04:00
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
/** return the desired size returned by this frame during its last reflow */
|
2007-01-23 07:06:56 +03:00
|
|
|
inline nsSize GetDesiredSize();
|
1998-07-11 04:00:31 +04:00
|
|
|
|
|
|
|
/** set the desired size returned by this frame during its last reflow */
|
2007-01-23 07:06:56 +03:00
|
|
|
inline void SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize);
|
1998-07-11 04:00:31 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetContentEmpty();
|
|
|
|
void SetContentEmpty(bool aContentEmpty);
|
1998-12-10 22:57:42 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool HasPctOverHeight();
|
|
|
|
void SetHasPctOverHeight(bool aValue);
|
2001-11-28 03:50:08 +03:00
|
|
|
|
2001-11-05 03:15:51 +03:00
|
|
|
nsTableCellFrame* GetNextCell() const;
|
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
virtual nsMargin* GetBorderWidth(nsMargin& aBorder) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2011-04-08 05:04:40 +04:00
|
|
|
virtual void PaintBackground(nsRenderingContext& aRenderingContext,
|
2006-01-26 05:29:17 +03:00
|
|
|
const nsRect& aDirtyRect,
|
2009-09-13 02:44:18 +04:00
|
|
|
nsPoint aPt,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aFlags);
|
2006-01-26 05:29:17 +03:00
|
|
|
|
2011-04-08 05:04:40 +04:00
|
|
|
void DecorateForSelection(nsRenderingContext& aRenderingContext,
|
2006-01-26 05:29:17 +03:00
|
|
|
nsPoint aPt);
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual bool UpdateOverflow() MOZ_OVERRIDE;
|
2013-03-08 06:18:45 +04:00
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2013-03-08 06:18:45 +04:00
|
|
|
{
|
|
|
|
return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart));
|
|
|
|
}
|
2012-08-29 09:39:31 +04:00
|
|
|
|
2012-08-29 09:48:45 +04:00
|
|
|
virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
|
|
|
|
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
|
|
|
|
virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); }
|
2011-06-16 01:03:49 +04:00
|
|
|
|
1998-10-20 21:45:07 +04:00
|
|
|
protected:
|
2013-07-25 19:34:27 +04:00
|
|
|
virtual int GetSkipSides(const nsHTMLReflowState* aReflowState= nullptr) const MOZ_OVERRIDE;
|
1998-10-20 21:45:07 +04:00
|
|
|
|
2005-03-18 05:15:44 +03:00
|
|
|
/**
|
2010-10-07 08:25:46 +04: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 05:15:44 +03:00
|
|
|
* borders model (for which nsBCTableCellFrame overrides this virtual
|
2010-10-07 08:25:46 +04:00
|
|
|
* method), it considers the extents of the collapsed border.
|
2005-03-18 05:15:44 +03:00
|
|
|
*/
|
2010-10-07 08:25:46 +04:00
|
|
|
virtual nsMargin GetBorderOverflow();
|
2005-03-18 05:15:44 +03:00
|
|
|
|
2000-11-15 19:01:26 +03:00
|
|
|
friend class nsTableRowFrame;
|
1999-01-03 22:22:40 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mColIndex; // the starting column for this cell
|
1998-07-02 21:40:56 +04:00
|
|
|
|
2001-11-30 18:05:51 +03:00
|
|
|
nscoord mPriorAvailWidth; // the avail width during the last reflow
|
|
|
|
nsSize mDesiredSize; // the last desired width & height
|
1998-12-21 09:38:18 +03:00
|
|
|
};
|
1998-06-11 04:13:18 +04:00
|
|
|
|
1998-07-02 21:40:56 +04:00
|
|
|
inline nscoord nsTableCellFrame::GetPriorAvailWidth()
|
|
|
|
{ return mPriorAvailWidth;}
|
|
|
|
|
|
|
|
inline void nsTableCellFrame::SetPriorAvailWidth(nscoord aPriorAvailWidth)
|
|
|
|
{ mPriorAvailWidth = aPriorAvailWidth;}
|
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
inline nsSize nsTableCellFrame::GetDesiredSize()
|
|
|
|
{ return mDesiredSize; }
|
|
|
|
|
1998-10-01 08:46:11 +04:00
|
|
|
inline void nsTableCellFrame::SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize)
|
2010-04-27 20:15:01 +04:00
|
|
|
{
|
2013-12-27 21:59:52 +04:00
|
|
|
mDesiredSize.width = aDesiredSize.Width();
|
|
|
|
mDesiredSize.height = aDesiredSize.Height();
|
1998-07-11 04:00:31 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool nsTableCellFrame::GetContentEmpty()
|
1999-10-08 22:52:19 +04:00
|
|
|
{
|
2001-11-05 03:15:51 +03:00
|
|
|
return (mState & NS_TABLE_CELL_CONTENT_EMPTY) ==
|
|
|
|
NS_TABLE_CELL_CONTENT_EMPTY;
|
1999-10-08 22:52:19 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline void nsTableCellFrame::SetContentEmpty(bool aContentEmpty)
|
1999-10-08 22:52:19 +04:00
|
|
|
{
|
1999-10-15 07:14:59 +04:00
|
|
|
if (aContentEmpty) {
|
2001-11-05 03:15:51 +03:00
|
|
|
mState |= NS_TABLE_CELL_CONTENT_EMPTY;
|
1999-10-15 07:14:59 +04:00
|
|
|
} else {
|
2001-11-05 03:15:51 +03:00
|
|
|
mState &= ~NS_TABLE_CELL_CONTENT_EMPTY;
|
1999-10-15 07:14:59 +04:00
|
|
|
}
|
1999-10-08 22:52:19 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool nsTableCellFrame::HasPctOverHeight()
|
2001-11-28 03:50:08 +03:00
|
|
|
{
|
2001-12-07 17:51:12 +03:00
|
|
|
return (mState & NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT) ==
|
|
|
|
NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT;
|
2001-11-28 03:50:08 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline void nsTableCellFrame::SetHasPctOverHeight(bool aValue)
|
2001-11-28 03:50:08 +03:00
|
|
|
{
|
|
|
|
if (aValue) {
|
2001-12-07 17:51:12 +03:00
|
|
|
mState |= NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT;
|
2001-11-28 03:50:08 +03:00
|
|
|
} else {
|
2001-12-07 17:51:12 +03:00
|
|
|
mState &= ~NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT;
|
2001-11-28 03:50:08 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
// nsBCTableCellFrame
|
|
|
|
class nsBCTableCellFrame : public nsTableCellFrame
|
|
|
|
{
|
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
nsBCTableCellFrame(nsStyleContext* aContext);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
|
|
|
~nsBCTableCellFrame();
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE;
|
|
|
|
virtual bool GetBorderRadii(nscoord aRadii[8]) const MOZ_OVERRIDE;
|
2006-12-14 02:04:57 +03:00
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
// Get the *inner half of the border only*, in twips.
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsMargin* GetBorderWidth(nsMargin& aBorder) const MOZ_OVERRIDE;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
// Get the *inner half of the border only*, in pixels.
|
2010-04-27 20:15:02 +04:00
|
|
|
BCPixelSize GetBorderWidth(mozilla::css::Side aSide) const;
|
2005-04-07 22:04:38 +04:00
|
|
|
|
|
|
|
// Set the full (both halves) width of the border
|
2010-04-27 20:15:02 +04:00
|
|
|
void SetBorderWidth(mozilla::css::Side aSide, BCPixelSize aPixelValue);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsMargin GetBorderOverflow() MOZ_OVERRIDE;
|
2005-03-18 05:15:44 +03:00
|
|
|
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
2002-02-19 18:48:28 +03:00
|
|
|
#endif
|
|
|
|
|
2011-04-08 05:04:40 +04:00
|
|
|
virtual void PaintBackground(nsRenderingContext& aRenderingContext,
|
2006-01-26 05:29:17 +03:00
|
|
|
const nsRect& aDirtyRect,
|
2009-09-13 02:44:18 +04:00
|
|
|
nsPoint aPt,
|
2012-09-14 20:10:08 +04:00
|
|
|
uint32_t aFlags) MOZ_OVERRIDE;
|
2002-03-07 18:23:08 +03:00
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
private:
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2005-04-07 22:04:38 +04: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 18:48:28 +03:00
|
|
|
};
|
|
|
|
|
1998-10-15 02:23:26 +04:00
|
|
|
#endif
|