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
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
// vim:cindent:ts=4:et:sw=4:
|
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-30 21:57:09 +04: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 08:38:33 +03:00
|
|
|
/*
|
2015-04-19 02:01:24 +03:00
|
|
|
* Web-compatible algorithms that determine column and table isizes,
|
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 for CSS2's 'table-layout: auto'.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BasicTableLayoutStrategy_h_
|
|
|
|
#define BasicTableLayoutStrategy_h_
|
1998-04-30 21:57:09 +04:00
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
1998-04-30 21:57:09 +04:00
|
|
|
#include "nsITableLayoutStrategy.h"
|
|
|
|
|
|
|
|
class nsTableFrame;
|
|
|
|
|
|
|
|
class BasicTableLayoutStrategy : public nsITableLayoutStrategy
|
|
|
|
{
|
|
|
|
public:
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit BasicTableLayoutStrategy(nsTableFrame *aTableFrame);
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
virtual ~BasicTableLayoutStrategy();
|
|
|
|
|
|
|
|
// nsITableLayoutStrategy implementation
|
2017-06-09 22:14:53 +03:00
|
|
|
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
|
|
|
virtual nscoord GetPrefISize(gfxContext* aRenderingContext,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aComputingSize) override;
|
|
|
|
virtual void MarkIntrinsicISizesDirty() override;
|
2016-07-21 13:36:39 +03:00
|
|
|
virtual void ComputeColumnISizes(const ReflowInput& aReflowInput) 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
|
|
|
|
|
|
|
private:
|
2015-04-17 21:42:05 +03:00
|
|
|
// NOTE: Using prefix "BTLS" to avoid overlapping names with
|
2014-07-24 21:03:26 +04:00
|
|
|
// the values of nsLayoutUtils::IntrinsicISizeType
|
2015-06-16 17:45:46 +03:00
|
|
|
enum BtlsISizeType { BTLS_MIN_ISIZE,
|
|
|
|
BTLS_PREF_ISIZE,
|
|
|
|
BTLS_FINAL_ISIZE };
|
2008-01-18 07:18:21 +03:00
|
|
|
|
2015-06-16 17:45:46 +03:00
|
|
|
// Compute intrinsic isize member variables on the columns.
|
2017-06-09 22:14:53 +03:00
|
|
|
void ComputeColumnIntrinsicISizes(gfxContext* 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 08:38:33 +03:00
|
|
|
|
2015-06-16 17:45:46 +03:00
|
|
|
// Distribute a colspanning cell's percent isize (if any) to its columns.
|
|
|
|
void DistributePctISizeToColumns(float aSpanPrefPct,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aFirstCol,
|
|
|
|
int32_t aColCount);
|
2008-01-18 07:18:21 +03:00
|
|
|
|
2015-06-16 17:45:46 +03:00
|
|
|
// Distribute an isize of some BltsISizeType type to a set of columns.
|
|
|
|
// aISize: The amount of isize to be distributed
|
2008-01-18 07:18:21 +03:00
|
|
|
// aFirstCol: The index (in the table) of the first column to be
|
2015-06-16 17:45:46 +03:00
|
|
|
// considered for receiving isize
|
2008-01-18 07:18:21 +03:00
|
|
|
// aColCount: The number of consecutive columns (starting with aFirstCol)
|
2015-06-16 17:45:46 +03:00
|
|
|
// to be considered for receiving isize
|
|
|
|
// aISizeType: The type of isize being distributed. (BTLS_MIN_ISIZE and
|
|
|
|
// BTLS_PREF_ISIZE are intended to be used for dividing up
|
|
|
|
// colspan's min & pref isize. BTLS_FINAL_ISIZE is intended
|
|
|
|
// to be used for distributing the table's final isize across
|
2008-01-18 07:18:21 +03:00
|
|
|
// all its columns)
|
2015-06-16 17:45:46 +03:00
|
|
|
// aSpanHasSpecifiedISize: Should be true iff:
|
2008-01-18 07:18:21 +03:00
|
|
|
// - We're distributing a colspanning cell's
|
2015-06-16 17:45:46 +03:00
|
|
|
// pref or min isize to its columns
|
|
|
|
// - The colspanning cell has a specified isize.
|
|
|
|
void DistributeISizeToColumns(nscoord aISize,
|
2015-04-17 21:42:05 +03:00
|
|
|
int32_t aFirstCol,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aColCount,
|
2015-06-16 17:45:46 +03:00
|
|
|
BtlsISizeType aISizeType,
|
|
|
|
bool aSpanHasSpecifiedISize);
|
2015-04-17 21:42:05 +03:00
|
|
|
|
2008-01-18 07:18:21 +03:00
|
|
|
|
2015-06-16 17:45:46 +03:00
|
|
|
// Compute the min and pref isizes of the table from the isize
|
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
|
|
|
// variables on the columns.
|
2017-06-09 22:14:53 +03:00
|
|
|
void ComputeIntrinsicISizes(gfxContext* 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 08:38:33 +03:00
|
|
|
|
|
|
|
nsTableFrame *mTableFrame;
|
2015-06-16 17:45:46 +03:00
|
|
|
nscoord mMinISize;
|
|
|
|
nscoord mPrefISize;
|
|
|
|
nscoord mPrefISizePctExpand;
|
|
|
|
nscoord mLastCalcISize;
|
1998-04-30 21:57:09 +04:00
|
|
|
};
|
1998-05-09 01:12:12 +04: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 08:38:33 +03:00
|
|
|
#endif /* !defined(BasicTableLayoutStrategy_h_) */
|