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-05-30 02:08:19 +04:00
|
|
|
#ifndef nsTableColFrame_h__
|
|
|
|
#define nsTableColFrame_h__
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-08-08 17:05:17 +04:00
|
|
|
#include "celldata.h"
|
1998-05-30 02:08:19 +04:00
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsContainerFrame.h"
|
2009-02-05 12:09:50 +03:00
|
|
|
#include "nsTArray.h"
|
2015-04-30 07:24:59 +03:00
|
|
|
#include "nsTableColGroupFrame.h"
|
2015-04-30 07:24:59 +03:00
|
|
|
#include "mozilla/WritingModes.h"
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2017-04-30 18:30:08 +03:00
|
|
|
class nsTableColFrame final : public nsSplittableFrame
|
|
|
|
{
|
1998-05-30 02:08:19 +04:00
|
|
|
public:
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsTableColFrame)
|
1998-06-11 04:13:18 +04:00
|
|
|
|
1998-07-22 07:53:43 +04:00
|
|
|
enum {eWIDTH_SOURCE_NONE =0, // no cell has contributed to the width style
|
|
|
|
eWIDTH_SOURCE_CELL =1, // a cell specified a width
|
|
|
|
eWIDTH_SOURCE_CELL_WITH_SPAN=2 // a cell implicitly specified a width via colspan
|
|
|
|
};
|
|
|
|
|
2003-10-31 23:19:18 +03:00
|
|
|
nsTableColType GetColType() const;
|
|
|
|
void SetColType(nsTableColType aType);
|
1998-09-15 21:58:24 +04: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
|
|
|
*/
|
2007-11-18 21:56:49 +03:00
|
|
|
friend nsTableColFrame* NS_NewTableColFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
2015-04-30 07:24:59 +03:00
|
|
|
|
2017-02-28 20:58:30 +03:00
|
|
|
// nsIFrame overrides
|
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) override
|
2015-04-30 07:24:59 +03:00
|
|
|
{
|
2017-02-28 20:58:30 +03:00
|
|
|
nsSplittableFrame::Init(aContent, aParent, aPrevInFlow);
|
|
|
|
if (!aPrevInFlow) {
|
|
|
|
mWritingMode = GetTableFrame()->GetWritingMode();
|
|
|
|
}
|
2015-04-30 07:24:59 +03:00
|
|
|
}
|
|
|
|
|
2008-10-26 13:11:34 +03:00
|
|
|
/** @see nsIFrame::DidSetStyleContext */
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;
|
2015-04-17 21:42:05 +03:00
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
2016-07-21 13:36:38 +03:00
|
|
|
ReflowOutput& aDesiredSize,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsReflowStatus& aStatus) override;
|
1998-05-30 02:08:19 +04:00
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
2017-05-05 09:30:15 +03:00
|
|
|
const nsDisplayListSet& aLists) override;
|
2006-01-26 05:29:17 +03:00
|
|
|
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
1999-09-01 05:02:16 +04:00
|
|
|
#endif
|
1998-11-19 20:22:29 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsSplittableType GetSplittableType() const override;
|
2007-12-03 10:45:06 +03:00
|
|
|
|
2017-02-28 20:58:30 +03:00
|
|
|
nsTableColGroupFrame* GetTableColGroupFrame() const
|
|
|
|
{
|
|
|
|
nsIFrame* parent = GetParent();
|
2017-04-30 18:30:08 +03:00
|
|
|
MOZ_ASSERT(parent && parent->IsTableColGroupFrame());
|
2017-02-28 20:58:30 +03:00
|
|
|
return static_cast<nsTableColGroupFrame*>(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsTableFrame* GetTableFrame() const
|
|
|
|
{
|
|
|
|
return GetTableColGroupFrame()->GetTableFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t GetColIndex() const;
|
|
|
|
|
|
|
|
void SetColIndex (int32_t aColIndex);
|
|
|
|
|
|
|
|
nsTableColFrame* GetNextCol() const;
|
2015-04-30 07:24:59 +03:00
|
|
|
|
2007-11-18 21:56:49 +03:00
|
|
|
/** return the number of the columns the col represents. always >= 1 */
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetSpan();
|
1998-06-11 04:13:18 +04:00
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
/** convenience method, calls into cellmap */
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t Count() const;
|
1998-07-11 04:00:31 +04:00
|
|
|
|
2015-05-04 10:09:25 +03:00
|
|
|
nscoord GetIStartBorderWidth() const { return mIStartBorderWidth; }
|
|
|
|
nscoord GetIEndBorderWidth() const { return mIEndBorderWidth; }
|
|
|
|
void SetIStartBorderWidth(BCPixelSize aWidth) { mIStartBorderWidth = aWidth; }
|
|
|
|
void SetIEndBorderWidth(BCPixelSize aWidth) { mIEndBorderWidth = aWidth; }
|
2004-03-09 09:48:35 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets inner border widths before collapsing with cell borders
|
2015-06-24 19:56:54 +03:00
|
|
|
* Caller must get istart border from previous column or from table
|
|
|
|
* GetContinuousBCBorderWidth will not overwrite aBorder.IStart
|
2004-03-09 09:48:35 +03:00
|
|
|
* see nsTablePainter about continuous borders
|
|
|
|
*
|
2015-06-24 19:56:54 +03:00
|
|
|
* @return outer iend border width (istart inner for next column)
|
2004-03-09 09:48:35 +03:00
|
|
|
*/
|
2015-06-24 19:56:54 +03:00
|
|
|
nscoord GetContinuousBCBorderWidth(mozilla::WritingMode aWM,
|
|
|
|
mozilla::LogicalMargin& aBorder);
|
2004-03-09 09:48:35 +03:00
|
|
|
/**
|
|
|
|
* Set full border widths before collapsing with cell borders
|
2015-05-04 10:09:25 +03:00
|
|
|
* @param aForSide - side to set; only valid for bstart, iend, and bend
|
2004-03-09 09:48:35 +03:00
|
|
|
*/
|
2015-05-04 10:09:25 +03:00
|
|
|
void SetContinuousBCBorderWidth(mozilla::LogicalSide aForSide,
|
2004-03-09 09:48:35 +03:00
|
|
|
BCPixelSize aPixelValue);
|
2004-09-04 20:02:50 +04:00
|
|
|
#ifdef DEBUG
|
2012-08-22 19:56:38 +04:00
|
|
|
void Dump(int32_t aIndent);
|
2004-09-04 20:02:50 +04:00
|
|
|
#endif
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2007-03-19 23:26:36 +03:00
|
|
|
/**
|
|
|
|
* Restore the default values of the intrinsic widths, so that we can
|
|
|
|
* re-accumulate intrinsic widths from the cells in the column.
|
|
|
|
*/
|
|
|
|
void ResetIntrinsics() {
|
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
|
|
|
mMinCoord = 0;
|
2007-03-19 23:26:36 +03:00
|
|
|
mPrefCoord = 0;
|
|
|
|
mPrefPercent = 0.0f;
|
2011-10-17 18:59:28 +04:00
|
|
|
mHasSpecifiedCoord = false;
|
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
|
|
|
}
|
2007-03-19 23:26:36 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Restore the default value of the preferred percentage width (the
|
|
|
|
* only intrinsic width used by FixedTableLayoutStrategy.
|
|
|
|
*/
|
|
|
|
void ResetPrefPercent() {
|
|
|
|
mPrefPercent = 0.0f;
|
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
|
|
|
}
|
|
|
|
|
2007-03-19 23:26:36 +03:00
|
|
|
/**
|
|
|
|
* Restore the default values of the temporary buffer for
|
|
|
|
* spanning-cell intrinsic widths (as we process spanning cells).
|
|
|
|
*/
|
|
|
|
void ResetSpanIntrinsics() {
|
|
|
|
mSpanMinCoord = 0;
|
|
|
|
mSpanPrefCoord = 0;
|
|
|
|
mSpanPrefPercent = 0.0f;
|
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
|
|
|
}
|
2007-03-19 23:26:36 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add the widths for a cell or column element, or the contribution of
|
|
|
|
* the widths from a column-spanning cell:
|
|
|
|
* @param aMinCoord The minimum intrinsic width
|
|
|
|
* @param aPrefCoord The preferred intrinsic width or, if there is a
|
|
|
|
* specified non-percentage width, max(specified width, minimum intrinsic
|
|
|
|
* width).
|
|
|
|
* @param aHasSpecifiedCoord Whether there is a specified
|
|
|
|
* non-percentage width.
|
|
|
|
*
|
|
|
|
* Note that the implementation of this functions is a bit tricky
|
|
|
|
* since mPrefCoord means different things depending on
|
|
|
|
* whether mHasSpecifiedCoord is true (and likewise for aPrefCoord and
|
|
|
|
* aHasSpecifiedCoord). If mHasSpecifiedCoord is false, then
|
|
|
|
* all widths added had aHasSpecifiedCoord false and mPrefCoord is the
|
|
|
|
* largest of the pref widths. But if mHasSpecifiedCoord is true,
|
|
|
|
* then mPrefCoord is the largest of (1) the pref widths for cells
|
|
|
|
* with aHasSpecifiedCoord true and (2) the min widths for cells with
|
|
|
|
* aHasSpecifiedCoord false.
|
|
|
|
*/
|
|
|
|
void AddCoords(nscoord aMinCoord, nscoord aPrefCoord,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aHasSpecifiedCoord) {
|
2007-03-19 23:26:36 +03:00
|
|
|
NS_ASSERTION(aMinCoord <= aPrefCoord, "intrinsic widths out of order");
|
|
|
|
|
|
|
|
if (aHasSpecifiedCoord && !mHasSpecifiedCoord) {
|
|
|
|
mPrefCoord = mMinCoord;
|
2011-10-17 18:59:28 +04:00
|
|
|
mHasSpecifiedCoord = true;
|
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
|
|
|
}
|
2007-03-19 23:26:36 +03:00
|
|
|
if (!aHasSpecifiedCoord && mHasSpecifiedCoord) {
|
|
|
|
aPrefCoord = aMinCoord; // NOTE: modifying argument
|
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
|
|
|
}
|
|
|
|
|
2007-03-19 23:26:36 +03:00
|
|
|
if (aMinCoord > mMinCoord)
|
|
|
|
mMinCoord = aMinCoord;
|
|
|
|
if (aPrefCoord > mPrefCoord)
|
|
|
|
mPrefCoord = aPrefCoord;
|
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
|
|
|
|
2007-03-19 23:26:36 +03:00
|
|
|
NS_ASSERTION(mMinCoord <= mPrefCoord, "min larger than pref");
|
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
|
|
|
}
|
2007-03-19 23:26:36 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a percentage width specified on a cell or column element or the
|
|
|
|
* contribution to this column of a percentage width specified on a
|
|
|
|
* column-spanning cell.
|
|
|
|
*/
|
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
|
|
|
void AddPrefPercent(float aPrefPercent) {
|
|
|
|
if (aPrefPercent > mPrefPercent)
|
|
|
|
mPrefPercent = aPrefPercent;
|
|
|
|
}
|
|
|
|
|
2007-03-19 23:26:36 +03:00
|
|
|
/**
|
|
|
|
* Get the largest minimum intrinsic width for this column.
|
|
|
|
*/
|
|
|
|
nscoord GetMinCoord() const { return mMinCoord; }
|
|
|
|
/**
|
|
|
|
* Get the largest preferred width for this column, or, if there were
|
|
|
|
* any specified non-percentage widths (see GetHasSpecifiedCoord), the
|
|
|
|
* largest minimum intrinsic width or specified width.
|
|
|
|
*/
|
|
|
|
nscoord GetPrefCoord() const { return mPrefCoord; }
|
|
|
|
/**
|
|
|
|
* Get whether there were any specified widths contributing to this
|
|
|
|
* column.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetHasSpecifiedCoord() const { return mHasSpecifiedCoord; }
|
2007-03-19 23:26:36 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the largest specified percentage width contributing to this
|
|
|
|
* column (returns 0 if there were none).
|
|
|
|
*/
|
|
|
|
float GetPrefPercent() const { return mPrefPercent; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Like AddCoords, but into a temporary buffer used for groups of
|
|
|
|
* column-spanning cells.
|
|
|
|
*/
|
|
|
|
void AddSpanCoords(nscoord aSpanMinCoord, nscoord aSpanPrefCoord,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aSpanHasSpecifiedCoord) {
|
2007-03-19 23:26:36 +03:00
|
|
|
NS_ASSERTION(aSpanMinCoord <= aSpanPrefCoord,
|
|
|
|
"intrinsic widths out of order");
|
|
|
|
|
2008-01-18 07:18:21 +03:00
|
|
|
if (!aSpanHasSpecifiedCoord && mHasSpecifiedCoord) {
|
2007-03-19 23:26:36 +03:00
|
|
|
aSpanPrefCoord = aSpanMinCoord; // NOTE: modifying argument
|
|
|
|
}
|
|
|
|
|
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
|
|
|
if (aSpanMinCoord > mSpanMinCoord)
|
|
|
|
mSpanMinCoord = aSpanMinCoord;
|
|
|
|
if (aSpanPrefCoord > mSpanPrefCoord)
|
|
|
|
mSpanPrefCoord = aSpanPrefCoord;
|
|
|
|
|
2007-03-19 23:26:36 +03:00
|
|
|
NS_ASSERTION(mSpanMinCoord <= mSpanPrefCoord, "min larger than pref");
|
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
|
|
|
}
|
2007-03-19 23:26:36 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Accumulate percentage widths on column spanning cells into
|
|
|
|
* temporary variables.
|
|
|
|
*/
|
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
|
|
|
void AddSpanPrefPercent(float aSpanPrefPercent) {
|
|
|
|
if (aSpanPrefPercent > mSpanPrefPercent)
|
|
|
|
mSpanPrefPercent = aSpanPrefPercent;
|
|
|
|
}
|
2007-03-19 23:26:36 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Accumulate the temporary variables for column spanning cells into
|
|
|
|
* the primary variables.
|
|
|
|
*/
|
|
|
|
void AccumulateSpanIntrinsics() {
|
2008-01-18 07:18:21 +03:00
|
|
|
AddCoords(mSpanMinCoord, mSpanPrefCoord, mHasSpecifiedCoord);
|
2007-03-19 23:26:36 +03:00
|
|
|
AddPrefPercent(mSpanPrefPercent);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
// Used to adjust a column's pref percent so that the table's total
|
|
|
|
// never exceeeds 100% (by only allowing percentages to be used,
|
|
|
|
// starting at the first column, until they reach 100%).
|
|
|
|
void AdjustPrefPercent(float *aTableTotalPercent) {
|
|
|
|
float allowed = 1.0f - *aTableTotalPercent;
|
|
|
|
if (mPrefPercent > allowed)
|
|
|
|
mPrefPercent = allowed;
|
|
|
|
*aTableTotalPercent += mPrefPercent;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The final width of the column.
|
2015-04-19 02:01:26 +03:00
|
|
|
void ResetFinalISize() {
|
|
|
|
mFinalISize = nscoord_MIN; // so we detect that it changed
|
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
|
|
|
}
|
2015-04-19 02:01:26 +03:00
|
|
|
void SetFinalISize(nscoord aFinalISize) {
|
|
|
|
mFinalISize = aFinalISize;
|
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
|
|
|
}
|
2015-04-19 02:01:26 +03:00
|
|
|
nscoord GetFinalISize() {
|
|
|
|
return mFinalISize;
|
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
|
|
|
}
|
2013-03-08 06:18:45 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const override
|
2013-03-08 06:18:45 +04:00
|
|
|
{
|
|
|
|
return nsSplittableFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart));
|
|
|
|
}
|
2015-04-17 21:42:05 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) override;
|
|
|
|
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override;
|
|
|
|
virtual void InvalidateFrameForRemoval() override { InvalidateFrameSubtree(); }
|
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
|
|
|
|
1998-05-30 02:08:19 +04:00
|
|
|
protected:
|
|
|
|
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit nsTableColFrame(nsStyleContext* aContext);
|
1999-07-28 12:09:02 +04:00
|
|
|
~nsTableColFrame();
|
1998-05-30 02:08:19 +04:00
|
|
|
|
2009-05-12 14:13:09 +04:00
|
|
|
nscoord mMinCoord;
|
|
|
|
nscoord mPrefCoord;
|
|
|
|
nscoord mSpanMinCoord; // XXX...
|
|
|
|
nscoord mSpanPrefCoord; // XXX...
|
|
|
|
float mPrefPercent;
|
|
|
|
float mSpanPrefPercent; // XXX...
|
|
|
|
// ...XXX the four members marked above could be allocated as part of
|
|
|
|
// a separate array allocated only during
|
2014-07-24 21:03:26 +04:00
|
|
|
// BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes (and only
|
2009-05-12 14:13:09 +04:00
|
|
|
// when colspans were present).
|
2015-04-19 02:01:26 +03:00
|
|
|
nscoord mFinalISize;
|
2009-05-12 14:13:09 +04:00
|
|
|
|
2015-04-17 21:42:05 +03:00
|
|
|
// the index of the column with respect to the whole table (starting at 0)
|
|
|
|
// it should never be smaller then the start column index of the parent
|
2005-09-12 17:44:15 +04:00
|
|
|
// colgroup
|
2012-12-10 21:40:01 +04:00
|
|
|
uint32_t mColIndex;
|
2015-04-17 21:42:05 +03:00
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
// border width in pixels of the inner half of the border only
|
2015-05-04 10:09:25 +03:00
|
|
|
BCPixelSize mIStartBorderWidth;
|
|
|
|
BCPixelSize mIEndBorderWidth;
|
|
|
|
BCPixelSize mBStartContBorderWidth;
|
|
|
|
BCPixelSize mIEndContBorderWidth;
|
|
|
|
BCPixelSize mBEndContBorderWidth;
|
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
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mHasSpecifiedCoord;
|
1998-05-30 02:08:19 +04:00
|
|
|
};
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline int32_t nsTableColFrame::GetColIndex() const
|
2004-03-09 09:48:35 +03:00
|
|
|
{
|
2015-04-17 21:42:05 +03:00
|
|
|
return mColIndex;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
1998-06-11 04:13:18 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline void nsTableColFrame::SetColIndex (int32_t aColIndex)
|
2015-04-17 21:42:05 +03:00
|
|
|
{
|
|
|
|
mColIndex = aColIndex;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2004-03-09 09:48:35 +03:00
|
|
|
inline nscoord
|
2015-06-24 19:56:54 +03:00
|
|
|
nsTableColFrame::GetContinuousBCBorderWidth(mozilla::WritingMode aWM,
|
|
|
|
mozilla::LogicalMargin& aBorder)
|
2004-03-09 09:48:35 +03:00
|
|
|
{
|
2017-09-13 02:48:00 +03:00
|
|
|
int32_t d2a = PresContext()->AppUnitsPerDevPixel();
|
|
|
|
aBorder.BStart(aWM) = BC_BORDER_END_HALF_COORD(d2a,
|
2015-06-24 19:56:54 +03:00
|
|
|
mBStartContBorderWidth);
|
2017-09-13 02:48:00 +03:00
|
|
|
aBorder.IEnd(aWM) = BC_BORDER_START_HALF_COORD(d2a,
|
2015-06-24 19:56:54 +03:00
|
|
|
mIEndContBorderWidth);
|
2017-09-13 02:48:00 +03:00
|
|
|
aBorder.BEnd(aWM) = BC_BORDER_START_HALF_COORD(d2a,
|
2015-06-24 19:56:54 +03:00
|
|
|
mBEndContBorderWidth);
|
2017-09-13 02:48:00 +03:00
|
|
|
return BC_BORDER_END_HALF_COORD(d2a, mIEndContBorderWidth);
|
2004-03-09 09:48:35 +03:00
|
|
|
}
|
|
|
|
|
1998-05-30 02:08:19 +04:00
|
|
|
#endif
|
|
|
|
|