Back to index

lightning-sunbird  0.9+nobinonly
nsBlockFrame.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 // vim:cindent:ts=2:et:sw=2:
00003 /* ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 #ifndef nsBlockFrame_h___
00039 #define nsBlockFrame_h___
00040 
00041 #include "nsHTMLContainerFrame.h"
00042 #include "nsHTMLParts.h"
00043 #include "nsAbsoluteContainingBlock.h"
00044 #include "nsLineBox.h"
00045 #include "nsReflowPath.h"
00046 #include "nsCSSPseudoElements.h"
00047 #include "nsStyleSet.h"
00048 
00049 class nsBlockReflowState;
00050 class nsBulletFrame;
00051 class nsLineBox;
00052 class nsFirstLineFrame;
00053 class nsILineIterator;
00054 class nsIntervalSet;
00059 #define NS_BLOCK_FRAME_FLOAT_LIST_INDEX         0
00060 #define NS_BLOCK_FRAME_BULLET_LIST_INDEX        1
00061 #define NS_BLOCK_FRAME_OVERFLOW_LIST_INDEX      2
00062 #define NS_BLOCK_FRAME_OVERFLOW_OOF_LIST_INDEX  3
00063 #define NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX      4
00064 #define NS_BLOCK_FRAME_LAST_LIST_INDEX      NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX
00065 
00092 // see nsHTMLParts.h for the public block state bits
00093 #define NS_BLOCK_HAS_LINE_CURSOR            0x01000000
00094 #define NS_BLOCK_HAS_OVERFLOW_LINES         0x02000000
00095 #define NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS  0x04000000
00096 #define NS_BLOCK_HAS_OVERFLOW_PLACEHOLDERS  0x08000000
00097 
00098 // Set on any block that has descendant frames in the normal
00099 // flow with 'clear' set to something other than 'none'
00100 // (including <BR CLEAR="..."> frames)
00101 #define NS_BLOCK_HAS_CLEAR_CHILDREN         0x10000000
00102 
00103 #define nsBlockFrameSuper nsHTMLContainerFrame
00104 
00105 #define NS_BLOCK_FRAME_CID \
00106  { 0xa6cf90df, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
00107 
00108 extern const nsIID kBlockFrameCID;
00109 
00110 /*
00111  * Base class for block and inline frames.
00112  * The block frame has an additional named child list:
00113  * - "Absolute-list" which contains the absolutely positioned frames
00114  *
00115  * @see nsLayoutAtoms::absoluteList
00116  */ 
00117 class nsBlockFrame : public nsBlockFrameSuper
00118 {
00119 public:
00120   typedef nsLineList::iterator                  line_iterator;
00121   typedef nsLineList::const_iterator            const_line_iterator;
00122   typedef nsLineList::reverse_iterator          reverse_line_iterator;
00123   typedef nsLineList::const_reverse_iterator    const_reverse_line_iterator;
00124 
00125   line_iterator begin_lines() { return mLines.begin(); }
00126   line_iterator end_lines() { return mLines.end(); }
00127   const_line_iterator begin_lines() const { return mLines.begin(); }
00128   const_line_iterator end_lines() const { return mLines.end(); }
00129   reverse_line_iterator rbegin_lines() { return mLines.rbegin(); }
00130   reverse_line_iterator rend_lines() { return mLines.rend(); }
00131   const_reverse_line_iterator rbegin_lines() const { return mLines.rbegin(); }
00132   const_reverse_line_iterator rend_lines() const { return mLines.rend(); }
00133 
00134   friend nsresult NS_NewBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags);
00135 
00136   // nsISupports
00137   NS_IMETHOD  QueryInterface(const nsIID& aIID, void** aInstancePtr);
00138 
00139   // nsIFrame
00140   NS_IMETHOD Init(nsPresContext*  aPresContext,
00141                   nsIContent*      aContent,
00142                   nsIFrame*        aParent,
00143                   nsStyleContext*  aContext,
00144                   nsIFrame*        aPrevInFlow);
00145   NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
00146                                  nsIAtom*        aListName,
00147                                  nsIFrame*       aChildList);
00148   NS_IMETHOD  AppendFrames(nsIAtom*        aListName,
00149                            nsIFrame*       aFrameList);
00150   NS_IMETHOD  InsertFrames(nsIAtom*        aListName,
00151                            nsIFrame*       aPrevFrame,
00152                            nsIFrame*       aFrameList);
00153   NS_IMETHOD  RemoveFrame(nsIAtom*        aListName,
00154                           nsIFrame*       aOldFrame);
00155   virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;
00156   NS_IMETHOD  SetParent(const nsIFrame* aParent);
00157   virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
00158   NS_IMETHOD Destroy(nsPresContext* aPresContext);
00159   NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
00160   virtual PRBool IsContainingBlock() const;
00161   virtual PRBool IsFloatContainingBlock() const;
00162   NS_IMETHOD Paint(nsPresContext*      aPresContext,
00163                    nsIRenderingContext& aRenderingContext,
00164                    const nsRect&        aDirtyRect,
00165                    nsFramePaintLayer    aWhichLayer,
00166                    PRUint32             aFlags = 0);
00167   virtual nsIAtom* GetType() const;
00168 #ifdef DEBUG
00169   NS_IMETHOD List(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
00170   NS_IMETHOD_(nsFrameState) GetDebugStateBits() const;
00171   NS_IMETHOD GetFrameName(nsAString& aResult) const;
00172   NS_IMETHOD VerifyTree() const;
00173 #endif
00174 
00175 #ifdef ACCESSIBILITY
00176   NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
00177 #endif
00178 
00179   // line cursor methods to speed up searching for the line(s)
00180   // containing a point. The basic idea is that we set the cursor
00181   // property if the lines' combinedArea.ys and combinedArea.yMosts
00182   // are non-decreasing (considering only non-empty combinedAreas;
00183   // empty combinedAreas never participate in event handling or
00184   // painting), and the block has sufficient number of lines. The
00185   // cursor property points to a "recently used" line. If we get a
00186   // series of GetFrameForPoint or Paint requests that work on lines
00187   // "near" the cursor, then we can find those nearby lines quickly by
00188   // starting our search at the cursor.
00189 
00190   // Clear out line cursor because we're disturbing the lines (i.e., Reflow)
00191   void ClearLineCursor();
00192   // Get the first line that might contain y-coord 'y', or nsnull if you must search
00193   // all lines. If nonnull is returned then we guarantee that the lines'
00194   // combinedArea.ys and combinedArea.yMosts are non-decreasing.
00195   // The actual line returned might not contain 'y', but if not, it is guaranteed
00196   // to be before any line which does contain 'y'.
00197   nsLineBox* GetFirstLineContaining(nscoord y);
00198   // Set the line cursor to our first line. Only call this if you
00199   // guarantee that the lines' combinedArea.ys and combinedArea.yMosts
00200   // are non-decreasing.
00201   void SetupLineCursor();
00202 
00203   nsresult GetFrameForPointUsing(const nsPoint& aPoint,
00204                                  nsIAtom*       aList,
00205                                  nsFramePaintLayer aWhichLayer,
00206                                  PRBool         aConsiderSelf,
00207                                  nsIFrame**     aFrame);
00208   NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsFramePaintLayer aWhichLayer, nsIFrame** aFrame);
00209   NS_IMETHOD HandleEvent(nsPresContext* aPresContext, 
00210                          nsGUIEvent*     aEvent,
00211                          nsEventStatus*  aEventStatus);
00212   NS_IMETHOD ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild);
00213 
00214   NS_IMETHOD IsVisibleForPainting(nsPresContext *     aPresContext, 
00215                                   nsIRenderingContext& aRenderingContext,
00216                                   PRBool               aCheckVis,
00217                                   PRBool*              aIsVisible);
00218 
00219   virtual PRBool IsEmpty();
00220   virtual PRBool IsSelfEmpty();
00221 
00222   // nsIHTMLReflow
00223   NS_IMETHOD Reflow(nsPresContext*          aPresContext,
00224                     nsHTMLReflowMetrics&     aDesiredSize,
00225                     const nsHTMLReflowState& aReflowState,
00226                     nsReflowStatus&          aStatus);
00227 
00228   NS_IMETHOD AttributeChanged(nsIContent*     aChild,
00229                               PRInt32         aNameSpaceID,
00230                               nsIAtom*        aAttribute,
00231                               PRInt32         aModType);
00232 
00233 #ifdef DO_SELECTION
00234   NS_IMETHOD  HandleEvent(nsPresContext* aPresContext,
00235                           nsGUIEvent* aEvent,
00236                           nsEventStatus* aEventStatus);
00237 
00238   NS_IMETHOD  HandleDrag(nsPresContext* aPresContext, 
00239                          nsGUIEvent*     aEvent,
00240                          nsEventStatus*  aEventStatus);
00241 
00242   nsIFrame * FindHitFrame(nsBlockFrame * aBlockFrame, 
00243                           const nscoord aX, const nscoord aY,
00244                           const nsPoint & aPoint);
00245 
00246 #endif
00247 
00248   virtual void DeleteNextInFlowChild(nsPresContext* aPresContext,
00249                                      nsIFrame*       aNextInFlow);
00250 
00256   PRBool CheckForCollapsedBottomMarginFromClearanceLine();
00257 
00262   nsIFrame* GetTopBlockChild(nsPresContext *aPresContext);
00263 
00264   // Returns the line containing aFrame, or end_lines() if the frame
00265   // isn't in the block.
00266   line_iterator FindLineFor(nsIFrame* aFrame);
00267 
00268   static nsresult GetCurrentLine(nsBlockReflowState *aState, nsLineBox **aOutCurrentLine);
00269 
00270   inline nscoord GetAscent() { return mAscent; }
00271 
00272   // Create a contination for aPlaceholder and its out of flow frame and
00273   // add it to the list of overflow floats
00274   nsresult SplitPlaceholder(nsBlockReflowState& aState, nsIFrame* aPlaceholder);
00275 
00276   void UndoSplitPlaceholders(nsBlockReflowState& aState,
00277                              nsIFrame*           aLastPlaceholder);
00278   
00279   virtual void PaintChild(nsPresContext*      aPresContext,
00280                           nsIRenderingContext& aRenderingContext,
00281                           const nsRect&        aDirtyRect,
00282                           nsIFrame*            aFrame,
00283                           nsFramePaintLayer    aWhichLayer,
00284                           PRUint32             aFlags = 0) {
00285     nsContainerFrame::PaintChild(aPresContext, aRenderingContext,
00286                                  aDirtyRect, aFrame, aWhichLayer, aFlags);
00287   }
00288 
00289   PRBool HandleOverflowPlaceholdersForPulledFrame(
00290     nsBlockReflowState& aState, nsIFrame* aFrame);
00291 
00292   PRBool HandleOverflowPlaceholdersOnPulledLine(
00293     nsBlockReflowState& aState, nsLineBox* aLine);
00294 
00295 protected:
00296   nsBlockFrame();
00297   virtual ~nsBlockFrame();
00298 
00299 #ifdef DEBUG
00300   already_AddRefed<nsStyleContext> GetFirstLetterStyle(nsPresContext* aPresContext)
00301   {
00302     return aPresContext->StyleSet()->
00303       ProbePseudoStyleFor(mContent,
00304                           nsCSSPseudoElements::firstLetter, mStyleContext);
00305   }
00306 #endif
00307 
00308   /*
00309    * Overides member function of nsHTMLContainerFrame. Needed to handle the 
00310    * lines in a nsBlockFrame properly.
00311    */
00312   virtual void PaintTextDecorationLines(nsIRenderingContext& aRenderingContext,
00313                                         nscolor aColor,
00314                                         nscoord aOffset,
00315                                         nscoord aAscent,
00316                                         nscoord aSize);
00317 
00324   nsresult GetClosestLine(nsILineIterator *aLI,
00325                           const nsPoint &aPoint,
00326                           PRInt32 &aClosestLine);
00327 
00328   void TryAllLines(nsLineList::iterator* aIterator,
00329                    nsLineList::iterator* aEndIterator,
00330                    PRBool* aInOverflowLines);
00331 
00332   void SetFlags(PRUint32 aFlags) {
00333     mState &= ~NS_BLOCK_FLAGS_MASK;
00334     mState |= aFlags;
00335   }
00336 
00337   PRBool HaveOutsideBullet() const {
00338 #if defined(DEBUG) && !defined(DEBUG_rods)
00339     if(mState & NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET) {
00340       NS_ASSERTION(mBullet,"NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET flag set and no mBullet");
00341     }
00342 #endif
00343     return 0 != (mState & NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET);
00344   }
00345 
00349   void SlideLine(nsBlockReflowState& aState,
00350                  nsLineBox* aLine, nscoord aDY);
00351 
00352   virtual PRIntn GetSkipSides() const;
00353 
00354   virtual void ComputeFinalSize(const nsHTMLReflowState& aReflowState,
00355                                 nsBlockReflowState&      aState,
00356                                 nsHTMLReflowMetrics&     aMetrics);
00357 
00358   void ComputeCombinedArea(const nsHTMLReflowState& aReflowState,
00359                            nsHTMLReflowMetrics& aMetrics);
00360 
00367   nsresult AddFrames(nsIFrame* aFrameList,
00368                      nsIFrame* aPrevSibling);
00369 
00370 public:
00379   nsresult DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames = PR_TRUE);
00380   
00381   void ReparentFloats(nsIFrame* aFirstFrame,
00382                       nsBlockFrame* aOldParent, PRBool aFromOverflow,
00383                       PRBool aReparentSiblings);
00384 
00385 protected:
00386 
00391   PRBool DrainOverflowLines(nsBlockReflowState& aState);
00392 
00397   line_iterator RemoveFloat(nsIFrame* aFloat);
00398 
00399   void CollectFloats(nsIFrame* aFrame, nsFrameList& aList, nsIFrame** aTail,
00400                      PRBool aFromOverflow, PRBool aCollectFromSiblings);
00401   // Remove a float, abs, rel positioned frame from the appropriate block's list
00402   static void DoRemoveOutOfFlowFrame(nsIFrame* aFrame);
00403 
00405   nsresult PrepareInitialReflow(nsBlockReflowState& aState);
00406 
00408   nsresult PrepareStyleChangedReflow(nsBlockReflowState& aState);
00409 
00413   nsresult PrepareChildIncrementalReflow(nsBlockReflowState& aState);
00414 
00433   void RetargetInlineIncrementalReflow(nsReflowPath::iterator &aFrame,
00434                                        line_iterator          &aLine,
00435                                        nsIFrame               *aPrevInFlow);
00436 
00440   nsresult PrepareResizeReflow(nsBlockReflowState& aState);
00441 
00446   nsresult ReflowDirtyLines(nsBlockReflowState& aState, PRBool aTryPull);
00447 
00448   //----------------------------------------
00449   // Methods for line reflow
00461   nsresult ReflowLine(nsBlockReflowState& aState,
00462                       line_iterator aLine,
00463                       PRBool aTryPull,
00464                       PRBool* aKeepReflowGoing,
00465                       PRBool aDamageDirtyArea = PR_FALSE);
00466 
00467   // Return PR_TRUE if aLine gets pushed.
00468   PRBool PlaceLine(nsBlockReflowState& aState,
00469                    nsLineLayout&       aLineLayout,
00470                    line_iterator       aLine,
00471                    PRBool*             aKeepReflowGoing,
00472                    PRBool              aUpdateMaximumWidth);
00473 
00478   nsresult MarkLineDirty(line_iterator aLine);
00479 
00480   // XXX blech
00481   void PostPlaceLine(nsBlockReflowState& aState,
00482                      nsLineBox* aLine,
00483                      nscoord aMaxElementWidth);
00484 
00485   // XXX where to go
00486   PRBool ShouldJustifyLine(nsBlockReflowState& aState,
00487                            line_iterator aLine);
00488 
00489   void DeleteLine(nsBlockReflowState& aState,
00490                   nsLineList::iterator aLine,
00491                   nsLineList::iterator aLineEnd);
00492 
00493   //----------------------------------------
00494   // Methods for individual frame reflow
00495 
00496   PRBool ShouldApplyTopMargin(nsBlockReflowState& aState,
00497                               nsLineBox* aLine);
00498 
00499   nsresult ReflowBlockFrame(nsBlockReflowState& aState,
00500                             line_iterator aLine,
00501                             PRBool* aKeepGoing);
00502 
00503   nsresult ReflowInlineFrames(nsBlockReflowState& aState,
00504                               line_iterator aLine,
00505                               PRBool aTryPull,
00506                               PRBool* aKeepLineGoing,
00507                               PRBool aDamageDirtyArea,
00508                               PRBool aUpdateMaximumWidth = PR_FALSE);
00509 
00510   nsresult DoReflowInlineFrames(nsBlockReflowState& aState,
00511                                 nsLineLayout& aLineLayout,
00512                                 line_iterator aLine,
00513                                 PRBool* aKeepReflowGoing,
00514                                 PRUint8* aLineReflowStatus,
00515                                 PRBool aUpdateMaximumWidth,
00516                                 PRBool aDamageDirtyArea,
00517                                 PRBool aAllowPullUp);
00518 
00519   nsresult ReflowInlineFrame(nsBlockReflowState& aState,
00520                              nsLineLayout& aLineLayout,
00521                              line_iterator aLine,
00522                              nsIFrame* aFrame,
00523                              PRUint8* aLineReflowStatus);
00524 
00525   // An incomplete aReflowStatus indicates the float should be split
00526   // but only if the available height is constrained.
00527   nsresult ReflowFloat(nsBlockReflowState& aState,
00528                        nsPlaceholderFrame* aPlaceholder,
00529                        nsFloatCache*       aFloatCache,
00530                        nsReflowStatus&     aReflowStatus);
00531 
00532   //----------------------------------------
00533   // Methods for pushing/pulling lines/frames
00534 
00535   virtual nsresult CreateContinuationFor(nsBlockReflowState& aState,
00536                                          nsLineBox*          aLine,
00537                                          nsIFrame*           aFrame,
00538                                          PRBool&             aMadeNewFrame);
00539 
00540   // Push aLine which contains a positioned element that was truncated. Clean up any 
00541   // placeholders on the same line that were continued. Set aKeepReflowGoing to false. 
00542   void PushTruncatedPlaceholderLine(nsBlockReflowState& aState,
00543                                     line_iterator       aLine,
00544                                     nsIFrame*           aLastPlaceholder,
00545                                     PRBool&             aKeepReflowGoing);
00546 
00547   nsresult SplitLine(nsBlockReflowState& aState,
00548                      nsLineLayout& aLineLayout,
00549                      line_iterator aLine,
00550                      nsIFrame* aFrame);
00551 
00552   nsresult PullFrame(nsBlockReflowState& aState,
00553                      line_iterator aLine,
00554                      PRBool     aDamageDeletedLine,
00555                      nsIFrame*& aFrameResult);
00556 
00557   PRBool PullFrameFrom(nsBlockReflowState& aState,
00558                        nsLineBox* aLine,
00559                        nsBlockFrame* aFromContainer,
00560                        PRBool aFromOverflowLine,
00561                        nsLineList::iterator aFromLine,
00562                        PRBool aDamageDeletedLines,
00563                        nsIFrame*& aFrameResult);
00564 
00565   void PushLines(nsBlockReflowState& aState,
00566                  nsLineList::iterator aLineBefore);
00567 
00568   //----------------------------------------
00569   //XXX
00570   virtual void PaintChildren(nsPresContext*      aPresContext,
00571                              nsIRenderingContext& aRenderingContext,
00572                              const nsRect&        aDirtyRect,
00573                              nsFramePaintLayer    aWhichLayer,
00574                              PRUint32             aFlags = 0);
00575 
00576   void PaintFloats(nsPresContext* aPresContext,
00577                    nsIRenderingContext& aRenderingContext,
00578                    const nsRect& aDirtyRect);
00579 
00580   void PropagateFloatDamage(nsBlockReflowState& aState,
00581                             nsLineBox* aLine,
00582                             nscoord aDeltaY);
00583 
00584   void CheckFloats(nsBlockReflowState& aState);
00585 
00586   //----------------------------------------
00587   // List handling kludge
00588 
00589   void RenumberLists(nsPresContext* aPresContext);
00590 
00591   PRBool RenumberListsInBlock(nsPresContext* aPresContext,
00592                               nsBlockFrame* aContainerFrame,
00593                               PRInt32* aOrdinal,
00594                               PRInt32 aDepth);
00595 
00596   PRBool RenumberListsFor(nsPresContext* aPresContext, nsIFrame* aKid, PRInt32* aOrdinal, PRInt32 aDepth);
00597 
00598   static PRBool FrameStartsCounterScope(nsIFrame* aFrame);
00599 
00600   nsresult UpdateBulletPosition(nsBlockReflowState& aState);
00601 
00602   void ReflowBullet(nsBlockReflowState& aState,
00603                     nsHTMLReflowMetrics& aMetrics);
00604 
00605   //----------------------------------------
00606 
00607 public:
00608   nsLineList* GetOverflowLines() const;
00609 protected:
00610   nsLineList* RemoveOverflowLines();
00611   nsresult SetOverflowLines(nsLineList* aOverflowLines);
00612 
00613   nsFrameList* GetOverflowPlaceholders() const;
00614 
00621   struct nsAutoOOFFrameList {
00622     nsFrameList mList;
00623 
00624     nsAutoOOFFrameList(nsBlockFrame* aBlock) :
00625       mList(aBlock->GetOverflowOutOfFlows().FirstChild()),
00626       aOldHead(mList.FirstChild()), mBlock(aBlock) {}
00627     ~nsAutoOOFFrameList() {
00628       if (mList.FirstChild() != aOldHead) {
00629         mBlock->SetOverflowOutOfFlows(mList);
00630       }
00631     }
00632   protected:
00633     nsIFrame* aOldHead;
00634     nsBlockFrame* mBlock;
00635   };
00636   friend struct nsAutoOOFFrameList;
00637 
00638   nsFrameList GetOverflowOutOfFlows() const;
00639   void SetOverflowOutOfFlows(const nsFrameList& aList);
00640 
00641   nsIFrame* LastChild();
00642 
00643 #ifdef NS_DEBUG
00644   PRBool IsChild(nsIFrame* aFrame);
00645   void VerifyLines(PRBool aFinalCheckOK);
00646   void VerifyOverflowSituation();
00647   PRInt32 GetDepth() const;
00648 #endif
00649 
00650   // Ascent of our first line to support 'vertical-align: baseline' in table-cells
00651   nscoord mAscent;
00652 
00653   nsLineList mLines;
00654 
00655   // List of all floats in this block
00656   nsFrameList mFloats;
00657 
00658   // XXX_fix_me: subclass one more time!
00659   // For list-item frames, this is the bullet frame.
00660   nsBulletFrame* mBullet;
00661 
00662   friend class nsBlockReflowState;
00663 
00664 private:
00665   nsAbsoluteContainingBlock mAbsoluteContainer;
00666 
00667 
00668 #ifdef DEBUG
00669 public:
00670   static PRBool gLamePaintMetrics;
00671   static PRBool gLameReflowMetrics;
00672   static PRBool gNoisy;
00673   static PRBool gNoisyDamageRepair;
00674   static PRBool gNoisyMaxElementWidth;
00675   static PRBool gNoisyReflow;
00676   static PRBool gReallyNoisyReflow;
00677   static PRBool gNoisySpaceManager;
00678   static PRBool gVerifyLines;
00679   static PRBool gDisableResizeOpt;
00680 
00681   static PRInt32 gNoiseIndent;
00682 
00683   static const char* kReflowCommandType[];
00684 
00685 protected:
00686   static void InitDebugFlags();
00687 #endif
00688 };
00689 
00690 #ifdef DEBUG
00691 class AutoNoisyIndenter {
00692 public:
00693   AutoNoisyIndenter(PRBool aDoIndent) : mIndented(aDoIndent) {
00694     if (mIndented) {
00695       nsBlockFrame::gNoiseIndent++;
00696     }
00697   }
00698   ~AutoNoisyIndenter() {
00699     if (mIndented) {
00700       nsBlockFrame::gNoiseIndent--;
00701     }
00702   }
00703 private:
00704   PRBool mIndented;
00705 };
00706 #endif
00707 
00708 #endif /* nsBlockFrame_h___ */
00709