2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:30:37 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-09-15 04:19:49 +04:00
|
|
|
*
|
2004-04-18 18:30:37 +04: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-09-15 04:19:49 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04: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-09-15 04:19:49 +04:00
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
2000-04-17 18:40:46 +04:00
|
|
|
* Steve Clark <buster@netscape.com>
|
|
|
|
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
2003-01-02 02:53:20 +03:00
|
|
|
* L. David Baron <dbaron@dbaron.org>
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:30:37 +04: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-29 00:14:13 +04: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 18:30:37 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04: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 18:30:37 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-03-23 07:28:20 +03:00
|
|
|
|
2006-03-29 22:29:03 +04:00
|
|
|
/* state used in reflow of block frames */
|
|
|
|
|
2001-05-01 08:22:57 +04:00
|
|
|
#ifndef nsBlockReflowState_h__
|
|
|
|
#define nsBlockReflowState_h__
|
|
|
|
|
2009-01-05 03:39:54 +03:00
|
|
|
#include "nsFloatManager.h"
|
2001-05-01 08:22:57 +04:00
|
|
|
#include "nsLineBox.h"
|
2002-05-29 02:50:43 +04:00
|
|
|
#include "nsFrameList.h"
|
2008-04-15 05:05:17 +04:00
|
|
|
#include "nsBlockFrame.h"
|
2001-08-01 05:27:50 +04:00
|
|
|
|
2005-04-26 06:26:12 +04:00
|
|
|
// block reflow state flags
|
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
|
|
|
#define BRS_UNCONSTRAINEDHEIGHT 0x00000001
|
|
|
|
#define BRS_ISTOPMARGINROOT 0x00000002 // Is this frame a root for top/bottom margin collapsing?
|
|
|
|
#define BRS_ISBOTTOMMARGINROOT 0x00000004
|
|
|
|
#define BRS_APPLYTOPMARGIN 0x00000008 // See ShouldApplyTopMargin
|
|
|
|
#define BRS_ISFIRSTINFLOW 0x00000010
|
2006-02-27 07:15:05 +03:00
|
|
|
// Set when mLineAdjacentToTop is valid
|
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
|
|
|
#define BRS_HAVELINEADJACENTTOTOP 0x00000020
|
2009-01-05 03:39:54 +03:00
|
|
|
// Set when the block has the equivalent of NS_BLOCK_FLOAT_MGR
|
|
|
|
#define BRS_FLOAT_MGR 0x00000040
|
2008-11-27 21:44:47 +03:00
|
|
|
// Set when nsLineLayout::LineIsEmpty was true at the end of reflowing
|
|
|
|
// the current line
|
|
|
|
#define BRS_LINE_LAYOUT_EMPTY 0x00000080
|
2007-07-26 08:03:29 +04:00
|
|
|
#define BRS_ISOVERFLOWCONTAINER 0x00000100
|
|
|
|
#define BRS_LASTFLAG BRS_ISOVERFLOWCONTAINER
|
2005-04-26 06:26:12 +04:00
|
|
|
|
1999-03-05 07:21:32 +03:00
|
|
|
class nsBlockReflowState {
|
1998-12-05 19:02:08 +03:00
|
|
|
public:
|
1999-03-05 07:21:32 +03:00
|
|
|
nsBlockReflowState(const nsHTMLReflowState& aReflowState,
|
2004-08-01 03:15:21 +04:00
|
|
|
nsPresContext* aPresContext,
|
1999-03-05 07:21:32 +03:00
|
|
|
nsBlockFrame* aFrame,
|
2000-01-03 07:32:13 +03:00
|
|
|
const nsHTMLReflowMetrics& aMetrics,
|
2007-02-19 02:53:25 +03:00
|
|
|
PRBool aTopMarginRoot, PRBool aBottomMarginRoot,
|
2009-01-05 03:39:54 +03:00
|
|
|
PRBool aBlockNeedsFloatManager);
|
1998-09-24 00:10:40 +04:00
|
|
|
|
|
|
|
~nsBlockReflowState();
|
|
|
|
|
2006-12-12 04:06:23 +03:00
|
|
|
// Set up a property on the block that points to our temporary mOverflowPlaceholders
|
|
|
|
// list, if that list is or could become non-empty during this reflow. Must be
|
|
|
|
// called after the block has done DrainOverflowLines because DrainOverflowLines
|
|
|
|
// can setup mOverflowPlaceholders even if the block is in unconstrained height
|
|
|
|
// reflow (it may have previously been reflowed with constrained height).
|
|
|
|
void SetupOverflowPlaceholdersProperty();
|
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
/**
|
|
|
|
* Get the available reflow space for the current y coordinate. The
|
|
|
|
* available space is relative to our coordinate system (0,0) is our
|
|
|
|
* upper left corner.
|
|
|
|
*/
|
2005-04-29 01:25:11 +04:00
|
|
|
void GetAvailableSpace() { GetAvailableSpace(mY, PR_FALSE); }
|
|
|
|
void GetAvailableSpace(nscoord aY, PRBool aRelaxHeightConstraint);
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2005-03-23 06:35:08 +03:00
|
|
|
/*
|
|
|
|
* The following functions all return PR_TRUE if they were able to
|
|
|
|
* place the float, PR_FALSE if the float did not fit in available
|
|
|
|
* space.
|
|
|
|
*/
|
|
|
|
PRBool InitFloat(nsLineLayout& aLineLayout,
|
|
|
|
nsPlaceholderFrame* aPlaceholderFrame,
|
2008-06-11 03:53:22 +04:00
|
|
|
nscoord aAvailableWidth,
|
2005-03-23 06:35:08 +03:00
|
|
|
nsReflowStatus& aReflowStatus);
|
|
|
|
PRBool AddFloat(nsLineLayout& aLineLayout,
|
|
|
|
nsPlaceholderFrame* aPlaceholderFrame,
|
|
|
|
PRBool aInitialReflow,
|
2008-06-11 03:53:22 +04:00
|
|
|
nscoord aAvailableWidth,
|
2005-03-23 06:35:08 +03:00
|
|
|
nsReflowStatus& aReflowStatus);
|
2005-04-29 01:25:11 +04:00
|
|
|
PRBool CanPlaceFloat(const nsSize& aFloatSize, PRUint8 aFloats, PRBool aForceFit);
|
|
|
|
PRBool FlowAndPlaceFloat(nsFloatCache* aFloatCache,
|
2005-03-23 06:35:08 +03:00
|
|
|
PRBool* aIsLeftFloat,
|
2005-04-29 01:25:11 +04:00
|
|
|
nsReflowStatus& aReflowStatus,
|
|
|
|
PRBool aForceFit);
|
2006-06-29 05:19:48 +04:00
|
|
|
PRBool PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aFloats, PRBool aForceFit);
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2004-11-25 17:51:00 +03:00
|
|
|
// Returns the first coordinate >= aY that clears the
|
2008-01-29 10:40:05 +03:00
|
|
|
// floats indicated by aBreakType and has enough width between floats
|
2008-05-04 03:33:36 +04:00
|
|
|
// (or no floats remaining) to accomodate aReplacedBlock.
|
2008-04-15 05:05:17 +04:00
|
|
|
nscoord ClearFloats(nscoord aY, PRUint8 aBreakType,
|
2008-05-04 03:33:36 +04:00
|
|
|
nsIFrame *aReplacedBlock = nsnull);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
1998-12-05 19:02:08 +03:00
|
|
|
PRBool IsAdjacentWithTop() const {
|
2005-04-26 06:26:12 +04:00
|
|
|
return mY ==
|
|
|
|
((mFlags & BRS_ISFIRSTINFLOW) ? mReflowState.mComputedBorderPadding.top : 0);
|
1998-12-05 19:02:08 +03:00
|
|
|
}
|
|
|
|
|
2005-04-26 06:26:12 +04:00
|
|
|
/**
|
|
|
|
* Adjusts the border/padding to return 0 for the top if
|
2007-07-04 02:49:00 +04:00
|
|
|
* we are not the first in flow.
|
2005-04-26 06:26:12 +04:00
|
|
|
*/
|
|
|
|
nsMargin BorderPadding() const {
|
|
|
|
nsMargin result = mReflowState.mComputedBorderPadding;
|
|
|
|
if (!(mFlags & BRS_ISFIRSTINFLOW)) {
|
|
|
|
result.top = 0;
|
2007-07-26 08:03:29 +04:00
|
|
|
if (mFlags & BRS_ISOVERFLOWCONTAINER) {
|
|
|
|
result.bottom = 0;
|
|
|
|
}
|
2005-04-26 06:26:12 +04:00
|
|
|
}
|
|
|
|
return result;
|
1999-03-05 07:21:32 +03:00
|
|
|
}
|
|
|
|
|
2005-04-26 06:26:12 +04:00
|
|
|
// XXX maybe we should do the same adjustment for continuations here
|
2000-06-12 02:14:33 +04:00
|
|
|
const nsMargin& Margin() const {
|
|
|
|
return mReflowState.mComputedMargin;
|
|
|
|
}
|
|
|
|
|
2001-10-25 05:08:40 +04:00
|
|
|
// Reconstruct the previous bottom margin that goes above |aLine|.
|
|
|
|
void ReconstructMarginAbove(nsLineList::iterator aLine);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2008-05-04 03:33:36 +04:00
|
|
|
// Caller must have called GetAvailableSpace for the correct position
|
|
|
|
// (which need not be the current mY). Callers need only pass
|
|
|
|
// aReplacedWidth for outer table frames.
|
2008-04-15 05:05:17 +04:00
|
|
|
void ComputeReplacedBlockOffsetsForFloats(nsIFrame* aFrame,
|
|
|
|
nscoord& aLeftResult,
|
|
|
|
nscoord& aRightResult,
|
2008-05-04 03:33:36 +04:00
|
|
|
nsBlockFrame::ReplacedElementWidthToClear
|
|
|
|
*aReplacedWidth = nsnull);
|
2008-04-15 05:05:17 +04:00
|
|
|
|
|
|
|
// Caller must have called GetAvailableSpace for the current mY
|
1999-08-28 01:45:37 +04:00
|
|
|
void ComputeBlockAvailSpace(nsIFrame* aFrame,
|
|
|
|
const nsStyleDisplay* aDisplay,
|
2008-05-04 03:33:36 +04:00
|
|
|
PRBool aBlockAvoidsFloats,
|
1999-08-28 01:45:37 +04:00
|
|
|
nsRect& aResult);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2001-11-15 10:28:46 +03:00
|
|
|
protected:
|
2003-10-14 01:51:02 +04:00
|
|
|
void RecoverFloats(nsLineList::iterator aLine, nscoord aDeltaY);
|
2001-11-15 10:28:46 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
void RecoverStateFrom(nsLineList::iterator aLine, nscoord aDeltaY);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
1999-08-28 01:45:37 +04:00
|
|
|
void AdvanceToNextLine() {
|
2008-11-27 21:44:47 +03:00
|
|
|
if (GetFlag(BRS_LINE_LAYOUT_EMPTY)) {
|
|
|
|
SetFlag(BRS_LINE_LAYOUT_EMPTY, PR_FALSE);
|
|
|
|
} else {
|
|
|
|
mLineNumber++;
|
|
|
|
}
|
1999-08-28 01:45:37 +04:00
|
|
|
}
|
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
PRBool IsImpactedByFloat() const;
|
1999-10-15 03:10:03 +04:00
|
|
|
|
1999-10-20 03:04:19 +04:00
|
|
|
nsLineBox* NewLineBox(nsIFrame* aFrame, PRInt32 aCount, PRBool aIsBlock);
|
|
|
|
|
|
|
|
void FreeLineBox(nsLineBox* aLine);
|
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
//----------------------------------------
|
|
|
|
|
|
|
|
// This state is the "global" state computed once for the reflow of
|
|
|
|
// the block.
|
|
|
|
|
|
|
|
// The block frame that is using this object
|
|
|
|
nsBlockFrame* mBlock;
|
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
nsPresContext* mPresContext;
|
1999-04-03 22:59:01 +04:00
|
|
|
|
1999-03-05 07:21:32 +03:00
|
|
|
const nsHTMLReflowState& mReflowState;
|
|
|
|
|
2009-01-05 03:39:54 +03:00
|
|
|
nsFloatManager* mFloatManager;
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2009-01-05 03:39:54 +03:00
|
|
|
// The coordinates within the float manager where the block is being
|
1999-04-03 22:59:01 +04:00
|
|
|
// placed <b>after</b> taking into account the blocks border and
|
|
|
|
// padding. This, therefore, represents the inner "content area" (in
|
|
|
|
// spacemanager coordinates) where child frames will be placed,
|
2003-10-14 01:51:02 +04:00
|
|
|
// including child blocks and floats.
|
2009-01-05 03:39:54 +03:00
|
|
|
nscoord mFloatManagerX, mFloatManagerY;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// XXX get rid of this
|
1998-12-05 19:02:08 +03:00
|
|
|
nsReflowStatus mReflowStatus;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2008-04-13 21:43:12 +04:00
|
|
|
// The x-position we should place an outside bullet relative to.
|
|
|
|
// This is the border-box edge of the principal box. However, if a line box
|
|
|
|
// would be displaced by floats, we want to displace it by the same amount.
|
|
|
|
// That is, we act as though the edge of the floats is the content-edge of
|
|
|
|
// the block, displaced by the block's padding and border.
|
|
|
|
nscoord mOutsideBulletX;
|
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
nscoord mBottomEdge;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// The content area to reflow child frames within. The x/y
|
|
|
|
// coordinates are known to be mBorderPadding.left and
|
|
|
|
// mBorderPadding.top. The width/height may be NS_UNCONSTRAINEDSIZE
|
|
|
|
// if the container reflowing this frame has given the frame an
|
|
|
|
// unconstrained area.
|
|
|
|
nsSize mContentArea;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2005-03-23 06:35:08 +03:00
|
|
|
// Placeholders for continuation out-of-flow frames that need to
|
2006-04-10 02:56:27 +04:00
|
|
|
// move to our next in flow are placed here during reflow. At the end of reflow
|
|
|
|
// they move to the end of the overflow lines.
|
|
|
|
// Their out-of-flows are not in any child list during reflow, but are added
|
|
|
|
// to the overflow-out-of-flow list when the placeholders are appended to
|
|
|
|
// the overflow lines.
|
2005-03-23 06:35:08 +03:00
|
|
|
nsFrameList mOverflowPlaceholders;
|
|
|
|
|
2007-07-26 08:03:29 +04:00
|
|
|
// Track child overflow continuations.
|
|
|
|
nsOverflowContinuationTracker mOverflowTracker;
|
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
//----------------------------------------
|
1998-09-24 00:10:40 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// This state is "running" state updated by the reflow of each line
|
|
|
|
// in the block. This same state is "recovered" when a line is not
|
|
|
|
// dirty and is passed over during incremental reflow.
|
|
|
|
|
|
|
|
// The current line being reflowed
|
2001-10-25 05:08:40 +04:00
|
|
|
// If it is mBlock->end_lines(), then it is invalid.
|
|
|
|
nsLineList::iterator mCurrentLine;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2006-02-27 07:15:05 +03:00
|
|
|
// When BRS_HAVELINEADJACENTTOTOP is set, this refers to a line
|
|
|
|
// which we know is adjacent to the top of the block (in other words,
|
|
|
|
// all lines before it are empty and do not have clearance. This line is
|
|
|
|
// always before the current line.
|
|
|
|
nsLineList::iterator mLineAdjacentToTop;
|
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// The current Y coordinate in the block
|
|
|
|
nscoord mY;
|
|
|
|
|
|
|
|
// The available space within the current band.
|
2008-02-11 00:49:24 +03:00
|
|
|
// (relative to the *content*-rect of the block)
|
1998-12-09 00:43:15 +03:00
|
|
|
nsRect mAvailSpaceRect;
|
1999-02-23 22:32:00 +03:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
// The combined area of all floats placed so far
|
|
|
|
nsRect mFloatCombinedArea;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList mFloatCacheFreeList;
|
1999-09-15 04:28:10 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// Previous child. This is used when pulling up a frame to update
|
|
|
|
// the sibling list.
|
|
|
|
nsIFrame* mPrevChild;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
|
|
|
// The previous child frames collapsed bottom margin value.
|
2001-10-25 05:08:40 +04:00
|
|
|
nsCollapsingMargin mPrevBottomMargin;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// The current next-in-flow for the block. When lines are pulled
|
|
|
|
// from a next-in-flow, this is used to know which next-in-flow to
|
|
|
|
// pull from. When a next-in-flow is emptied of lines, we advance
|
|
|
|
// this to the next next-in-flow.
|
|
|
|
nsBlockFrame* mNextInFlow;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
//----------------------------------------
|
|
|
|
|
|
|
|
// Temporary line-reflow state. This state is used during the reflow
|
|
|
|
// of a given line, but doesn't have meaning before or after.
|
1999-09-15 04:28:10 +04:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
// The list of floats that are "current-line" floats. These are
|
1999-09-15 04:28:10 +04:00
|
|
|
// added to the line after the line has been reflowed, to keep the
|
|
|
|
// list fiddling from being N^2.
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList mCurrentLineFloats;
|
1999-09-15 04:28:10 +04:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
// The list of floats which are "below current-line"
|
|
|
|
// floats. These are reflowed/placed after the line is reflowed
|
1999-09-15 04:28:10 +04:00
|
|
|
// and placed. Again, this is done to keep the list fiddling from
|
|
|
|
// being N^2.
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList mBelowCurrentLineFloats;
|
1999-04-03 22:59:01 +04:00
|
|
|
|
1999-08-28 01:45:37 +04:00
|
|
|
nscoord mMinLineHeight;
|
|
|
|
|
|
|
|
PRInt32 mLineNumber;
|
2000-04-17 18:40:46 +04:00
|
|
|
|
|
|
|
PRInt16 mFlags;
|
2002-07-17 05:48:56 +04:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
PRUint8 mFloatBreakType;
|
2000-04-17 18:40:46 +04:00
|
|
|
|
2009-01-05 03:39:54 +03:00
|
|
|
// The number of floats on the sides of mAvailSpaceRect, including
|
|
|
|
// floats that do not reduce mAvailSpaceRect because they are in the
|
|
|
|
// margins.
|
|
|
|
PRPackedBool mBandHasFloats;
|
|
|
|
|
2000-04-17 18:40:46 +04:00
|
|
|
void SetFlag(PRUint32 aFlag, PRBool aValue)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aFlag<=BRS_LASTFLAG, "bad flag");
|
|
|
|
NS_ASSERTION(aValue==PR_FALSE || aValue==PR_TRUE, "bad value");
|
|
|
|
if (aValue) { // set flag
|
|
|
|
mFlags |= aFlag;
|
|
|
|
}
|
|
|
|
else { // unset flag
|
|
|
|
mFlags &= ~aFlag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool GetFlag(PRUint32 aFlag) const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aFlag<=BRS_LASTFLAG, "bad flag");
|
2007-10-10 04:00:05 +04:00
|
|
|
return !!(mFlags & aFlag);
|
2000-04-17 18:40:46 +04:00
|
|
|
}
|
1998-09-24 00:10:40 +04:00
|
|
|
};
|
2001-05-01 08:22:57 +04:00
|
|
|
|
|
|
|
#endif // nsBlockReflowState_h__
|