Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
nsTableFrame Class Reference

nsTableFrame maps the inner portion of a table (everything except captions.) Used as a pseudo-frame within nsTableOuterFrame, it may also be used stand-alone as the top-level frame. More...

#include <nsTableFrame.h>

Inheritance diagram for nsTableFrame:
Inheritance graph
[legend]
Collaboration diagram for nsTableFrame:
Collaboration graph
[legend]

List of all members.

Classes

struct  TableBits

Public Types

enum  { eMathML = 1 << 0, eSVG = 1 << 1, eSVGForeignObject = 1 << 2 }
 Bit-flags to pass to IsFrameOfType() More...
enum  Halignment { hAlign_Left, hAlign_Right, hAlign_Center }
enum  Valignment { vAlign_Top, vAlign_Middle, vAlign_BaseLine, vAlign_Bottom }

Public Member Functions

NS_IMETHOD Init (nsPresContext *aPresContext, nsIContent *aContent, nsIFrame *aParent, nsStyleContext *aContext, nsIFrame *aPrevInFlow)
 sets defaults for table-specific style.
virtual PRBool IsContainingBlock () const
 Is this frame a containing block for non-positioned elements?
nsPoint GetFirstSectionOrigin (const nsHTMLReflowState &aReflowState) const
void AttributeChangedFor (nsIFrame *aFrame, nsIContent *aContent, nsIAtom *aAttribute)
NS_IMETHOD Destroy (nsPresContext *aPresContext)
NS_IMETHOD AppendFrames (nsIAtom *aListName, nsIFrame *aFrameList)
 This method is responsible for appending frames to the frame list.
NS_IMETHOD InsertFrames (nsIAtom *aListName, nsIFrame *aPrevFrame, nsIFrame *aFrameList)
 This method is responsible for inserting frames into the frame list.
NS_IMETHOD RemoveFrame (nsIAtom *aListName, nsIFrame *aOldFrame)
 This method is responsible for removing a frame in the frame list.
nsMargin GetChildAreaOffset (const nsHTMLReflowState *aReflowState) const
nsMargin GetContentAreaOffset (const nsHTMLReflowState *aReflowState) const
PRBool IsAutoWidth (PRBool *aIsPctWidth=nsnull)
PRBool IsAutoHeight ()
PRBool IsRowGroup (PRInt32 aDisplayType) const
NS_IMETHOD SetInitialChildList (nsPresContext *aPresContext, nsIAtom *aListName, nsIFrame *aChildList)
 Initialize the table frame with a set of children.
virtual nsIFrameGetFirstChild (nsIAtom *aListName) const
 return the first child belonging to the list aListName.
virtual nsIAtomGetAdditionalChildListName (PRInt32 aIndex) const
NS_IMETHOD Paint (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
virtual void PaintChildren (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
nsMargin GetBCBorder () const
nsMargin GetBCMargin () const
nscoord GetContinuousLeftBCBorderWidth (float aPixelsToTwips) const
 Get width of table + colgroup + col collapse: elements that continue along the length of the whole left side.
void SetBCDamageArea (const nsRect &aValue)
void PaintBCBorders (nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect)
NS_IMETHOD GetFrameForPoint (const nsPoint &aPoint, nsFramePaintLayer aWhichLayer, nsIFrame **aFrame)
 Get the frame that should receive events for a given point in the coordinate space of this frame's parent, if the frame is painted in the given paint layer.
NS_IMETHOD SetSelected (nsPresContext *aPresContext, nsIDOMRange *aRange, PRBool aSelected, nsSpread aSpread)
 nsIFrame method overridden to handle table specifics
NS_IMETHOD Reflow (nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
 inner tables are reflowed in two steps.
nsresult ReflowTable (nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nscoord aAvailHeight, nsReflowReason aReason, nsIFrame *&aLastChildReflowed, PRBool &aDidBalance, nsReflowStatus &aStatus)
nsFrameListGetColGroups ()
NS_IMETHOD GetParentStyleContextFrame (nsPresContext *aPresContext, nsIFrame **aProviderFrame, PRBool *aIsChild)
 Called to retrieve this frame's accessible.
virtual nsIAtomGetType () const
 Get the "type" of the frame.
virtual PRInt32 GetColumnWidth (PRInt32 aColIndex)
 return the width of the column at aColIndex
virtual void SetColumnWidth (PRInt32 aColIndex, nscoord aWidth)
 set the width of the column at aColIndex to aWidth
virtual nscoord GetCellSpacingX ()
 helper to get the cell spacing X style value
virtual nscoord GetCellSpacingY ()
 helper to get the cell spacing Y style value
virtual PRInt32 GetEffectiveRowSpan (PRInt32 aStartRowIndex, const nsTableCellFrame &aCell) const
 return the row span of a cell, taking into account row span magic at the bottom of a table.
virtual PRInt32 GetEffectiveRowSpan (const nsTableCellFrame &aCell, nsCellMap *aCellMap=nsnull)
virtual PRInt32 GetEffectiveColSpan (const nsTableCellFrame &aCell, nsCellMap *aCellMap=nsnull) const
 return the col span of a cell, taking into account col span magic at the edge of a table.
PRBool HasMoreThanOneCell (PRInt32 aRowIndex) const
 indicate whether the row has more than one cell that either originates or is spanned from the rows above
PRInt32 GetEffectiveCOLSAttribute ()
 return the value of the COLS attribute, adjusted for the actual number of columns in the table
nsTableColFrameGetColFrame (PRInt32 aColIndex) const
 return the column frame associated with aColIndex returns nsnull if the col frame has not yet been allocated, or if aColIndex is out of range
void InsertCol (nsTableColFrame &aColFrame, PRInt32 aColIndex)
 Insert a col frame reference into the colframe cache and adapt the cellmap.
nsTableColGroupFrameCreateAnonymousColGroupFrame (nsTableColGroupType aType)
PRInt32 DestroyAnonymousColFrames (PRInt32 aNumFrames)
void CreateAnonymousColFrames (PRInt32 aNumColsToAdd, nsTableColType aColType, PRBool aDoAppend, nsIFrame *aPrevCol=nsnull)
void CreateAnonymousColFrames (nsTableColGroupFrame *aColGroupFrame, PRInt32 aNumColsToAdd, nsTableColType aColType, PRBool aAddToColGroupAndTable, nsIFrame *aPrevCol, nsIFrame **aFirstNewFrame)
void MatchCellMapToColCache (nsTableCellMap *aCellMap)
void ClearColCache ()
 empty the column frame cache
virtual void AppendCell (nsTableCellFrame &aCellFrame, PRInt32 aRowIndex)
virtual void InsertCells (nsVoidArray &aCellFrames, PRInt32 aRowIndex, PRInt32 aColIndexBefore)
virtual void RemoveCell (nsTableCellFrame *aCellFrame, PRInt32 aRowIndex)
void AppendRows (nsTableRowGroupFrame &aRowGroupFrame, PRInt32 aRowIndex, nsVoidArray &aRowFrames)
PRInt32 InsertRow (nsTableRowGroupFrame &aRowGroupFrame, nsIFrame &aFrame, PRInt32 aRowIndex, PRBool aConsiderSpans)
PRInt32 InsertRows (nsTableRowGroupFrame &aRowGroupFrame, nsVoidArray &aFrames, PRInt32 aRowIndex, PRBool aConsiderSpans)
virtual void RemoveRows (nsTableRowFrame &aFirstRowFrame, PRInt32 aNumRowsToRemove, PRBool aConsiderSpans)
void AppendRowGroups (nsIFrame *aFirstRowGroupFrame)
 Insert multiple rowgroups into the table cellmap handling.
void InsertRowGroups (nsIFrame *aFirstRowGroupFrame, nsIFrame *aLastRowGroupFrame)
 Insert multiple rowgroups into the table cellmap handling.
void InsertColGroups (PRInt32 aColIndex, nsIFrame *aFirstFrame, nsIFrame *aLastFrame=nsnull)
virtual void RemoveCol (nsTableColGroupFrame *aColGroupFrame, PRInt32 aColIndex, PRBool aRemoveFromCache, PRBool aRemoveFromCellMap)
nsTableCellFrameGetCellInfoAt (PRInt32 aRowX, PRInt32 aColX, PRBool *aOriginates=nsnull, PRInt32 *aColSpan=nsnull)
PRInt32 GetNumCellsOriginatingInCol (PRInt32 aColIndex) const
PRInt32 GetNumCellsOriginatingInRow (PRInt32 aRowIndex) const
PRBool HasPctCol () const
void SetHasPctCol (PRBool aValue)
PRBool HasCellSpanningPctCol () const
void SetHasCellSpanningPctCol (PRBool aValue)
PRBool NeedSpecialReflow () const
void SetNeedSpecialReflow (PRBool aValue)
PRBool NeedToInitiateSpecialReflow () const
void SetNeedToInitiateSpecialReflow (PRBool aValue)
PRBool InitiatedSpecialReflow () const
void SetInitiatedSpecialReflow (PRBool aValue)
virtual PRBool NeedsReflow (const nsHTMLReflowState &aReflowState)
 first pass of ResizeReflow.
PRBool IsRowInserted () const
void SetRowInserted (PRBool aValue)
nscoord CalcBorderBoxWidth (const nsHTMLReflowState &aReflowState)
nscoord CalcBorderBoxHeight (const nsHTMLReflowState &aReflowState)
void CalcMinAndPreferredWidths (const nsHTMLReflowState &aReflowState, PRBool aCalcPrefWidthIfAutoWithPctCol, nscoord &aMinWidth, nscoord &aPreferredWidth)
void OrderRowGroups (nsVoidArray &aChildren, PRUint32 &aNumRowGroups, nsIFrame **aFirstBody=nsnull, nsTableRowGroupFrame **aHead=nsnull, nsTableRowGroupFrame **aFoot=nsnull) const
PRBool RowIsSpannedInto (PRInt32 aRowIndex)
PRBool RowHasSpanningCells (PRInt32 aRowIndex)
PRBool ColIsSpannedInto (PRInt32 aColIndex)
PRBool ColHasSpanningCells (PRInt32 aColIndex)
PRBool CellChangedWidth (const nsTableCellFrame &aCellFrame, nscoord aPrevMinWidth, nscoord aPrevMaxWidth, PRBool aCellWasDestroyed=PR_FALSE)
PRBool NeedStrategyInit () const
void SetNeedStrategyInit (PRBool aValue)
PRBool NeedStrategyBalance () const
void SetNeedStrategyBalance (PRBool aValue)
PRBool IsBorderCollapse () const
PRBool NeedToCalcBCBorders () const
void SetNeedToCalcBCBorders (PRBool aValue)
PRBool NeedToCollapseRows () const
void SetNeedToCollapseRows (PRBool aValue)
PRBool NeedToCollapseColumns () const
void SetNeedToCollapseColumns (PRBool aValue)
virtual nsTableCellMapGetCellMap () const
 Get the cell map for this table frame.
void AdjustRowIndices (PRInt32 aRowIndex, PRInt32 aAdjustment)
 Iterate over the row groups and adjust the row indices of all rows whose index is >= aRowIndex.
void ResetRowIndices (nsIFrame *aFirstRowGroupFrame=nsnull, nsIFrame *aLastRowGroupFrame=nsnull)
 Reset the rowindices of all rows as they might have changed due to rowgroup reordering, exclude new row group frames that show in the reordering but are not yet inserted into the cellmap.
nsVoidArrayGetColCache ()
PRInt32 GetStartRowIndex (nsTableRowGroupFrame &aRowGroupFrame)
virtual PRInt32 GetRowCount () const
 returns the number of rows in this table.
virtual PRInt32 GetEffectiveColCount () const
 returns the number of columns in this table after redundant columns have been removed
virtual PRInt32 GetColCount () const
PRInt32 GetIndexOfLastRealCol ()
nsTableCellFrameGetCellFrameAt (PRInt32 aRowIndex, PRInt32 aColIndex)
 return the cell frame at aRowIndex, aColIndex.
nscoord GetMinCaptionWidth ()
 return the minimum width of the table caption.
virtual PRBool IsAutoLayout ()
 returns PR_TRUE if table-layout:auto
nscoord GetMinWidth () const
void SetMinWidth (nscoord aWidth)
nscoord GetDesiredWidth () const
void SetDesiredWidth (nscoord aWidth)
nscoord GetPreferredWidth () const
void SetPreferredWidth (nscoord aWidth)
NS_IMETHOD GetCellDataAt (PRInt32 aRowIndex, PRInt32 aColIndex, nsIDOMElement *&aCell, PRInt32 &aStartRowIndex, PRInt32 &aStartColIndex, PRInt32 &aRowSpan, PRInt32 &aColSpan, PRInt32 &aActualRowSpan, PRInt32 &aActualColSpan, PRBool &aIsSelected)
 Get the cell and associated data for a table cell from the frame's cellmap.
NS_IMETHOD GetTableSize (PRInt32 &aRowCount, PRInt32 &aColCount)
 Get the number of rows and column for a table from the frame's cellmap Some rows may not have enough cells (the number returned is the maximum possible), which displays as a ragged-right edge table.
NS_IMETHOD ReplaceFrame (nsIAtom *aListName, nsIFrame *aOldFrame, nsIFrame *aNewFrame)
 This method is responsible for replacing the old frame with the new frame.
NS_IMETHOD ReflowDirtyChild (nsIPresShell *aPresShell, nsIFrame *aChild)
 Called by a child frame on a parent frame to tell the parent frame that the child needs to be reflowed.
virtual PRBool IsLeaf () const
 Is this a leaf frame? Frames that want the frame constructor to be able to construct kids for them should return false, all others should return true.
virtual void DeleteNextInFlowChild (nsPresContext *aPresContext, nsIFrame *aNextInFlow)
 Remove and delete aNextInFlow and its next-in-flows.
nsresult ReflowChild (nsIFrame *aKidFrame, nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nscoord aX, nscoord aY, PRUint32 aFlags, nsReflowStatus &aStatus)
 Invokes the WillReflow() function, positions the frame and its view (if requested), and then calls Reflow().
NS_IMETHOD IsSplittable (nsSplittableType &aIsSplittable) const
 Return how your frame can be split.
virtual nsIFrameGetPrevInFlow () const
 Flow member functions.
NS_IMETHOD SetPrevInFlow (nsIFrame *)
virtual nsIFrameGetNextInFlow () const
NS_IMETHOD SetNextInFlow (nsIFrame *)
virtual nsIFrameGetFirstInFlow () const
 Return the first frame in our current flow.
virtual nsIFrameGetLastInFlow () const
 Return the last frame in our current flow.
voidoperator new (size_t sz, nsIPresShell *aPresShell) CPP_THROW_NEW
void operator delete (void *aPtr, size_t sz)
virtual PRBool ComputesOwnOverflowArea ()
NS_IMETHOD QueryInterface (const nsIID &aIID, void **aInstancePtr)
NS_IMETHOD CalcBorderPadding (nsMargin &aBorderPadding) const
virtual nsStyleContextGetAdditionalStyleContext (PRInt32 aIndex) const
 These methods are to access any additional style contexts that the frame may be holding.
virtual void SetAdditionalStyleContext (PRInt32 aIndex, nsStyleContext *aStyleContext)
NS_IMETHOD SetParent (const nsIFrame *aParent)
NS_IMETHOD HandleEvent (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
 Event handling of GUI events.
NS_IMETHOD GetContentForEvent (nsPresContext *aPresContext, nsEvent *aEvent, nsIContent **aContent)
NS_IMETHOD GetCursor (const nsPoint &aPoint, nsIFrame::Cursor &aCursor)
 Get the cursor for a given frame.
NS_IMETHOD GetPointFromOffset (nsPresContext *inPresContext, nsIRenderingContext *inRendContext, PRInt32 inOffset, nsPoint *outPoint)
 Get a point (in the frame's coordinate space) given an offset into the content.
NS_IMETHOD GetChildFrameContainingOffset (PRInt32 inContentOffset, PRBool inHint, PRInt32 *outFrameContentOffset, nsIFrame **outChildFrame)
 Get the child frame of this frame which contains the given content offset.
NS_IMETHOD CharacterDataChanged (nsPresContext *aPresContext, nsIContent *aChild, PRBool aAppend)
 This call is invoked when content is changed in the content tree.
NS_IMETHOD AttributeChanged (nsIContent *aChild, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)
 This call is invoked when the value of a content objects's attribute is changed.
NS_IMETHOD GetOffsetFromView (nsPoint &aOffset, nsIView **aView) const
 Returns the offset from this frame to the closest geometric parent that has a view.
NS_IMETHOD GetOriginToViewOffset (nsPoint &aOffset, nsIView **aView) const
 Returns the offset from this frame's upper left corner to the upper left corner of the view returned by a call to GetView().
NS_IMETHOD GetSelected (PRBool *aSelected) const
NS_IMETHOD IsSelectable (PRBool *aIsSelectable, PRUint8 *aSelectStyle) const
 called to discover where this frame, or a parent frame has user-select style applied, which affects that way that it is selected.
NS_IMETHOD GetSelectionController (nsPresContext *aPresContext, nsISelectionController **aSelCon)
 Called to retrieve the SelectionController associated with the frame.
NS_IMETHOD PeekOffset (nsPresContext *aPresContext, nsPeekOffsetStruct *aPos)
 called to find the previous/next character, word, or line returns the actual nsIFrame and the frame offset.
NS_IMETHOD CheckVisibility (nsPresContext *aContext, PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aRecurse, PRBool *aFinished, PRBool *_retval)
 called to see if the children of the frame are visible from indexstart to index end.
NS_IMETHOD PeekOffsetParagraph (nsPresContext *aPresContext, nsPeekOffsetStruct *aPos)
NS_IMETHOD GetOffsets (PRInt32 &aStart, PRInt32 &aEnd) const
 Get the offsets of the frame.
NS_IMETHOD IsVisibleForPainting (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, PRBool aCheckVis, PRBool *aIsVisible)
 Determines whether a frame is visible for painting this takes into account whether it is painting a selection or printing.
virtual PRBool IsEmpty ()
 Determine whether the frame is logically empty, which is roughly whether the layout would be the same whether or not the frame is present.
virtual PRBool IsSelfEmpty ()
 Determine whether the frame is logically empty, assuming that all its children are empty.
NS_IMETHOD WillReflow (nsPresContext *aPresContext)
 Pre-reflow hook.
NS_IMETHOD DidReflow (nsPresContext *aPresContext, const nsHTMLReflowState *aReflowState, nsDidReflowStatus aStatus)
 Post-reflow hook.
NS_IMETHOD CanContinueTextRun (PRBool &aContinueTextRun) const
 Helper method used by block reflow to identify runs of text so that proper word-breaking can be done.
NS_IMETHOD AdjustFrameSize (nscoord aExtraSpace, nscoord &aUsedSpace)
NS_IMETHOD TrimTrailingWhiteSpace (nsPresContext *aPresContext, nsIRenderingContext &aRC, nscoord &aDeltaWidth, PRBool &aLastCharIsJustifiable)
NS_IMETHOD HandlePress (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
 Handles the Mouse Press Event for the frame.
NS_IMETHOD HandleMultiplePress (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
 Multiple Mouse Press -- line or paragraph selection -- for the frame.
NS_IMETHOD HandleDrag (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
NS_IMETHOD HandleRelease (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
NS_IMETHOD GetContentAndOffsetsFromPoint (nsPresContext *aCX, const nsPoint &aPoint, nsIContent **aNewContent, PRInt32 &aContentOffset, PRInt32 &aContentOffsetEnd, PRBool &aBeginFrameContent)
NS_IMETHOD PeekBackwardAndForward (nsSelectionAmount aAmountBack, nsSelectionAmount aAmountForward, PRInt32 aStartPos, nsPresContext *aPresContext, PRBool aJumpLines)
NS_IMETHOD GetPrefSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetMinSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetMaxSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetFlex (nsBoxLayoutState &aBoxLayoutState, nscoord &aFlex)
NS_IMETHOD GetAscent (nsBoxLayoutState &aBoxLayoutState, nscoord &aAscent)
NS_IMETHOD SetIncludeOverflow (PRBool aInclude)
NS_IMETHOD GetOverflow (nsSize &aOverflow)
NS_IMETHOD NeedsRecalc ()
void CheckInvalidateSizeChange (nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState)
 Helper method to invalidate portions of a standard container frame if the reflow state indicates that the size has changed (specifically border, background and outline).
PRBool IsFrameTreeTooDeep (const nsHTMLReflowState &aReflowState, nsHTMLReflowMetrics &aMetrics)
nsresult DoGetParentStyleContextFrame (nsPresContext *aPresContext, nsIFrame **aProviderFrame, PRBool *aIsChild)
void ConsiderChildOverflow (nsRect &aOverflowArea, nsIFrame *aChildFrame)
NS_IMETHOD CaptureMouse (nsPresContext *aPresContext, PRBool aGrabMouseEvents)
 EndSelection related calls.
PRBool IsMouseCaptured (nsPresContext *aPresContext)
virtual const nsStyleStructGetStyleDataExternal (nsStyleStructID aSID) const
 Get the style data associated with this frame.
virtual nsSize GetMinSizeForScrollArea (nsBoxLayoutState &aBoxLayoutState)
 This returns the minimum size for the scroll area if this frame is being scrolled.
NS_IMETHOD IsCollapsed (nsBoxLayoutState &aBoxLayoutState, PRBool &aCollapsed)
NS_IMETHOD SetBounds (nsBoxLayoutState &aBoxLayoutState, const nsRect &aRect, PRBool aRemoveOverflowArea=PR_FALSE)
NS_IMETHOD MarkDirty (nsBoxLayoutState &aState)
NS_IMETHOD GetBorder (nsMargin &aBorderAndPadding)
NS_IMETHOD GetPadding (nsMargin &aBorderAndPadding)
NS_IMETHOD GetMargin (nsMargin &aMargin)
NS_IMETHOD SetLayoutManager (nsIBoxLayout *aLayout)
NS_IMETHOD GetLayoutManager (nsIBoxLayout **aLayout)
NS_IMETHOD GetVAlign (Valignment &aAlign)
NS_IMETHOD GetHAlign (Halignment &aAlign)
NS_IMETHOD RelayoutDirtyChild (nsBoxLayoutState &aState, nsIBox *aChild)
NS_IMETHOD RelayoutChildAtOrdinal (nsBoxLayoutState &aState, nsIBox *aChild)
NS_IMETHOD GetMouseThrough (PRBool &aMouseThrough)
NS_IMETHOD MarkChildrenStyleChange ()
NS_IMETHOD MarkStyleChange (nsBoxLayoutState &aState)
NS_IMETHOD ChildrenMustHaveWidgets (PRBool &aMust) const
 Hack for deck who requires that all its children has widgets.
NS_IMETHOD GetIndexOf (nsIBox *aChild, PRInt32 *aIndex)
virtual PRBool DoesClipChildren ()
 Returns PR_TRUE if this box clips its children, e.g., if this box is an sc rollbox.
 NS_HIDDEN_ (nsresult) SyncLayout(nsBoxLayoutState &aBoxLayoutState)
 NS_HIDDEN_ (void *) GetProperty(nsIAtom *aPropertyName
 NS_HIDDEN_ (nsresult) DeleteProperty(nsIAtom *aPropertyName) const
PRBool DoesNeedRecalc (const nsSize &aSize)
PRBool DoesNeedRecalc (nscoord aCoord)
void SizeNeedsRecalc (nsSize &aSize)
void CoordNeedsRecalc (nscoord &aCoord)
void AddBorderAndPadding (nsSize &aSize)
void AddInset (nsSize &aSize)
void AddMargin (nsSize &aSize)
nsPresContextGetPresContext () const
virtual void RemovedAsPrimaryFrame (nsPresContext *aPresContext)
nsIContentGetContent () const
 Get the content object associated with this frame.
virtual nsIFrameGetContentInsertionFrame ()
 Get the frame that should be the parent for the frames of child elements.
virtual already_AddRefed
< nsIContent
GetContentInsertionNode ()
 Get the child content node whose frame should be used as the parent for the frames of child elements.
virtual void AdjustOffsetsForBidi (PRInt32 aStart, PRInt32 aEnd)
 Reset the offsets when splitting frames during Bidi reordering.
nsStyleContextGetStyleContext () const
 Get the style context associated with this frame.
void SetStyleContext (nsPresContext *aPresContext, nsStyleContext *aContext)
const nsStyleStructGetStyleData (nsStyleStructID aSID) const
nsIFrameGetParent () const
 Accessor functions for geometric parent.
nsRect GetRect () const
 Bounding rect of the frame.
nsPoint GetPosition () const
nsSize GetSize () const
void SetRect (const nsRect &aRect)
void SetPosition (const nsPoint &aPt)
void SetSize (const nsSize &aSize)
nsIFrameGetNextSibling () const
 Child frames are linked together in a singly-linked list.
void SetNextSibling (nsIFrame *aNextSibling)
virtual PRBool CanPaintBackground ()
 Does the frame paint its background? If not, then all or part of it will be painted by ancestors.
virtual PRBool NeedsView ()
 Does this frame type always need a view?
virtual nsresult CreateWidgetForView (nsIView *aView)
 This frame needs a view with a widget (e.g.
nsFrameState GetStateBits () const
 Get the current frame-state value for this frame.
void AddStateBits (nsFrameState aBits)
 Update the current frame-state value for this frame.
void RemoveStateBits (nsFrameState aBits)
PRBool HasView () const
 Accessor functions to get/set the associated view object.
nsIViewGetView () const
virtual nsIViewGetViewExternal () const
nsresult SetView (nsIView *aView)
virtual nsIViewGetParentViewForChildFrame (nsIFrame *aFrame) const
 This view will be used to parent the views of any children.
nsIViewGetClosestView (nsPoint *aOffset=nsnull) const
 Find the closest view (on |this| or an ancestor).
nsIFrameGetAncestorWithView () const
 Find the closest ancestor (excluding |this| !) that has a view.
virtual nsIFrameGetAncestorWithViewExternal () const
nsPoint GetOffsetTo (const nsIFrame *aOther) const
 Get the offset between the coordinate systems of |this| and aOther.
virtual nsPoint GetOffsetToExternal (const nsIFrame *aOther) const
nsIntRect GetScreenRect () const
 Get the screen rect of the frame.
virtual nsIntRect GetScreenRectExternal () const
virtual PRBool AreAncestorViewsVisible () const
 Returns true if and only if all views, from |GetClosestView| up to the top of the view hierarchy are visible.
virtual nsIWidgetGetWindow () const
 Returns the window that contains this frame.
virtual PRBool IsFrameOfType (PRUint32 aFlags) const
 API for doing a quick check if a frame is of a given type.
virtual PRBool IsFloatContainingBlock () const
 Is this frame a containing block for floating elements? Note that very few frames are, so default to false.
virtual nsIViewGetMouseCapturer () const
 Does this frame want to capture the mouse when the user clicks in it or its children? If so, return the view which should be targeted for mouse capture.
void Invalidate (const nsRect &aDamageRect, PRBool aImmediate=PR_FALSE) const
 Invalidate part of the frame by asking the view manager to repaint.
nsRect GetOverflowRect () const
 Computes a rect that includes this frame, all its descendant frames, this frame's outline (if any), and all descendant frames' outlines (if any).
void FinishAndStoreOverflow (nsRect *aOverflowArea, nsSize aNewSize)
 Set/unset the NS_FRAME_OUTSIDE_CHILDREN flag and store the overflow area as a frame property in the frame manager so that it can be retrieved later without reflowing the frame.
void FinishAndStoreOverflow (nsHTMLReflowMetrics *aMetrics)
PRBool IsGeneratedContentFrame ()
 IsGeneratedContentFrame returns whether a frame corresponds to generated content.
PRBool IsPseudoFrame (nsIContent *aParentContent)
 IsPseudoFrame returns whether a frame is a pseudo frame (eg an anonymous table-row frame created for a CSS table-cell without an enclosing table-row.
nsRectGetOverflowAreaProperty (PRBool aCreateIfNecessary=PR_FALSE)
 Create or retrieve the previously stored overflow area, if the frame does not overflow and no creation is required return nsnull.
virtual PRBool SupportsVisibilityHidden ()
 Return PR_TRUE if and only if this frame obeys visibility:hidden.
virtual PRBool IsFocusable (PRInt32 *aTabIndex=nsnull, PRBool aWithMouse=PR_FALSE)
 Check if this frame is focusable and in the current tab order.
PRBool IsBoxFrame () const
PRBool IsBoxWrapped () const
 GetOrdinal (nsBoxLayoutState &aBoxLayoutState, PRUint32 &aOrdinal)
nsresult IsDirty (PRBool &aIsDirty)
nsresult HasDirtyChildren (PRBool &aIsDirty)
nsresult GetChildBox (nsIBox **aBox)
nsresult GetNextBox (nsIBox **aBox)
NS_IMETHOD GetBorderAndPadding (nsMargin &aBorderAndPadding)
nsresult GetInset (nsMargin &aInset)
PRBool IsHorizontal () const
nsresult GetOrientation (PRBool &aIsHorizontal)
 XXX to be removed.
PRBool IsNormalDirection () const
nsresult GetDirection (PRBool &aIsNormal)
 XXX to be removed.
nsPeekOffsetStruct GetExtremeCaretPosition (PRBool aStart)
 gets the first or last possible caret position within the frame

Static Public Member Functions

static voidGetProperty (nsIFrame *aFrame, nsIAtom *aPropertyName, PRBool aCreateIfNecessary=PR_FALSE)
static float GetTwipsToPixels (nsPresContext *aPresContext)
static nscoord RoundToPixel (nscoord aValue, float aPixelToTwips, nsPixelRound aRound=eAlwaysRoundUp)
static void CheckRequestSpecialHeightReflow (const nsHTMLReflowState &aReflowState)
static void RequestSpecialHeightReflow (const nsHTMLReflowState &aReflowState)
static PRBool IsPrematureSpecialHeightReflow (const nsHTMLReflowState &aReflowState, const nsRect &aRect, PRBool aNeedSpecialHeightReflow, nsHTMLReflowMetrics &aMetrics)
static nsresult AppendDirtyReflowCommand (nsIFrame *aFrame)
static void RePositionViews (nsIFrame *aFrame)
static PRBool PageBreakAfter (nsIFrame &aSourceFrame, nsIFrame *aNextFrame)
static NS_METHOD GetTableFrame (nsIFrame *aSourceFrame, nsTableFrame *&aTableFrame)
 helper method to find the table parent of any table frame object
static nsIFrameGetFrameAtOrBefore (nsIFrame *aParentFrame, nsIFrame *aPriorChildFrame, nsIAtom *aChildType)
static PRBool IsPctHeight (nsStyleContext *aStyleContext)
static nsMargin GetBorderPadding (const nsHTMLReflowState &aReflowState, float aPixelToTwips, const nsTableCellFrame *aCellFrame)
static nsMargin GetBorderPadding (const nsSize &aBasis, float aPixelToTwips, const nsTableCellFrame *aCellFrame)
static nsTableRowGroupFrameGetRowGroupFrame (nsIFrame *aFrame, nsIAtom *aFrameTypeIn=nsnull)
 Return aFrame's child if aFrame is an nsScrollFrame, otherwise return aFrame.
static nsresult CreateNextInFlow (nsPresContext *aPresContext, nsIFrame *aOuterFrame, nsIFrame *aFrame, nsIFrame *&aNextInFlowResult)
 Helper method to create next-in-flows if necessary.
static nsresult CreateViewForFrame (nsIFrame *aFrame, nsIFrame *aContentParentFrame, PRBool aForce)
 Helper method to wrap views around frames.
static nsresult ReparentFrameView (nsPresContext *aPresContext, nsIFrame *aChildFrame, nsIFrame *aOldParentFrame, nsIFrame *aNewParentFrame)
static nsresult ReparentFrameViewList (nsPresContext *aPresContext, nsIFrame *aChildFrameList, nsIFrame *aOldParentFrame, nsIFrame *aNewParentFrame)
static PRInt32 LengthOf (nsIFrame *aFrameList)
static void PositionFrameView (nsIFrame *aKidFrame)
 Position the view associated with |aKidFrame|, if there is one.
static void SyncFrameViewAfterReflow (nsPresContext *aPresContext, nsIFrame *aFrame, nsIView *aView, const nsRect *aCombinedArea, PRUint32 aFlags=0)
static void SyncFrameViewAfterSizeChange (nsPresContext *aPresContext, nsIFrame *aFrame, nsStyleContext *aStyleContext, nsIView *aView, PRUint32 aFlags=0)
static void SyncFrameViewProperties (nsPresContext *aPresContext, nsIFrame *aFrame, nsStyleContext *aStyleContext, nsIView *aView, PRUint32 aFlags=0)
static PRBool FrameNeedsView (nsIFrame *aFrame)
static nsresult FinishReflowChild (nsIFrame *aKidFrame, nsPresContext *aPresContext, const nsHTMLReflowState *aReflowState, nsHTMLReflowMetrics &aDesiredSize, nscoord aX, nscoord aY, PRUint32 aFlags)
 The second half of frame reflow.
static void PositionChildViews (nsIFrame *aFrame)
 Position the views of |aFrame|'s descendants.
static void RemoveFromFlow (nsIFrame *aFrame)
static void BreakFromPrevFlow (nsIFrame *aFrame)
static nsresult GetNextPrevLineFromeBlockFrame (nsPresContext *aPresContext, nsPeekOffsetStruct *aPos, nsIFrame *aBlockFrame, PRInt32 aLineStart, PRInt8 aOutSideLimit)
static nsIFrameCorrectStyleParentFrame (nsIFrame *aProspectiveParent, nsIAtom *aChildPseudo)
 Adjust the given parent frame to the right style context parent frame for the child, given the pseudo-type of the prospective child.
static void GetLastLeaf (nsPresContext *aPresContext, nsIFrame **aFrame)
static void GetFirstLeaf (nsPresContext *aPresContext, nsIFrame **aFrame)
static void Shutdown ()
static void AddBorderAndPadding (nsIBox *aBox, nsSize &aSize)
static void AddInset (nsIBox *aBox, nsSize &aSize)
static void AddMargin (nsIBox *aChild, nsSize &aSize)
static void AddMargin (nsSize &aSize, const nsMargin &aMargin)
static void BoundsCheckMinMax (nsSize &aMinSize, nsSize &aMaxSize)
static void BoundsCheck (nsSize &aMinSize, nsSize &aPrefSize, nsSize &aMaxSize)
static void BoundsCheck (nscoord &aMinSize, nscoord &aPrefSize, nscoord &aMaxSize)
static PRBool AddCSSPrefSize (nsBoxLayoutState &aState, nsIBox *aBox, nsSize &aSize)
static PRBool AddCSSMinSize (nsBoxLayoutState &aState, nsIBox *aBox, nsSize &aSize)
static PRBool AddCSSMaxSize (nsBoxLayoutState &aState, nsIBox *aBox, nsSize &aSize)
static PRBool AddCSSFlex (nsBoxLayoutState &aState, nsIBox *aBox, nscoord &aFlex)
static PRBool AddCSSCollapsed (nsBoxLayoutState &aState, nsIBox *aBox, PRBool &aCollapsed)
static PRBool AddCSSOrdinal (nsBoxLayoutState &aState, nsIBox *aBox, PRUint32 &aOrdinal)

Public Attributes

nsresultaStatus = nsnull) const
virtual nsresult *aStatus const
voidaValue
void NSPropertyDtorFunc aDestructor = nsnull
void NSPropertyDtorFunc voidaDtorData = nsnull)
const nsRectaRect = nsnull
const nsRect PRBool aImmediate = PR_FALSE)

Protected Types

enum  eMouseThrough { unset, never, always }

Protected Member Functions

 nsTableFrame ()
 protected constructor.
virtual ~nsTableFrame ()
 destructor, responsible for mColumnLayoutData
void InitChildReflowState (nsHTMLReflowState &aReflowState)
virtual PRIntn GetSkipSides () const
 implement abstract method on nsHTMLContainerFrame
virtual PRBool ParentDisablesSelection () const
NS_METHOD ReflowChildren (nsTableReflowState &aReflowState, PRBool aDoColGroups, PRBool aDirtyOnly, nsReflowStatus &aStatus, nsIFrame *&aLastChildReflowed, nsRect &aOverflowArea, PRBool *aReflowedAtLeastOne=nsnull)
NS_IMETHOD IncrementalReflow (const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
 Incremental Reflow attempts to do column balancing with the minimum number of reflow commands to child elements.
NS_IMETHOD IR_TargetIsChild (nsTableReflowState &aReflowStatet, nsReflowStatus &aStatus, nsIFrame *aNextFrame)
 process an incremental reflow command targeted at a child of this frame.
NS_IMETHOD IR_TargetIsMe (nsTableReflowState &aReflowState, nsReflowStatus &aStatus)
 process an incremental reflow command targeted at this frame.
NS_IMETHOD IR_StyleChanged (nsTableReflowState &aReflowState, nsReflowStatus &aStatus)
 process a style changed notification.
NS_IMETHOD AdjustSiblingsAfterReflow (nsTableReflowState &aReflowState, nsIFrame *aKidFrame, nscoord aDeltaY)
nsresult RecoverState (nsTableReflowState &aReflowState, nsIFrame *aKidFrame)
NS_METHOD CollapseRowGroupIfNecessary (nsIFrame *aRowGroupFrame, const nscoord &aYTotalOffset, nscoord &aYGroupOffset, PRInt32 &aRowX)
NS_METHOD AdjustForCollapsingRows (nsHTMLReflowMetrics &aDesiredSize)
NS_METHOD AdjustForCollapsingCols (nsHTMLReflowMetrics &aDesiredSize)
virtual PRInt32 CalcDesiredWidth (const nsHTMLReflowState &aReflowState)
void CalcDesiredHeight (const nsHTMLReflowState &aReflowState, nsHTMLReflowMetrics &aDesiredSize)
void DistributeHeightToRows (const nsHTMLReflowState &aReflowState, nscoord aAmount)
void PlaceChild (nsTableReflowState &aReflowState, nsIFrame *aKidFrame, nsHTMLReflowMetrics &aKidDesiredSize)
virtual void BalanceColumnWidths (const nsHTMLReflowState &aReflowState)
 assign widths for each column, taking into account the table content, the effective style, the layout constraints, and the compatibility mode.
nsIFrameGetFirstBodyRowGroupFrame ()
PRBool MoveOverflowToChildList (nsPresContext *aPresContext)
 Moves any frames on both the prev-in-flow's overflow list and the receiver's overflow to the receiver's child list.
void PushChildren (const nsAutoVoidArray &aFrames, PRInt32 aPushFrom)
 Push all our child frames from the aFrames array, in order, starting from the frame at aPushFrom to the end of the array.
PRBool HaveReflowedColGroups () const
void SetHaveReflowedColGroups (PRBool aValue)
PRBool DidResizeReflow () const
void SetResizeReflow (PRBool aValue)
void SetBorderCollapse (PRBool aValue)
void CalcBCBorders ()
void ExpandBCDamageArea (nsRect &aRect) const
PRBool HadInitialReflow () const
void SetHadInitialReflow (PRBool aValue)
void SetColumnDimensions (nscoord aHeight, const nsMargin &aReflowState)
PRInt32 CollectRows (nsIFrame *aFrame, nsVoidArray &aCollection)
void PaintSelf (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect)
void PaintSelf (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, PRIntn aSkipSides=0, PRBool aUsePrintBackgroundSettings=PR_TRUE)
 To be called by |Paint| of this class or derived classes to paint the background, border, and outline, when in the correct layer to do so.
void PaintDecorationsAndChildren (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRBool aIsBlock, PRUint32 aFlags=0)
 To be called instead of |PaintChildren| by frames that paint text decorations (block and inline frames).
void PaintTextDecorations (nsIRenderingContext &aRenderingContext, nsIFontMetrics *aFontMetrics, PRUint8 aDecoration, nscolor aColor)
 Helper function to paint text decorations for this frame.
void GetTextDecorations (nsPresContext *aPresContext, PRBool aIsBlock, PRUint8 &aDecorations, nscolor &aUnderColor, nscolor &aOverColor, nscolor &aStrikeColor)
 Fetch the text decorations for this frame.
virtual void PaintTextDecorationLines (nsIRenderingContext &aRenderingContext, nscolor aColor, nscoord aOffset, nscoord aAscent, nscoord aSize)
 Function that does the actual drawing of the textdecoration.
nsresult GetFrameForPointUsing (const nsPoint &aPoint, nsIAtom *aList, nsFramePaintLayer aWhichLayer, PRBool aConsiderSelf, nsIFrame **aFrame)
virtual void PaintChild (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsIFrame *aFrame, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
nsIFrameGetOverflowFrames (nsPresContext *aPresContext, PRBool aRemoveProperty) const
 Get the frames on the overflow list.
nsresult SetOverflowFrames (nsPresContext *aPresContext, nsIFrame *aOverflowFrames)
 Set the overflow list.
void PushChildren (nsPresContext *aPresContext, nsIFrame *aFromChild, nsIFrame *aPrevSibling)
 Push aFromChild and its next siblings to the next-in-flow.
PRInt16 DisplaySelection (nsPresContext *aPresContext, PRBool isOkToTurnOn=PR_FALSE)
NS_IMETHOD GetFrameFromDirection (nsPresContext *aPresContext, nsPeekOffsetStruct *aPos)
NS_IMETHOD DidSetStyleContext (nsPresContext *aPresContext)
nsresult GetSelectionForVisCheck (nsPresContext *aPresContext, nsISelection **aSelection)
NS_IMETHOD GetDataForTableSelection (nsIFrameSelection *aFrameSelection, nsIPresShell *aPresShell, nsMouseEvent *aMouseEvent, nsIContent **aParentContent, PRInt32 *aContentOffset, PRInt32 *aTarget)
void SetOverflowClipRect (nsIRenderingContext &aRenderingContext)
NS_IMETHOD DoLayout (nsBoxLayoutState &aBoxLayoutState)
virtual PRBool HasStyleChange ()
virtual void SetStyleChangeFlag (PRBool aDirty)
virtual PRBool GetWasCollapsed (nsBoxLayoutState &aState)
virtual void SetWasCollapsed (nsBoxLayoutState &aState, PRBool aWas)
void InitBoxMetrics (PRBool aClear)
nsBoxLayoutMetricsBoxMetrics () const
void FireDOMEvent (const nsAString &aDOMEventName, nsIContent *aContent=nsnull)
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)
 NS_HIDDEN_ (nsresult) BeginLayout(nsBoxLayoutState &aState)
 NS_HIDDEN_ (nsresult) EndLayout(nsBoxLayoutState &aState)
virtual PRBool GetDefaultFlex (PRInt32 &aFlex)
virtual void GetLayoutFlags (PRUint32 &aFlags)

Static Protected Member Functions

static PRInt32 GetLineNumber (nsIFrame *aFrame)
static void FillCursorInformationFromStyle (const nsStyleUserInterface *ui, nsIFrame::Cursor &aCursor)

Protected Attributes

nsAutoVoidArray mColFrames
struct nsTableFrame::TableBits mBits
nsTableCellMapmCellMap
nsITableLayoutStrategymTableLayoutStrategy
nsFrameList mColGroups
nscoord mMinWidth
nscoord mDesiredWidth
nscoord mPreferredWidth
nsFrameList mFrames
nsIFramemPrevInFlow
nsIFramemNextInFlow
nsRect mRect
nsIContentmContent
nsStyleContextmStyleContext
nsIFramemParent
nsIFramemNextSibling
nsFrameState mState

Static Protected Attributes

static PRBool gGotTheme = PR_FALSE
static nsIThemegTheme = nsnull

Friends

class nsTableOuterFrame
 nsTableOuterFrame has intimate knowledge of the inner table frame
nsresult NS_NewTableFrame (nsIPresShell *aPresShell, nsIFrame **aResult)
 instantiate a new instance of nsTableFrame.
nsresult NS_NewEmptyFrame (nsIPresShell *aShell, nsIFrame **aInstancePtrResult)
 Create a new "empty" frame that maps a given piece of content into a 0,0 area.
class nsIFrame

Detailed Description

nsTableFrame maps the inner portion of a table (everything except captions.) Used as a pseudo-frame within nsTableOuterFrame, it may also be used stand-alone as the top-level frame.

The flowed child list contains row group frames. There is also an additional named child list:

See also:
nsLayoutAtoms::colGroupList

Definition at line 175 of file nsTableFrame.h.


Class Documentation

struct nsTableFrame::TableBits

Definition at line 887 of file nsTableFrame.h.

Class Members
PRUint32 __pad0__:9
PRUint32 mCellSpansPctCol:1
PRUint32 mDidResizeReflow:1
PRUint32 mHadInitialReflow:1
PRUint32 mHasPctCol:1
PRUint32 mHaveReflowedColGroups:1
PRUint32 mInitiatedSpecialReflow:1
PRUint32 mIsBorderCollapse:1
PRUint32 mLeftContBCBorder:8
PRUint32 mNeedSpecialReflow:1
PRUint32 mNeedStrategyBalance:1
PRUint32 mNeedStrategyInit:1
PRUint32 mNeedToCalcBCBorders:1
PRUint32 mNeedToCollapseColumns:1
PRUint32 mNeedToCollapseRows:1
PRUint32 mNeedToInitiateSpecialReflow:1
PRUint32 mRowInserted:1

Member Enumeration Documentation

anonymous enum [inherited]

Bit-flags to pass to IsFrameOfType()

Enumerator:
eMathML 
eSVG 
eSVGForeignObject 

Definition at line 1082 of file nsIFrame.h.

       {
    eMathML =           1 << 0,
    eSVG =              1 << 1,
    eSVGForeignObject = 1 << 2
  };
enum nsBox::eMouseThrough [protected, inherited]
Enumerator:
unset 
never 
always 

Definition at line 168 of file nsBox.h.

                     {
    unset,
    never,
    always
  };
enum nsIFrame::Halignment [inherited]
Enumerator:
hAlign_Left 
hAlign_Right 
hAlign_Center 

Definition at line 1382 of file nsIFrame.h.

enum nsIFrame::Valignment [inherited]
Enumerator:
vAlign_Top 
vAlign_Middle 
vAlign_BaseLine 
vAlign_Bottom 

Definition at line 1388 of file nsIFrame.h.


Constructor & Destructor Documentation

nsTableFrame::nsTableFrame ( ) [protected]

protected constructor.

See also:
NewFrame

Definition at line 202 of file nsTableFrame.cpp.

  : nsHTMLContainerFrame(),
    mCellMap(nsnull),
    mTableLayoutStrategy(nsnull),
    mPreferredWidth(0)
{
  mBits.mHadInitialReflow       = PR_FALSE;
  mBits.mHaveReflowedColGroups  = PR_FALSE;
  mBits.mNeedStrategyInit       = PR_TRUE;
  mBits.mNeedStrategyBalance    = PR_TRUE;
  mBits.mCellSpansPctCol        = PR_FALSE;
  mBits.mNeedToCalcBCBorders    = PR_FALSE;
  mBits.mIsBorderCollapse       = PR_FALSE;

#ifdef DEBUG_TABLE_REFLOW_TIMING
  mTimer = new nsReflowTimer(this);
  nsReflowTimer* timer = new nsReflowTimer(this);
  mTimer->mNextSibling = timer;
  timer = new nsReflowTimer(this);
  mTimer->mNextSibling->mNextSibling = timer;
  timer = new nsReflowTimer(this);
  mTimer->mNextSibling->mNextSibling->mNextSibling = timer;
  timer = new nsReflowTimer(this);
  mTimer->mNextSibling->mNextSibling->mNextSibling->mNextSibling = timer;
  timer = new nsReflowTimer(this);
  mTimer->mNextSibling->mNextSibling->mNextSibling->mNextSibling->mNextSibling = timer;
#endif
}
nsTableFrame::~nsTableFrame ( ) [protected, virtual]

destructor, responsible for mColumnLayoutData

Definition at line 292 of file nsTableFrame.cpp.

{
  if (nsnull!=mCellMap) {
    delete mCellMap; 
    mCellMap = nsnull;
  }

  if (nsnull!=mTableLayoutStrategy) {
    delete mTableLayoutStrategy;
    mTableLayoutStrategy = nsnull;
  }
#ifdef DEBUG_TABLE_REFLOW_TIMING
  nsTableFrame::DebugReflowDone(this);
#endif
}

Member Function Documentation

void nsBox::AddBorderAndPadding ( nsSize aSize) [inherited]

Definition at line 1203 of file nsBox.cpp.

{
  AddBorderAndPadding(this, aSize);
}

Here is the caller graph for this function:

void nsBox::AddBorderAndPadding ( nsIBox *  aBox,
nsSize aSize 
) [static, inherited]

Definition at line 1215 of file nsBox.cpp.

{
  nsMargin borderPadding(0,0,0,0);
  aBox->GetBorderAndPadding(borderPadding);
  AddMargin(aSize, borderPadding);
}

Here is the call graph for this function:

static PRBool nsIFrame::AddCSSCollapsed ( nsBoxLayoutState aState,
nsIBox *  aBox,
PRBool aCollapsed 
) [static, inherited]

Here is the caller graph for this function:

static PRBool nsIFrame::AddCSSFlex ( nsBoxLayoutState aState,
nsIBox *  aBox,
nscoord aFlex 
) [static, inherited]

Here is the caller graph for this function:

static PRBool nsIFrame::AddCSSMaxSize ( nsBoxLayoutState aState,
nsIBox *  aBox,
nsSize aSize 
) [static, inherited]

Here is the caller graph for this function:

static PRBool nsIFrame::AddCSSMinSize ( nsBoxLayoutState aState,
nsIBox *  aBox,
nsSize aSize 
) [static, inherited]

Here is the caller graph for this function:

static PRBool nsIFrame::AddCSSOrdinal ( nsBoxLayoutState aState,
nsIBox *  aBox,
PRUint32 aOrdinal 
) [static, inherited]

Here is the caller graph for this function:

static PRBool nsIFrame::AddCSSPrefSize ( nsBoxLayoutState aState,
nsIBox *  aBox,
nsSize aSize 
) [static, inherited]

Here is the caller graph for this function:

void nsBox::AddInset ( nsSize aSize) [inline, inherited]

Definition at line 124 of file nsBox.h.

{ AddInset(this, aSize); }

Here is the call graph for this function:

Here is the caller graph for this function:

static void nsBox::AddInset ( nsIBox *  aBox,
nsSize aSize 
) [inline, static, inherited]

Definition at line 131 of file nsBox.h.

{}
void nsBox::AddMargin ( nsSize aSize) [inherited]

Definition at line 1209 of file nsBox.cpp.

{
  AddMargin(this, aSize);
}

Here is the caller graph for this function:

void nsBox::AddMargin ( nsIBox *  aChild,
nsSize aSize 
) [static, inherited]

Definition at line 1223 of file nsBox.cpp.

{
  nsMargin margin(0,0,0,0);
  aChild->GetMargin(margin);
  AddMargin(aSize, margin);
}

Here is the call graph for this function:

void nsBox::AddMargin ( nsSize aSize,
const nsMargin aMargin 
) [static, inherited]

Definition at line 1231 of file nsBox.cpp.

{
  if (aSize.width != NS_INTRINSICSIZE)
    aSize.width += aMargin.left + aMargin.right;

  if (aSize.height != NS_INTRINSICSIZE)
     aSize.height += aMargin.top + aMargin.bottom;
}
void nsIFrame::AddStateBits ( nsFrameState  aBits) [inline, inherited]

Update the current frame-state value for this frame.

Definition at line 823 of file nsIFrame.h.

{ mState |= aBits; }

Definition at line 2424 of file nsTableFrame.cpp.

{
  nsTableCellMap* cellMap = GetCellMap();
  if (!cellMap) return NS_OK;
   // reset the bit, it will be set again if col/colgroup is collapsed
  SetNeedToCollapseColumns(PR_FALSE);
 
  PRInt32 numRows = cellMap->GetRowCount();
  nsTableIterator groupIter(mColGroups, eTableDIR);
  nsIFrame* groupFrame = groupIter.First(); 
  nscoord cellSpacingX = GetCellSpacingX();
  nscoord xOffset = 0;
  PRInt32 colX = (groupIter.IsLeftToRight()) ? 0 : GetColCount() - 1; 
  PRInt32 direction = (groupIter.IsLeftToRight()) ? 1 : -1; 
  // iterate over the col groups
  while (nsnull != groupFrame) {
    const nsStyleVisibility* groupVis = groupFrame->GetStyleVisibility();
    
    PRBool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE == groupVis->mVisible);
    if (collapseGroup) {
      SetNeedToCollapseColumns(PR_TRUE);
    }
    nsTableIterator colIter(*groupFrame, eTableDIR);
    nsIFrame* colFrame = colIter.First();
    // iterate over the cols in the col group
    while (nsnull != colFrame) {
      const nsStyleDisplay* colDisplay = colFrame->GetStyleDisplay();
      if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay) {
        const nsStyleVisibility* colVis = colFrame->GetStyleVisibility();
        PRBool collapseCol = (NS_STYLE_VISIBILITY_COLLAPSE == colVis->mVisible);
        if (collapseCol) {
          SetNeedToCollapseColumns(PR_TRUE);
        }
        PRInt32 colWidth = GetColumnWidth(colX);
        if (collapseGroup || collapseCol) {
          xOffset += colWidth + cellSpacingX;
        }
        nsTableCellFrame* lastCell  = nsnull;
        nsTableCellFrame* cellFrame = nsnull;
        for (PRInt32 rowX = 0; rowX < numRows; rowX++) {
          CellData* cellData = cellMap->GetDataAt(rowX, colX);
          if (cellData) {
            if (cellData->IsOrig()) { // the cell originates at (rowX, colX)
              cellFrame = cellData->GetCellFrame();
              // reset the collapse offsets since they may have been collapsed previously
              cellFrame->SetCollapseOffsetX(0);
              cellFrame->SetCollapseOffsetY(0);
              nsRect cellRect = cellFrame->GetRect();
              if (collapseGroup || collapseCol) {
                if (lastCell != cellFrame) { // do it only once if there is a row span
                  cellRect.width -= colWidth;
                  cellFrame->SetCollapseOffsetX(-xOffset);
                }
              } else { // the cell is not in a collapsed col but needs to move
                cellRect.x -= xOffset;
              }
              cellFrame->SetRect(cellRect);
              // if the cell does not originate at (rowX, colX), adjust the real cells width
            } else if (collapseGroup || collapseCol) { 
              if (cellData->IsColSpan()) {
                cellFrame = cellMap->GetCellFrame(rowX, colX, *cellData, PR_FALSE);
              }
              if ((cellFrame) && (lastCell != cellFrame)) {
                nsRect cellRect = cellFrame->GetRect();
                cellRect.width -= colWidth + cellSpacingX;
                cellFrame->SetRect(cellRect);
              }
            }
          }
          lastCell = cellFrame;
        }
        colX += direction;
      }
      colFrame = colIter.Next();
    } // inner while
    groupFrame = groupIter.Next();
  } // outer while

  aDesiredSize.width -= xOffset;
 
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2395 of file nsTableFrame.cpp.

{
  nscoord yGroupOffset = 0; // total offset among rows within a single row group
  nscoord yTotalOffset = 0; // total offset among all rows in all row groups
  PRInt32 rowIndex = 0;
  // reset the bit, it will be set again if row/rowgroup is collapsed
  SetNeedToCollapseRows(PR_FALSE); 
  
  // collapse the rows and/or row groups as necessary
  // Get the ordered children
  nsAutoVoidArray rowGroups;
  PRUint32 numRowGroups;
  OrderRowGroups(rowGroups, numRowGroups);
  
  // Walk the list of children
  for (PRUint32 childX = 0; childX < numRowGroups; childX++) {
    nsIFrame* childFrame = (nsIFrame*)rowGroups.ElementAt(childX);
    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(childFrame);
    if (!rgFrame) continue; // skip foreign frame types
    CollapseRowGroupIfNecessary(rgFrame, yTotalOffset, yGroupOffset, rowIndex);
    yTotalOffset += yGroupOffset;
    yGroupOffset = 0;
  } 

  aDesiredSize.height -= yTotalOffset;
 
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::AdjustFrameSize ( nscoord  aExtraSpace,
nscoord aUsedSpace 
) [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsTextFrame.

Definition at line 2246 of file nsFrame.cpp.

{
  aUsedSpace = 0;
  return NS_OK;
}
virtual void nsIFrame::AdjustOffsetsForBidi ( PRInt32  aStart,
PRInt32  aEnd 
) [inline, virtual, inherited]

Reset the offsets when splitting frames during Bidi reordering.

Reimplemented in nsTextFrame.

Definition at line 573 of file nsIFrame.h.

{}

Here is the caller graph for this function:

void nsTableFrame::AdjustRowIndices ( PRInt32  aRowIndex,
PRInt32  aAdjustment 
)

Iterate over the row groups and adjust the row indices of all rows whose index is >= aRowIndex.

Parameters:
aRowIndex- start adjusting with this index
aAdjustment- shift the row index by this amount

Definition at line 629 of file nsTableFrame.cpp.

{
  // Iterate over the row groups and adjust the row indices of all rows 
  // whose index is >= aRowIndex.
  nsAutoVoidArray rowGroups;
  PRUint32 numRowGroups;
  OrderRowGroups(rowGroups, numRowGroups, nsnull);

  for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) {
    nsIFrame* kidFrame = (nsIFrame*)rowGroups.ElementAt(rgX);
    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(kidFrame);
    rgFrame->AdjustRowIndices(aRowIndex, aAdjustment);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsTableFrame::AdjustSiblingsAfterReflow ( nsTableReflowState aReflowState,
nsIFrame aKidFrame,
nscoord  aDeltaY 
) [protected]

Definition at line 1567 of file nsTableFrame.cpp.

{
  NS_PRECONDITION(NS_UNCONSTRAINEDSIZE == aReflowState.reflowState.availableHeight,
                  "we're not in galley mode");

  nscoord yInvalid = NS_UNCONSTRAINEDSIZE;

  // Get the ordered children and find aKidFrame in the list
  nsAutoVoidArray rowGroups;
  PRUint32 numRowGroups;
  OrderRowGroups(rowGroups, numRowGroups, nsnull);
  PRUint32 changeIndex;
  for (changeIndex = 0; changeIndex < numRowGroups; changeIndex++) {
    if (aKidFrame == rowGroups.ElementAt(changeIndex)) {
      break;
    }
  }
  changeIndex++; // set it to the next sibling

  for (PRUint32 rgX = changeIndex; rgX < numRowGroups; rgX++) {
    nsIFrame* kidFrame = (nsIFrame*)rowGroups.ElementAt(rgX);
    // Move the frames that follow aKidFrame by aDeltaY, and update the running
    // y-offset
    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(kidFrame);
    if (!rgFrame) continue; // skip foreign frames

    // Get the frame's bounding rect
    nsRect kidRect = kidFrame->GetRect();
    yInvalid = PR_MIN(yInvalid, kidRect.y);
  
    // Adjust the running y-offset
    aReflowState.y += kidRect.height;
 
    // Adjust the y-origin if its position actually changed
    if (aDeltaY != 0) {
      kidRect.y += aDeltaY;
      kidFrame->SetPosition(nsPoint(kidRect.x, kidRect.y));
      RePositionViews(kidFrame);
    }
  }
  
  // Invalidate the area we offset.
  if (NS_UNCONSTRAINEDSIZE != yInvalid) {
    nsRect  dirtyRect(0, yInvalid, mRect.width, mRect.height - yInvalid);
    // XXX what if some of the cells have outlines?
    Invalidate(dirtyRect);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::AppendCell ( nsTableCellFrame aCellFrame,
PRInt32  aRowIndex 
) [virtual]

Definition at line 1017 of file nsTableFrame.cpp.

{
  nsTableCellMap* cellMap = GetCellMap();
  if (cellMap) {
    nsRect damageArea(0,0,0,0);
    cellMap->AppendCell(aCellFrame, aRowIndex, PR_TRUE, damageArea);
    MatchCellMapToColCache(cellMap);
    if (IsBorderCollapse()) {
      SetBCDamageArea(damageArea);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 345 of file nsTableFrame.cpp.

{
  aFrame->AddStateBits(NS_FRAME_IS_DIRTY);  // mark the table frame as dirty

  return aFrame->GetPresContext()->PresShell()->
          AppendReflowCommand(aFrame, eReflowType_ReflowDirty, nsnull);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsTableFrame::AppendFrames ( nsIAtom aListName,
nsIFrame aFrameList 
) [virtual]

This method is responsible for appending frames to the frame list.

The implementation should append the frames to the specified child list and then generate a reflow command.

Parameters:
aListNamethe name of the child list. A NULL pointer for the atom name means the unnamed principal child list
aFrameListlist of child frames to append. Each of the frames has its NS_FRAME_IS_DIRTY bit set
Returns:
NS_ERROR_INVALID_ARG if there is no child list with the specified name, NS_ERROR_UNEXPECTED if the frame is an atomic frame, NS_OK otherwise

Reimplemented from nsFrame.

Definition at line 2508 of file nsTableFrame.cpp.

{
  // Because we actually have two child lists, one for col group frames and one
  // for everything else, we need to look at each frame individually
  nsIFrame* f = aFrameList;
  while (f) {
    // Get the next frame and disconnect this frame from its sibling
    nsIFrame* next = f->GetNextSibling();
    f->SetNextSibling(nsnull);

    // See what kind of frame we have
    const nsStyleDisplay* display = f->GetStyleDisplay();

    if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay) {
      nsTableColGroupFrame* lastColGroup;
      PRBool doAppend = nsTableColGroupFrame::GetLastRealColGroup(this, (nsIFrame**) &lastColGroup);
      PRInt32 startColIndex = (lastColGroup) 
        ? lastColGroup->GetStartColumnIndex() + lastColGroup->GetColCount() : 0;
      if (doAppend) {
        // Append the new col group frame
        mColGroups.AppendFrame(nsnull, f);
      }
      else {
        // there is a colgroup after the last real one
          mColGroups.InsertFrame(nsnull, lastColGroup, f);
      }
      // Insert the colgroup and its cols into the table
      InsertColGroups(startColIndex, f, f);
    } else if (IsRowGroup(display->mDisplay)) {
      // Append the new row group frame to the sibling chain
      mFrames.AppendFrame(nsnull, f);

      // insert the row group and its rows into the table
      InsertRowGroups(f, f);
    } else {
      // Nothing special to do, just add the frame to our child list
      mFrames.AppendFrame(nsnull, f);
    }

    // Move to the next frame
    f = next;
  }

#ifdef DEBUG_TABLE_CELLMAP
  printf("=== TableFrame::AppendFrames\n");
  Dump(PR_TRUE, PR_TRUE, PR_TRUE);
#endif
  SetNeedStrategyInit(PR_TRUE); // XXX assume the worse
  AppendDirtyReflowCommand(this);

  return NS_OK;
}

Here is the call graph for this function:

void nsTableFrame::AppendRowGroups ( nsIFrame aFirstRowGroupFrame)

Insert multiple rowgroups into the table cellmap handling.

Parameters:
aFirstRowGroupFrame- first row group to be inserted all siblings will be appended too.

Definition at line 1211 of file nsTableFrame.cpp.

{
  if (aFirstRowGroupFrame) {
    nsTableCellMap* cellMap = GetCellMap();
    if (cellMap) {
      nsFrameList newList(aFirstRowGroupFrame);
      InsertRowGroups(aFirstRowGroupFrame, newList.LastChild());
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::AppendRows ( nsTableRowGroupFrame aRowGroupFrame,
PRInt32  aRowIndex,
nsVoidArray aRowFrames 
)

Definition at line 1106 of file nsTableFrame.cpp.

{
  nsTableCellMap* cellMap = GetCellMap();
  if (cellMap) {
    PRInt32 absRowIndex = GetStartRowIndex(aRowGroupFrame) + aRowIndex;
    InsertRows(aRowGroupFrame, aRowFrames, absRowIndex, PR_TRUE);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsIFrame::AreAncestorViewsVisible ( ) const [virtual, inherited]

Returns true if and only if all views, from |GetClosestView| up to the top of the view hierarchy are visible.

Definition at line 2546 of file nsFrame.cpp.

{
  for (nsIView* view = GetClosestView(); view; view = view->GetParent()) {
    if (view->GetVisibility() == nsViewVisibility_kHide) {
      return PR_FALSE;
    }
  }
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::AttributeChanged ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [virtual, inherited]

This call is invoked when the value of a content objects's attribute is changed.

The first frame that maps that content is asked to deal with the change by doing whatever is appropriate.

Parameters:
aChildthe piece of content whose attribute changed
aNameSpaceIDthe namespace of the attribute
aAttributethe atom name of the attribute
aModTypeWhether or not the attribute was added, changed, or removed. The constants are defined in nsIDOMMutationEvent.h.

Implements nsIFrame.

Reimplemented in nsMenuFrame, nsSVGOuterSVGFrame, nsMathMLContainerFrame, nsTextControlFrame, nsSliderFrame, nsMenuPopupFrame, nsBoxFrame, nsSubDocumentFrame, nsSVGTextFrame, nsMathMLmfracFrame, nsSVGInnerSVGFrame, nsGfxButtonControlFrame, nsTableCellFrame, nsLeafBoxFrame, nsSVGGenericContainerFrame, nsMathMLmoFrame, nsImageBoxFrame, nsSVGPathGeometryFrame, nsMathMLTokenFrame, nsMathMLmfencedFrame, nsMathMLmoverFrame, nsMathMLmunderFrame, nsMathMLmunderoverFrame, nsListBoxBodyFrame, nsNativeScrollbarFrame, nsResizerFrame, nsTextBoxFrame, nsScrollbarFrame, nsSplitterFrame, nsTreeColFrame, nsProgressMeterFrame, nsDeckFrame, and nsMathMLmstyleFrame.

Definition at line 2273 of file nsFrame.cpp.

{
  return NS_OK;
}
void nsTableFrame::AttributeChangedFor ( nsIFrame aFrame,
nsIContent aContent,
nsIAtom aAttribute 
)

Definition at line 464 of file nsTableFrame.cpp.

{
  if (IS_TABLE_CELL(aFrame->GetType())) {
    if ((nsHTMLAtoms::rowspan == aAttribute) || 
        (nsHTMLAtoms::colspan == aAttribute)) {
      nsTableCellMap* cellMap = GetCellMap();
      if (cellMap) {
        // for now just remove the cell from the map and reinsert it
        nsTableCellFrame* cellFrame = (nsTableCellFrame*)aFrame;
        PRInt32 rowIndex, colIndex;
        cellFrame->GetRowIndex(rowIndex);
        cellFrame->GetColIndex(colIndex);
        RemoveCell(cellFrame, rowIndex);
        nsAutoVoidArray cells;
        cells.AppendElement(cellFrame);
        InsertCells(cells, rowIndex, colIndex - 1);

        // XXX This could probably be optimized with some effort
        SetNeedStrategyInit(PR_TRUE);
        AppendDirtyReflowCommand(this);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::BalanceColumnWidths ( const nsHTMLReflowState aReflowState) [protected, virtual]

assign widths for each column, taking into account the table content, the effective style, the layout constraints, and the compatibility mode.

Now I've got all the cells laid out in an infinite space.

Parameters:
aTableStylethe resolved style for the table
aMaxSizethe height and width constraints
aMaxElementSizethe min size of the largest indivisible object

For each column, use the min size for each cell in that column along with the attributes of the table, column group, and column to assign widths to each column.

Definition at line 3453 of file nsTableFrame.cpp.

{
  NS_ASSERTION(!mPrevInFlow, "never ever call me on a continuing frame!");

  // fixed-layout tables need to reinitialize the layout strategy. When there are scroll bars
  // reflow gets called twice and the 2nd time has the correct space available.
  // XXX this is very bad and needs to be changed
  if (!IsAutoLayout()) {
    mTableLayoutStrategy->Initialize(aReflowState);
  }

  // need to figure out the overall table width constraint
  // default case, get 100% of available space

  mTableLayoutStrategy->BalanceColumnWidths(aReflowState);
  //Dump(PR_TRUE, PR_TRUE);
  SetNeedStrategyBalance(PR_FALSE);                    // we have just balanced
  // cache the min, desired, and preferred widths
  nscoord minWidth, prefWidth;
  CalcMinAndPreferredWidths(aReflowState, PR_FALSE, minWidth, prefWidth);
  SetMinWidth(minWidth); 
  nscoord desWidth = CalcDesiredWidth(aReflowState);
  SetDesiredWidth(desWidth);          
  SetPreferredWidth(prefWidth); 

}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsBox::BoundsCheck ( nsSize aMinSize,
nsSize aPrefSize,
nsSize aMaxSize 
) [static, inherited]

Definition at line 1275 of file nsBox.cpp.

{
   BoundsCheck(aMinSize.width, aPrefSize.width, aMaxSize.width);
   BoundsCheck(aMinSize.height, aPrefSize.height, aMaxSize.height);
}

Here is the caller graph for this function:

void nsBox::BoundsCheck ( nscoord aMinSize,
nscoord aPrefSize,
nscoord aMaxSize 
) [static, inherited]

Definition at line 1251 of file nsBox.cpp.

{
   if (aMax < aMin)
       aMax = aMin;

   if (aPref > aMax)
       aPref = aMax;

   if (aPref < aMin)
       aPref = aMin;
}
void nsBox::BoundsCheckMinMax ( nsSize aMinSize,
nsSize aMaxSize 
) [static, inherited]

Definition at line 1264 of file nsBox.cpp.

{
  if (aMaxSize.width < aMinSize.width) {
    aMaxSize.width = aMinSize.width;
  }

  if (aMaxSize.height < aMinSize.height)
    aMaxSize.height = aMinSize.height;
}

Here is the caller graph for this function:

nsBoxLayoutMetrics * nsFrame::BoxMetrics ( ) const [protected, inherited]

Definition at line 5770 of file nsFrame.cpp.

{
  nsBoxLayoutMetrics* metrics =
    NS_STATIC_CAST(nsBoxLayoutMetrics*, GetProperty(nsLayoutAtoms::boxMetricsProperty));
  NS_ASSERTION(metrics, "A box layout method was called but InitBoxMetrics was never called");
  return metrics;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsSplittableFrame::BreakFromPrevFlow ( nsIFrame aFrame) [static, inherited]

Definition at line 144 of file nsSplittableFrame.cpp.

{
  nsIFrame* prevInFlow = aFrame->GetPrevInFlow();
  if (prevInFlow) {
    prevInFlow->SetNextInFlow(nsnull);
    aFrame->SetPrevInFlow(nsnull);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 5865 of file nsTableFrame.cpp.

{
  nsTableCellMap* tableCellMap = GetCellMap(); if (!tableCellMap) ABORT0();
  PRInt32 numRows = GetRowCount();
  PRInt32 numCols = GetColCount();
  
  // Get the property holding the table damage area and border widths
  BCPropertyData* propData = 
    (BCPropertyData*)nsTableFrame::GetProperty(this, nsLayoutAtoms::tableBCProperty, PR_FALSE);
  if (!propData) ABORT0();

  PRBool tableIsLTR = GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_LTR;
  PRUint8 firstSide, secondSide;
  if (tableIsLTR) {
    firstSide  = NS_SIDE_LEFT;
    secondSide = NS_SIDE_RIGHT;
  }
  else {
    firstSide  = NS_SIDE_RIGHT;
    secondSide = NS_SIDE_LEFT;
  }
  CheckFixDamageArea(numRows, numCols, propData->mDamageArea);
  // calculate an expanded damage area 
  nsRect damageArea(propData->mDamageArea);
  ExpandBCDamageArea(damageArea);

  // segments that are on the table border edges need to be initialized only once
  PRBool tableBorderReset[4];
  for (PRUint32 sideX = NS_SIDE_TOP; sideX <= NS_SIDE_LEFT; sideX++) {
    tableBorderReset[sideX] = PR_FALSE;
  }
  GET_TWIPS_TO_PIXELS(GetPresContext(), t2p);

  // vertical borders indexed in x-direction (cols)
  BCCellBorders lastVerBorders(damageArea.width + 1, damageArea.x); if (!lastVerBorders.borders) ABORT0();
  BCCellBorder  lastTopBorder, lastBottomBorder;
  // horizontal borders indexed in x-direction (cols)
  BCCellBorders lastBottomBorders(damageArea.width + 1, damageArea.x); if (!lastBottomBorders.borders) ABORT0();
  PRBool startSeg;
  PRBool gotRowBorder = PR_FALSE;

  BCMapCellInfo  info, ajaInfo;
  BCCellBorder currentBorder, adjacentBorder;
  PRInt32   cellEndRowIndex = -1;
  PRInt32   cellEndColIndex = -1;
  BCCorners topCorners(damageArea.width + 1, damageArea.x); if (!topCorners.corners) ABORT0();
  BCCorners bottomCorners(damageArea.width + 1, damageArea.x); if (!bottomCorners.corners) ABORT0();

  BCMapCellIterator iter(*this, damageArea);
  for (iter.First(info); !iter.mAtEnd; iter.Next(info)) {

    cellEndRowIndex = info.rowIndex + info.rowSpan - 1;
    cellEndColIndex = info.colIndex + info.colSpan - 1;
    
    PRBool bottomRowSpan = PR_FALSE;
    // see if lastTopBorder, lastBottomBorder need to be reset
    if (iter.IsNewRow()) { 
      gotRowBorder = PR_FALSE;
      lastTopBorder.Reset(info.rowIndex, info.rowSpan);
      lastBottomBorder.Reset(cellEndRowIndex + 1, info.rowSpan);
    }
    else if (info.colIndex > damageArea.x) {
      lastBottomBorder = lastBottomBorders[info.colIndex - 1];
      if (info.rowIndex > lastBottomBorder.rowIndex - lastBottomBorder.rowSpan) { 
        // the top border's left edge butts against the middle of a rowspan
        lastTopBorder.Reset(info.rowIndex, info.rowSpan);
      }
      if (lastBottomBorder.rowIndex > (cellEndRowIndex + 1)) {
        // the bottom border's left edge butts against the middle of a rowspan
        lastBottomBorder.Reset(cellEndRowIndex + 1, info.rowSpan);
        bottomRowSpan = PR_TRUE;
      }
    }

    // find the dominant border considering the cell's top border and the table, row group, row
    // if the border is at the top of the table, otherwise it was processed in a previous row
    if (0 == info.rowIndex) {
      if (!tableBorderReset[NS_SIDE_TOP]) {
        propData->mTopBorderWidth = 0;
        tableBorderReset[NS_SIDE_TOP] = PR_TRUE;
      }
      for (PRInt32 colX = info.colIndex; colX <= cellEndColIndex; colX++) {
        nsIFrame* colFrame = GetColFrame(colX); if (!colFrame) ABORT0();
        nsIFrame* cgFrame = colFrame->GetParent(); if (!cgFrame) ABORT0();
        currentBorder = CompareBorders(this, cgFrame, colFrame, info.rg, info.topRow,
                                       info.cell, tableIsLTR, TABLE_EDGE, NS_SIDE_TOP,
                                       !ADJACENT, t2p);
        // update/store the top left & top right corners of the seg 
        BCCornerInfo& tlCorner = topCorners[colX]; // top left
        if (0 == colX) {
          tlCorner.Set(NS_SIDE_RIGHT, currentBorder); // we are on right hand side of the corner
        }
        else {
          tlCorner.Update(NS_SIDE_RIGHT, currentBorder);
          tableCellMap->SetBCBorderCorner(eTopLeft, *info.cellMap, 0, 0, colX,
                                          tlCorner.ownerSide, tlCorner.subWidth, tlCorner.bevel);
        }
        topCorners[colX + 1].Set(NS_SIDE_LEFT, currentBorder); // top right
        // update lastTopBorder and see if a new segment starts
        startSeg = SetHorBorder(currentBorder, tlCorner, lastTopBorder);
        // store the border segment in the cell map
        tableCellMap->SetBCBorderEdge(NS_SIDE_TOP, *info.cellMap, 0, 0, colX,
                                      1, currentBorder.owner, currentBorder.width, startSeg);
        // update the affected borders of the cell, row, and table
        if (info.cell) {
          info.cell->SetBorderWidth(NS_SIDE_TOP, PR_MAX(currentBorder.width, info.cell->GetBorderWidth(NS_SIDE_TOP)));
        }
        if (info.topRow) {
          BCPixelSize half = BC_BORDER_BOTTOM_HALF(currentBorder.width);
          info.topRow->SetTopBCBorderWidth(PR_MAX(half, info.topRow->GetTopBCBorderWidth()));
        }
        propData->mTopBorderWidth = LimitBorderWidth(PR_MAX(propData->mTopBorderWidth, (PRUint8)currentBorder.width));
        //calculate column continuous borders
        //we only need to do this once, so we'll do it only on the first row
        currentBorder = CompareBorders(this, cgFrame, colFrame, info.rg,
                                       info.topRow, nsnull, tableIsLTR, 
                                       TABLE_EDGE, NS_SIDE_TOP, !ADJACENT, t2p);
        ((nsTableColFrame*)colFrame)->SetContinuousBCBorderWidth(NS_SIDE_TOP,
                                                                 currentBorder.width);
        if (numCols == cellEndColIndex + 1) {
          currentBorder = CompareBorders(this, cgFrame, colFrame, nsnull,
                                         nsnull, nsnull, tableIsLTR, TABLE_EDGE,
                                         NS_SIDE_RIGHT, !ADJACENT, t2p);
        }
        else {
          currentBorder = CompareBorders(nsnull, cgFrame, colFrame, nsnull,
                                         nsnull, nsnull, tableIsLTR, !TABLE_EDGE,
                                         NS_SIDE_RIGHT, !ADJACENT, t2p);
        }
        ((nsTableColFrame*)colFrame)->SetContinuousBCBorderWidth(NS_SIDE_RIGHT,
                                                                 currentBorder.width);
        
      }
      //calculate continuous top first row & rowgroup border: special case
      //because it must include the table in the collapse
      if (info.topRow) {
        currentBorder = CompareBorders(this, nsnull, nsnull, info.rg,
                                       info.topRow, nsnull, tableIsLTR,
                                       TABLE_EDGE, NS_SIDE_TOP, !ADJACENT, t2p);
        info.topRow->SetContinuousBCBorderWidth(NS_SIDE_TOP, currentBorder.width);
      }
      if (info.cgRight && info.cg) {
        //calculate continuous top colgroup border once per colgroup
        currentBorder = CompareBorders(this, info.cg, nsnull, info.rg,
                                       info.topRow, nsnull, tableIsLTR, 
                                       TABLE_EDGE, NS_SIDE_TOP, !ADJACENT, t2p);
        info.cg->SetContinuousBCBorderWidth(NS_SIDE_TOP, currentBorder.width);
      }
      if (0 == info.colIndex) {
        currentBorder = CompareBorders(this, info.cg, info.leftCol, nsnull,
                                       nsnull, nsnull, tableIsLTR, TABLE_EDGE,
                                       NS_SIDE_LEFT, !ADJACENT, t2p);
        mBits.mLeftContBCBorder = currentBorder.width;
      }
    }
    else {
      // see if the top border needs to be the start of a segment due to a vertical border owning the corner
      if (info.colIndex > 0) {
        BCData& data = ((BCCellData*)info.cellData)->mData;
        if (!data.IsTopStart()) {
          PRUint8 cornerSide;
          PRPackedBool bevel;
          data.GetCorner(cornerSide, bevel);
          if ((NS_SIDE_TOP == cornerSide) || (NS_SIDE_BOTTOM == cornerSide)) {
            data.SetTopStart(PR_TRUE);
          }
        }
      }  
    }

    // find the dominant border considering the cell's left border and the table, col group, col  
    // if the border is at the left of the table, otherwise it was processed in a previous col
    if (0 == info.colIndex) {
      if (!tableBorderReset[NS_SIDE_LEFT]) {
        propData->mLeftBorderWidth = 0;
        tableBorderReset[NS_SIDE_LEFT] = PR_TRUE;
      }
      nsTableRowFrame* rowFrame = nsnull;
      for (PRInt32 rowX = info.rowIndex; rowX <= cellEndRowIndex; rowX++) {
        rowFrame = (rowX == info.rowIndex) ? info.topRow : rowFrame->GetNextRow();
        currentBorder = CompareBorders(this, info.cg, info.leftCol, info.rg, rowFrame, info.cell, 
                                       tableIsLTR, TABLE_EDGE, NS_SIDE_LEFT, !ADJACENT, t2p);
        BCCornerInfo& tlCorner = (0 == rowX) ? topCorners[0] : bottomCorners[0]; // top left
        tlCorner.Update(NS_SIDE_BOTTOM, currentBorder);
        tableCellMap->SetBCBorderCorner(eTopLeft, *info.cellMap, iter.mRowGroupStart, rowX, 
                                        0, tlCorner.ownerSide, tlCorner.subWidth, tlCorner.bevel);
        bottomCorners[0].Set(NS_SIDE_TOP, currentBorder); // bottom left             
        // update lastVerBordersBorder and see if a new segment starts
        startSeg = SetBorder(currentBorder, lastVerBorders[0]);
        // store the border segment in the cell map 
        tableCellMap->SetBCBorderEdge(NS_SIDE_LEFT, *info.cellMap, iter.mRowGroupStart, rowX, 
                                      info.colIndex, 1, currentBorder.owner, currentBorder.width, startSeg);
        // update the left border of the cell, col and table
        if (info.cell) {
          info.cell->SetBorderWidth(firstSide, PR_MAX(currentBorder.width, info.cell->GetBorderWidth(firstSide)));
        }
        if (info.leftCol) {
          BCPixelSize half = BC_BORDER_RIGHT_HALF(currentBorder.width);
          info.leftCol->SetLeftBorderWidth(PR_MAX(half, info.leftCol->GetLeftBorderWidth()));
        }
        propData->mLeftBorderWidth = LimitBorderWidth(PR_MAX(propData->mLeftBorderWidth, currentBorder.width));
        //get row continuous borders
        if (rowFrame) {
          currentBorder = CompareBorders(this, info.cg, info.leftCol,
                                         info.rg, rowFrame, nsnull, tableIsLTR,
                                         TABLE_EDGE, NS_SIDE_LEFT, !ADJACENT, t2p);
          rowFrame->SetContinuousBCBorderWidth(firstSide, currentBorder.width);
        }
      }
      //get row group continuous borders
      if (info.rgBottom && info.rg) { //once per row group, so check for bottom
        currentBorder = CompareBorders(this, info.cg, info.leftCol, info.rg, nsnull,
                                       nsnull, tableIsLTR, TABLE_EDGE, NS_SIDE_LEFT,
                                       !ADJACENT, t2p);
        info.rg->SetContinuousBCBorderWidth(firstSide, currentBorder.width);
      }
    }

    // find the dominant border considering the cell's right border, adjacent cells and the table, row group, row
    if (numCols == cellEndColIndex + 1) { // touches right edge of table
      if (!tableBorderReset[NS_SIDE_RIGHT]) {
        propData->mRightBorderWidth = 0;
        tableBorderReset[NS_SIDE_RIGHT] = PR_TRUE;
      }
      nsTableRowFrame* rowFrame = nsnull;
      for (PRInt32 rowX = info.rowIndex; rowX <= cellEndRowIndex; rowX++) {
        rowFrame = (rowX == info.rowIndex) ? info.topRow : rowFrame->GetNextRow();
        currentBorder = CompareBorders(this, info.cg, info.rightCol, info.rg, rowFrame, info.cell, 
                                       tableIsLTR, TABLE_EDGE, NS_SIDE_RIGHT, ADJACENT, t2p);
        // update/store the top right & bottom right corners 
        BCCornerInfo& trCorner = (0 == rowX) ? topCorners[cellEndColIndex + 1] : bottomCorners[cellEndColIndex + 1]; 
        trCorner.Update(NS_SIDE_BOTTOM, currentBorder);   // top right
        tableCellMap->SetBCBorderCorner(eTopRight, *info.cellMap, iter.mRowGroupStart, rowX, 
                                        cellEndColIndex, trCorner.ownerSide, trCorner.subWidth, trCorner.bevel);
        BCCornerInfo& brCorner = bottomCorners[cellEndColIndex + 1];
        brCorner.Set(NS_SIDE_TOP, currentBorder); // bottom right
        tableCellMap->SetBCBorderCorner(eBottomRight, *info.cellMap, iter.mRowGroupStart, rowX,
                                        cellEndColIndex, brCorner.ownerSide, brCorner.subWidth, brCorner.bevel);
        // update lastVerBorders and see if a new segment starts
        startSeg = SetBorder(currentBorder, lastVerBorders[cellEndColIndex + 1]);
        // store the border segment in the cell map and update cellBorders
        tableCellMap->SetBCBorderEdge(NS_SIDE_RIGHT, *info.cellMap, iter.mRowGroupStart, rowX,
                                      cellEndColIndex, 1, currentBorder.owner, currentBorder.width, startSeg);
        // update the affected borders of the cell, col, and table
        if (info.cell) {
          info.cell->SetBorderWidth(secondSide, PR_MAX(currentBorder.width, info.cell->GetBorderWidth(secondSide)));
        }
        if (info.rightCol) {
          BCPixelSize half = BC_BORDER_LEFT_HALF(currentBorder.width);
          info.rightCol->SetRightBorderWidth(PR_MAX(half, info.rightCol->GetRightBorderWidth()));
        }
        propData->mRightBorderWidth = LimitBorderWidth(PR_MAX(propData->mRightBorderWidth, currentBorder.width));
        //get row continuous borders
        if (rowFrame) {
          currentBorder = CompareBorders(this, info.cg, info.rightCol, info.rg,
                                         rowFrame, nsnull, tableIsLTR, TABLE_EDGE,
                                         NS_SIDE_RIGHT, ADJACENT, t2p);
          rowFrame->SetContinuousBCBorderWidth(secondSide, currentBorder.width);
        }
      }
      //get row group continuous borders
      if (info.rgBottom && info.rg) { //once per rg, so check for bottom
        currentBorder = CompareBorders(this, info.cg, info.rightCol, info.rg, 
                                       nsnull, nsnull, tableIsLTR, TABLE_EDGE,
                                       NS_SIDE_RIGHT, ADJACENT, t2p);
        info.rg->SetContinuousBCBorderWidth(secondSide, currentBorder.width);
      }
    }
    else {
      PRInt32 segLength = 0;
      BCMapCellInfo priorAjaInfo;
      for (PRInt32 rowX = info.rowIndex; rowX <= cellEndRowIndex; rowX += segLength) {
        iter.PeekRight(info, rowX, ajaInfo);
        const nsIFrame* cg = (info.cgRight) ? info.cg : nsnull;
        currentBorder = CompareBorders(nsnull, cg, info.rightCol, nsnull, nsnull, info.cell,
                                       tableIsLTR, !TABLE_EDGE, NS_SIDE_RIGHT, ADJACENT, t2p);
        cg = (ajaInfo.cgLeft) ? ajaInfo.cg : nsnull;
        adjacentBorder = CompareBorders(nsnull, cg, ajaInfo.leftCol, nsnull, nsnull, ajaInfo.cell, 
                                        tableIsLTR, !TABLE_EDGE, NS_SIDE_LEFT, !ADJACENT, t2p);
        currentBorder = CompareBorders(!CELL_CORNER, currentBorder, adjacentBorder, !HORIZONTAL);
                          
        segLength = PR_MAX(1, ajaInfo.rowIndex + ajaInfo.rowSpan - rowX);
        segLength = PR_MIN(segLength, info.rowIndex + info.rowSpan - rowX);

        // update lastVerBorders and see if a new segment starts
        startSeg = SetBorder(currentBorder, lastVerBorders[cellEndColIndex + 1]);
        // store the border segment in the cell map and update cellBorders
        if (RIGHT_DAMAGED(cellEndColIndex) && TOP_DAMAGED(rowX) && BOTTOM_DAMAGED(rowX)) {
          tableCellMap->SetBCBorderEdge(NS_SIDE_RIGHT, *info.cellMap, iter.mRowGroupStart, rowX, 
                                        cellEndColIndex, segLength, currentBorder.owner, currentBorder.width, startSeg);
          // update the borders of the cells and cols affected 
          if (info.cell) {
            info.cell->SetBorderWidth(secondSide, PR_MAX(currentBorder.width, info.cell->GetBorderWidth(secondSide)));
          }
          if (info.rightCol) {
            BCPixelSize half = BC_BORDER_LEFT_HALF(currentBorder.width);
            info.rightCol->SetRightBorderWidth(PR_MAX(half, info.rightCol->GetRightBorderWidth()));
          }
          if (ajaInfo.cell) {
            ajaInfo.cell->SetBorderWidth(firstSide, PR_MAX(currentBorder.width, ajaInfo.cell->GetBorderWidth(firstSide)));
          }
          if (ajaInfo.leftCol) {
            BCPixelSize half = BC_BORDER_RIGHT_HALF(currentBorder.width);
            ajaInfo.leftCol->SetLeftBorderWidth(PR_MAX(half, ajaInfo.leftCol->GetLeftBorderWidth()));
          }
        }
        // update the top right corner
        PRBool hitsSpanOnRight = (rowX > ajaInfo.rowIndex) && (rowX < ajaInfo.rowIndex + ajaInfo.rowSpan);
        BCCornerInfo* trCorner = ((0 == rowX) || hitsSpanOnRight) 
                                 ? &topCorners[cellEndColIndex + 1] : &bottomCorners[cellEndColIndex + 1]; 
        trCorner->Update(NS_SIDE_BOTTOM, currentBorder);
        // if this is not the first time through, consider the segment to the right
        if (rowX != info.rowIndex) {
          const nsIFrame* rg = (priorAjaInfo.rgBottom) ? priorAjaInfo.rg : nsnull;
          currentBorder = CompareBorders(nsnull, nsnull, nsnull, rg, priorAjaInfo.bottomRow, priorAjaInfo.cell,
                                         tableIsLTR, !TABLE_EDGE, NS_SIDE_BOTTOM, ADJACENT, t2p);
          rg = (ajaInfo.rgTop) ? ajaInfo.rg : nsnull;
          adjacentBorder = CompareBorders(nsnull, nsnull, nsnull, rg, ajaInfo.topRow, ajaInfo.cell,
                                          tableIsLTR, !TABLE_EDGE, NS_SIDE_TOP, !ADJACENT, t2p);
          currentBorder = CompareBorders(!CELL_CORNER, currentBorder, adjacentBorder, HORIZONTAL);
          trCorner->Update(NS_SIDE_RIGHT, currentBorder);
        }
        // store the top right corner in the cell map 
        if (RIGHT_DAMAGED(cellEndColIndex) && TOP_DAMAGED(rowX)) {
          if (0 != rowX) {
            tableCellMap->SetBCBorderCorner(eTopRight, *info.cellMap, iter.mRowGroupStart, rowX, cellEndColIndex, 
                                            trCorner->ownerSide, trCorner->subWidth, trCorner->bevel);
          }
          // store any corners this cell spans together with the aja cell
          for (PRInt32 rX = rowX + 1; rX < rowX + segLength; rX++) {
            tableCellMap->SetBCBorderCorner(eBottomRight, *info.cellMap, iter.mRowGroupStart, rX, 
                                            cellEndColIndex, trCorner->ownerSide, trCorner->subWidth, PR_FALSE);
          }
        }
        // update bottom right corner, topCorners, bottomCorners
        hitsSpanOnRight = (rowX + segLength < ajaInfo.rowIndex + ajaInfo.rowSpan);
        BCCornerInfo& brCorner = (hitsSpanOnRight) ? topCorners[cellEndColIndex + 1] 
                                                   : bottomCorners[cellEndColIndex + 1];
        brCorner.Set(NS_SIDE_TOP, currentBorder);
        priorAjaInfo = ajaInfo;
      }
    }
    for (PRInt32 colX = info.colIndex + 1; colX <= cellEndColIndex; colX++) {
      lastVerBorders[colX].Reset(0,1);
    }

    // find the dominant border considering the cell's bottom border, adjacent cells and the table, row group, row
    if (numRows == cellEndRowIndex + 1) { // touches bottom edge of table
      if (!tableBorderReset[NS_SIDE_BOTTOM]) {
        propData->mBottomBorderWidth = 0;
        tableBorderReset[NS_SIDE_BOTTOM] = PR_TRUE;
      }
      for (PRInt32 colX = info.colIndex; colX <= cellEndColIndex; colX++) {
        nsIFrame* colFrame = GetColFrame(colX); if (!colFrame) ABORT0();
        nsIFrame* cgFrame = colFrame->GetParent(); if (!cgFrame) ABORT0();
        currentBorder = CompareBorders(this, cgFrame, colFrame, info.rg, info.bottomRow, info.cell,
                                       tableIsLTR, TABLE_EDGE, NS_SIDE_BOTTOM, ADJACENT, t2p);
        // update/store the bottom left & bottom right corners 
        BCCornerInfo& blCorner = bottomCorners[colX]; // bottom left
        blCorner.Update(NS_SIDE_RIGHT, currentBorder);
        tableCellMap->SetBCBorderCorner(eBottomLeft, *info.cellMap, iter.mRowGroupStart, cellEndRowIndex,                
                                        colX, blCorner.ownerSide, blCorner.subWidth, blCorner.bevel); 
        BCCornerInfo& brCorner = bottomCorners[colX + 1]; // bottom right
        brCorner.Update(NS_SIDE_LEFT, currentBorder);
        if (numCols == colX + 1) { // lower right corner of the table
          tableCellMap->SetBCBorderCorner(eBottomRight, *info.cellMap, iter.mRowGroupStart, cellEndRowIndex,               
                                          colX, brCorner.ownerSide, brCorner.subWidth, brCorner.bevel, PR_TRUE);  
        }
        // update lastBottomBorder and see if a new segment starts
        startSeg = SetHorBorder(currentBorder, blCorner, lastBottomBorder);
        if (!startSeg) { 
           // make sure that we did not compare apples to oranges i.e. the current border 
           // should be a continuation of the lastBottomBorder, as it is a bottom border 
           // add 1 to the cellEndRowIndex
           startSeg = (lastBottomBorder.rowIndex != cellEndRowIndex + 1);
        }
        // store the border segment in the cell map and update cellBorders
        tableCellMap->SetBCBorderEdge(NS_SIDE_BOTTOM, *info.cellMap, iter.mRowGroupStart, cellEndRowIndex, 
                                      colX, 1, currentBorder.owner, currentBorder.width, startSeg);
        // update the bottom borders of the cell, the bottom row, and the table 
        if (info.cell) {
          info.cell->SetBorderWidth(NS_SIDE_BOTTOM, PR_MAX(currentBorder.width, info.cell->GetBorderWidth(NS_SIDE_BOTTOM)));
        }
        if (info.bottomRow) {
          BCPixelSize half = BC_BORDER_TOP_HALF(currentBorder.width);
          info.bottomRow->SetBottomBCBorderWidth(PR_MAX(half, info.bottomRow->GetBottomBCBorderWidth()));
        }
        propData->mBottomBorderWidth = LimitBorderWidth(PR_MAX(propData->mBottomBorderWidth, currentBorder.width));
        // update lastBottomBorders
        lastBottomBorder.rowIndex = cellEndRowIndex + 1;
        lastBottomBorder.rowSpan = info.rowSpan;
        lastBottomBorders[colX] = lastBottomBorder;
        //get col continuous border
        currentBorder = CompareBorders(this, cgFrame, colFrame, info.rg, info.bottomRow,
                                       nsnull, tableIsLTR, TABLE_EDGE, NS_SIDE_BOTTOM,
                                       ADJACENT, t2p);
        ((nsTableColFrame*)colFrame)->SetContinuousBCBorderWidth(NS_SIDE_BOTTOM,
                                                                currentBorder.width);
      }
      //get row group/col group continuous border
      if (info.rg) {
        currentBorder = CompareBorders(this, nsnull, nsnull, info.rg, info.bottomRow,
                                       nsnull, tableIsLTR, TABLE_EDGE, NS_SIDE_BOTTOM,
                                       ADJACENT, t2p);
        info.rg->SetContinuousBCBorderWidth(NS_SIDE_BOTTOM, currentBorder.width);
      }
      if (info.cg) {
        currentBorder = CompareBorders(this, info.cg, nsnull, info.rg, info.bottomRow,
                                       nsnull, tableIsLTR, TABLE_EDGE, NS_SIDE_BOTTOM,
                                       ADJACENT, t2p);
        info.cg->SetContinuousBCBorderWidth(NS_SIDE_BOTTOM, currentBorder.width);
      }
    }
    else {
      PRInt32 segLength = 0;
      for (PRInt32 colX = info.colIndex; colX <= cellEndColIndex; colX += segLength) {
        iter.PeekBottom(info, colX, ajaInfo);
        const nsIFrame* rg = (info.rgBottom) ? info.rg : nsnull;
        currentBorder = CompareBorders(nsnull, nsnull, nsnull, rg, info.bottomRow, info.cell, 
                                       tableIsLTR, !TABLE_EDGE, NS_SIDE_BOTTOM, ADJACENT, t2p);
        rg = (ajaInfo.rgTop) ? ajaInfo.rg : nsnull;
        adjacentBorder = CompareBorders(nsnull, nsnull, nsnull, rg, ajaInfo.topRow, ajaInfo.cell, 
                                        tableIsLTR, !TABLE_EDGE, NS_SIDE_TOP, !ADJACENT, t2p);
        currentBorder = CompareBorders(!CELL_CORNER, currentBorder, adjacentBorder, HORIZONTAL);
        segLength = PR_MAX(1, ajaInfo.colIndex + ajaInfo.colSpan - colX);
        segLength = PR_MIN(segLength, info.colIndex + info.colSpan - colX);

        // update, store the bottom left corner
        BCCornerInfo& blCorner = bottomCorners[colX]; // bottom left
        PRBool hitsSpanBelow = (colX > ajaInfo.colIndex) && (colX < ajaInfo.colIndex + ajaInfo.colSpan);
        PRBool update = PR_TRUE;
        if ((colX == info.colIndex) && (colX > damageArea.x)) {
          PRInt32 prevRowIndex = lastBottomBorders[colX - 1].rowIndex;
          if (prevRowIndex > cellEndRowIndex + 1) { // hits a rowspan on the right
            update = PR_FALSE; // the corner was taken care of during the cell on the left
          }
          else if (prevRowIndex < cellEndRowIndex + 1) { // spans below the cell to the left
            topCorners[colX] = blCorner;
            blCorner.Set(NS_SIDE_RIGHT, currentBorder);
            update = PR_FALSE;
          }
        }
        if (update) {
          blCorner.Update(NS_SIDE_RIGHT, currentBorder);
        }
        if (BOTTOM_DAMAGED(cellEndRowIndex) && LEFT_DAMAGED(colX)) {
          if (hitsSpanBelow) {
            tableCellMap->SetBCBorderCorner(eBottomLeft, *info.cellMap, iter.mRowGroupStart, cellEndRowIndex, colX,
                                            blCorner.ownerSide, blCorner.subWidth, blCorner.bevel);
          }
          // store any corners this cell spans together with the aja cell
          for (PRInt32 cX = colX + 1; cX < colX + segLength; cX++) {
            BCCornerInfo& corner = bottomCorners[cX];
            corner.Set(NS_SIDE_RIGHT, currentBorder);
            tableCellMap->SetBCBorderCorner(eBottomLeft, *info.cellMap, iter.mRowGroupStart, cellEndRowIndex,
                                            cX, corner.ownerSide, corner.subWidth, PR_FALSE);
          }
        }
        // update lastBottomBorders and see if a new segment starts
        startSeg = SetHorBorder(currentBorder, blCorner, lastBottomBorder);
        if (!startSeg) { 
           // make sure that we did not compare apples to oranges i.e. the current border 
           // should be a continuation of the lastBottomBorder, as it is a bottom border 
           // add 1 to the cellEndRowIndex
           startSeg = (lastBottomBorder.rowIndex != cellEndRowIndex + 1);
        }
        lastBottomBorder.rowIndex = cellEndRowIndex + 1;
        lastBottomBorder.rowSpan = info.rowSpan;
        for (PRInt32 cX = colX; cX < colX + segLength; cX++) {
          lastBottomBorders[cX] = lastBottomBorder;
        }

        // store the border segment the cell map and update cellBorders
        if (BOTTOM_DAMAGED(cellEndRowIndex) && LEFT_DAMAGED(colX) && RIGHT_DAMAGED(colX)) {
          tableCellMap->SetBCBorderEdge(NS_SIDE_BOTTOM, *info.cellMap, iter.mRowGroupStart, cellEndRowIndex,
                                        colX, segLength, currentBorder.owner, currentBorder.width, startSeg);
          // update the borders of the affected cells and rows
          if (info.cell) {
            info.cell->SetBorderWidth(NS_SIDE_BOTTOM, PR_MAX(currentBorder.width, info.cell->GetBorderWidth(NS_SIDE_BOTTOM)));
          }
          if (info.bottomRow) {
            BCPixelSize half = BC_BORDER_TOP_HALF(currentBorder.width);
            info.bottomRow->SetBottomBCBorderWidth(PR_MAX(half, info.bottomRow->GetBottomBCBorderWidth()));
          }
          if (ajaInfo.cell) {
            ajaInfo.cell->SetBorderWidth(NS_SIDE_TOP, PR_MAX(currentBorder.width, ajaInfo.cell->GetBorderWidth(NS_SIDE_TOP)));
          }
          if (ajaInfo.topRow) {
            BCPixelSize half = BC_BORDER_BOTTOM_HALF(currentBorder.width);
            ajaInfo.topRow->SetTopBCBorderWidth(PR_MAX(half, ajaInfo.topRow->GetTopBCBorderWidth()));
          }
        }
        // update bottom right corner
        BCCornerInfo& brCorner = bottomCorners[colX + segLength];
        brCorner.Update(NS_SIDE_LEFT, currentBorder);
      }
      if (!gotRowBorder && 1 == info.rowSpan && (ajaInfo.topRow || info.rgBottom)) {
        //get continuous row/row group border
        //we need to check the row group's bottom border if this is
        //the last row in the row group, but only a cell with rowspan=1
        //will know whether *this* row is at the bottom
        const nsIFrame* rg = (info.rgBottom) ? info.rg : nsnull;
        currentBorder = CompareBorders(nsnull, nsnull, nsnull, rg, info.bottomRow,
                                       nsnull, tableIsLTR, !TABLE_EDGE, NS_SIDE_BOTTOM,
                                       ADJACENT, t2p);
        rg = (ajaInfo.rgTop) ? ajaInfo.rg : nsnull;
        adjacentBorder = CompareBorders(nsnull, nsnull, nsnull, rg, ajaInfo.topRow,
                                        nsnull, tableIsLTR, !TABLE_EDGE, NS_SIDE_TOP,
                                        !ADJACENT, t2p);
        currentBorder = CompareBorders(PR_FALSE, currentBorder, adjacentBorder, HORIZONTAL);
        if (ajaInfo.topRow) {
          ajaInfo.topRow->SetContinuousBCBorderWidth(NS_SIDE_TOP, currentBorder.width);
        }
        if (info.rgBottom && info.rg) {
          info.rg->SetContinuousBCBorderWidth(NS_SIDE_BOTTOM, currentBorder.width);
        }
        gotRowBorder = PR_TRUE;
      }
    }

    // see if the cell to the right had a rowspan and its lower left border needs be joined with this one's bottom
    if ((numCols != cellEndColIndex + 1) &&                  // there is a cell to the right
        (lastBottomBorders[cellEndColIndex + 1].rowSpan > 1)) { // cell to right was a rowspan
      BCCornerInfo& corner = bottomCorners[cellEndColIndex + 1];
      if ((NS_SIDE_TOP != corner.ownerSide) && (NS_SIDE_BOTTOM != corner.ownerSide)) { // not a vertical owner
        BCCellBorder& thisBorder = lastBottomBorder;
        BCCellBorder& nextBorder = lastBottomBorders[info.colIndex + 1];
        if ((thisBorder.color == nextBorder.color) && (thisBorder.width == nextBorder.width) &&
            (thisBorder.style == nextBorder.style)) {
          // set the flag on the next border indicating it is not the start of a new segment
          if (iter.mCellMap) {
            BCData* bcData = tableCellMap->GetBCData(NS_SIDE_BOTTOM, *iter.mCellMap, cellEndRowIndex, 
                                                     cellEndColIndex + 1);
            if (bcData) {
              bcData->SetTopStart(PR_FALSE);
            }
          }
        }
      }
    }
  } // for (iter.First(info); info.cell; iter.Next(info)) {

  // reset the bc flag and damage area
  SetNeedToCalcBCBorders(PR_FALSE);
  propData->mDamageArea.x = propData->mDamageArea.y = propData->mDamageArea.width = propData->mDamageArea.height = 0;
#ifdef DEBUG_TABLE_CELLMAP
  mCellMap->Dump();
#endif
}

Here is the caller graph for this function:

Definition at line 4254 of file nsTableFrame.cpp.

{
  nscoord height = aState.mComputedHeight;
  if (NS_AUTOHEIGHT != height) {
    nsMargin borderPadding = GetContentAreaOffset(&aState);
    height += borderPadding.top + borderPadding.bottom;
  }
  height = PR_MAX(0, height);

  return height;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4226 of file nsTableFrame.cpp.

{
  nscoord width = aState.mComputedWidth;

  if (eStyleUnit_Auto == aState.mStylePosition->mWidth.GetUnit()) {
    if (0 == width) {
      width = aState.availableWidth;
    }
    if (NS_UNCONSTRAINEDSIZE != aState.availableWidth) {
      width = aState.availableWidth;
    }
  }
  else if (width != NS_UNCONSTRAINEDSIZE) {
    nsMargin borderPadding = GetContentAreaOffset(&aState);
    width += borderPadding.left + borderPadding.right;
  }
  width = PR_MAX(width, 0);

  if (NS_UNCONSTRAINEDSIZE != width) {
    float p2t;
    p2t = GetPresContext()->PixelsToTwips();
    width = RoundToPixel(width, p2t, eRoundUpIfHalfOrMore);
  }

  return width;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::CalcBorderPadding ( nsMargin aBorderPadding) const [virtual, inherited]

Implements nsIFrame.

Definition at line 686 of file nsFrame.cpp.

                                                                        {
  NS_ASSERTION(mStyleContext!=nsnull,"null style context");
  if (mStyleContext) {
    nsStyleBorderPadding bpad;
    mStyleContext->GetBorderPaddingFor(bpad);
    if (!bpad.GetBorderPadding(aBorderPadding)) {
      const nsStylePadding* paddingStyle = GetStylePadding();
      paddingStyle->CalcPaddingFor(this, aBorderPadding);
      const nsStyleBorder* borderStyle = GetStyleBorder();
      aBorderPadding += borderStyle->GetBorder();
    }
    return NS_OK;
  }
  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::CalcDesiredHeight ( const nsHTMLReflowState aReflowState,
nsHTMLReflowMetrics aDesiredSize 
) [protected]

Definition at line 3522 of file nsTableFrame.cpp.

{
  nsTableCellMap* cellMap = GetCellMap();
  if (!cellMap) {
    NS_ASSERTION(PR_FALSE, "never ever call me until the cell map is built!");
    aDesiredSize.height = 0;
    return;
  }
  nscoord  cellSpacingY = GetCellSpacingY();
  nsMargin borderPadding = GetChildAreaOffset(&aReflowState);

  // get the natural height based on the last child's (row group or scroll frame) rect
  nsAutoVoidArray rowGroups;
  PRUint32 numRowGroups;
  OrderRowGroups(rowGroups, numRowGroups, nsnull);
  if (numRowGroups <= 0) {
    // tables can be used as rectangular items without content
    nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aReflowState);
    if ((NS_UNCONSTRAINEDSIZE != tableSpecifiedHeight) &&
        (tableSpecifiedHeight > 0) &&
        eCompatibility_NavQuirks != GetPresContext()->CompatibilityMode()) {
          // empty tables should not have a size in quirks mode
      aDesiredSize.height = tableSpecifiedHeight;
    } 
    else
      aDesiredSize.height = 0;
    return;
  }
  PRInt32 rowCount = cellMap->GetRowCount();
  PRInt32 colCount = cellMap->GetColCount();
  nscoord desiredHeight = borderPadding.top + borderPadding.bottom;
  if (rowCount > 0 && colCount > 0) {
    desiredHeight += cellSpacingY;
    for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) {
      nsIFrame* rg = (nsIFrame*)rowGroups.ElementAt(rgX);
      if (rg) {
        desiredHeight += rg->GetSize().height + cellSpacingY;
      }
    }
  }

  // see if a specified table height requires dividing additional space to rows
  if (!mPrevInFlow) {
    nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aReflowState);
    if ((tableSpecifiedHeight > 0) && 
        (tableSpecifiedHeight != NS_UNCONSTRAINEDSIZE) &&
        (tableSpecifiedHeight > desiredHeight)) {
      // proportionately distribute the excess height to unconstrained rows in each
      // unconstrained row group.We don't need to do this if it's an unconstrained reflow
      if (NS_UNCONSTRAINEDSIZE != aReflowState.availableWidth) { 
        DistributeHeightToRows(aReflowState, tableSpecifiedHeight - desiredHeight);
        // this might have changed the overflow area incorporate the childframe overflow area.
        for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
          ConsiderChildOverflow(aDesiredSize.mOverflowArea, kidFrame);
        } 
      }
      desiredHeight = tableSpecifiedHeight;
    }
  }
  aDesiredSize.height = desiredHeight;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nscoord nsTableFrame::CalcDesiredWidth ( const nsHTMLReflowState aReflowState) [protected, virtual]

Definition at line 3483 of file nsTableFrame.cpp.

{
  NS_ASSERTION(!mPrevInFlow, "never ever call me on a continuing frame!");
  nsTableCellMap* cellMap = GetCellMap();
  if (!cellMap) {
    NS_ASSERTION(PR_FALSE, "never ever call me until the cell map is built!");
    return 0;
  }

  nscoord cellSpacing = GetCellSpacingX();
  PRInt32 tableWidth  = 0;

  PRInt32 numCols = GetColCount();
  for (PRInt32 colIndex = 0; colIndex < numCols; colIndex++) {
    nscoord totalColWidth = GetColumnWidth(colIndex);
    if (GetNumCellsOriginatingInCol(colIndex) > 0) { // skip degenerate cols
      totalColWidth += cellSpacing;           // add cell spacing to left of col
    }
    tableWidth += totalColWidth;
  }

  if (numCols > 0)
    tableWidth += cellSpacing; // add last cellspacing

  PRBool isPctWidth = PR_FALSE;
  nscoord compWidth = aReflowState.mComputedWidth;
  if (!IsAutoWidth(&isPctWidth) &&
      (NS_UNCONSTRAINEDSIZE != compWidth) && !isPctWidth)
    tableWidth = PR_MAX(tableWidth, compWidth);

  // Add the width between the border edge and the child area
  nsMargin childOffset = GetChildAreaOffset(&aReflowState);
  tableWidth += childOffset.left + childOffset.right;

  return tableWidth;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::CalcMinAndPreferredWidths ( const nsHTMLReflowState aReflowState,
PRBool  aCalcPrefWidthIfAutoWithPctCol,
nscoord aMinWidth,
nscoord aPreferredWidth 
)

Definition at line 4294 of file nsTableFrame.cpp.

{
  aMinWidth = aPrefWidth = 0;

  nscoord spacingX = GetCellSpacingX();
  PRInt32 numCols = GetColCount();

  for (PRInt32 colX = 0; colX < numCols; colX++) { 
    nsTableColFrame* colFrame = GetColFrame(colX);
    if (!colFrame) continue;
    aMinWidth += colFrame->GetMinWidth();
    nscoord width = colFrame->GetFixWidth();
    if (width <= 0) {
      width = colFrame->GetDesWidth();
    }
    aPrefWidth += width;
    if (GetNumCellsOriginatingInCol(colX) > 0) {
      aMinWidth  += spacingX;
      aPrefWidth += spacingX;
    }
  }
  // if it is not a degenerate table, add the last spacing on the right and the borderPadding
  if (numCols > 0) {
    nsMargin childAreaOffset = GetChildAreaOffset( &aReflowState);
    nscoord extra = spacingX + childAreaOffset.left + childAreaOffset.right;
    aMinWidth  += extra;
    aPrefWidth += extra;
  }
  aPrefWidth = PR_MAX(aMinWidth, aPrefWidth);

  PRBool isPctWidth = PR_FALSE;
  if (IsAutoWidth(&isPctWidth)) {
    if (HasPctCol() && aCalcPrefWidthIfAutoWithPctCol && 
        (NS_UNCONSTRAINEDSIZE != aReflowState.availableWidth)) {
      // for an auto table with a pct cell, use the strategy's CalcPctAdjTableWidth
      nscoord availWidth = CalcBorderBoxWidth(aReflowState);
      availWidth = PR_MIN(availWidth, aReflowState.availableWidth);
      if (mTableLayoutStrategy && IsAutoLayout()) {
        aPrefWidth = mTableLayoutStrategy->CalcPctAdjTableWidth(aReflowState, availWidth);
      }
    }
    if (0 == numCols) { // degenerate case
      aMinWidth = aPrefWidth = 0;
    }
  }
  else { // a specified fix width becomes the min or preferred width
    nscoord compWidth = aReflowState.mComputedWidth;
    if ((NS_UNCONSTRAINEDSIZE != compWidth) && (0 != compWidth) && !isPctWidth) {
      nsMargin contentOffset = GetContentAreaOffset(&aReflowState);
      compWidth += contentOffset.left + contentOffset.right;
      aMinWidth = PR_MAX(aMinWidth, compWidth);
      aPrefWidth = PR_MAX(aMinWidth, compWidth);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::CanContinueTextRun ( PRBool aContinueTextRun) const [virtual, inherited]

Helper method used by block reflow to identify runs of text so that proper word-breaking can be done.

Parameters:
aContinueTextRunA frame should set aContinueTextRun to PR_TRUE if we can continue a "text run" through the frame. A text run is text that should be treated contiguously for line and word breaking.
Returns:
The return value is irrelevant.

Implements nsIFrame.

Reimplemented in nsTextFrame, and nsHTMLCanvasFrame.

Definition at line 2218 of file nsFrame.cpp.

{
  // By default, a frame will *not* allow a text run to be continued
  // through it.
  aContinueTextRun = PR_FALSE;
  return NS_OK;
}
virtual PRBool nsIFrame::CanPaintBackground ( ) [inline, virtual, inherited]

Does the frame paint its background? If not, then all or part of it will be painted by ancestors.

Reimplemented in nsSVGOuterSVGFrame, nsTableColGroupFrame, nsTableRowGroupFrame, nsTableOuterFrame, nsTableColFrame, nsTableRowFrame, ViewportFrame, and nsFieldSetFrame.

Definition at line 715 of file nsIFrame.h.

{ return PR_TRUE; }

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::CaptureMouse ( nsPresContext aPresContext,
PRBool  aGrabMouseEvents 
) [virtual, inherited]

EndSelection related calls.

Call to turn on/off mouseCapture at the view level. Needed by the ESM so it must be in the public interface.

Parameters:
aPresContextpresContext associated with the frame
aGrabMouseEventsPR_TRUE to enable capture, PR_FALSE to disable

Implements nsIFrame.

Definition at line 4706 of file nsFrame.cpp.

{
  // get its view
  nsIView* view = GetNearestCapturingView(this);
  if (!view) {
    return NS_ERROR_FAILURE;
  }

  nsIViewManager* viewMan = view->GetViewManager();
  if (!viewMan) {
    return NS_ERROR_FAILURE;
  }

  if (aGrabMouseEvents) {
    PRBool result;
    viewMan->GrabMouseEvents(view, result);
  } else {
    PRBool result;
    viewMan->GrabMouseEvents(nsnull, result);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsTableFrame::CellChangedWidth ( const nsTableCellFrame aCellFrame,
nscoord  aPrevMinWidth,
nscoord  aPrevMaxWidth,
PRBool  aCellWasDestroyed = PR_FALSE 
)

Definition at line 3846 of file nsTableFrame.cpp.

{
  if (NeedStrategyInit() || !IsAutoLayout()) {
    // if the strategy needs to be initialized, all of the col info will be updated later
    // fixed layout tables do not cause any rebalancing
    return PR_TRUE;
  }

  nscoord colSpan = GetEffectiveColSpan(aCellFrame);
  if (colSpan > 1) {
    // colspans are too complicated to optimize, so just bail out
    SetNeedStrategyInit(PR_TRUE);
    return PR_TRUE;
  }

  PRInt32 rowX, colIndex, numRows;
  aCellFrame.GetColIndex(colIndex);
  
  PRBool originates;

  nsTableColFrame* colFrame = GetColFrame(colIndex);
  if (!colFrame) return PR_TRUE; // should never happen

  nscoord cellMin = (aCellWasDestroyed) ? 0 : aCellFrame.GetPass1MaxElementWidth();
  nscoord cellMax = (aCellWasDestroyed) ? 0 : aCellFrame.GetMaximumWidth();
  nscoord colMin  = colFrame->GetWidth(MIN_CON);
  nscoord colMax  = colFrame->GetWidth(DES_CON);

  PRBool colMinGetsBigger  = (cellMin > colMin);
  PRBool colMinGetsSmaller = (cellMin < colMin) && (colMin == aPrevCellMin);

  if (colMinGetsBigger || colMinGetsSmaller) {
    if (ColIsSpannedInto(colIndex) || ColHasSpanningCells(colIndex)) {
      // bail out if a colspan is involved
      SetNeedStrategyInit(PR_TRUE);
      return PR_TRUE;
    }
    if (colMinGetsBigger) {
      // update the columns's min width
      colFrame->SetWidth(MIN_CON, cellMin);
    }
    else if (colMinGetsSmaller) {
      // determine the new min width
      numRows = GetRowCount();
      nscoord minWidth = 0;
      for (rowX = 0; rowX < numRows; rowX++) {
        nsTableCellFrame* cellFrame = GetCellInfoAt(rowX, colIndex, &originates, &colSpan);
        if (cellFrame && originates && (1 == colSpan)) {
          minWidth = PR_MAX(minWidth, cellFrame->GetPass1MaxElementWidth());
        }
      }
      // update the columns's new min width
      colFrame->SetWidth(MIN_CON, minWidth);
    }
    // we should rebalance in case the min width determines the column width
    SetNeedStrategyBalance(PR_TRUE);
  }

  PRBool colMaxGetsBigger  = (cellMax > colMax);
  PRBool colMaxGetsSmaller = (cellMax < colMax) && (colMax == aPrevCellMax);

  if (colMaxGetsBigger || colMaxGetsSmaller) {
    if (ColIsSpannedInto(colIndex)) {
      // bail out if a colspan is involved
      SetNeedStrategyInit(PR_TRUE);
      return PR_TRUE;
    }
    // see if the max width will be not be overshadowed by a pct, fix, or proportional width
    if ((colFrame->GetWidth(PCT) <= 0) && (colFrame->GetWidth(FIX) <= 0) &&
        (colFrame->GetWidth(MIN_PRO) <= 0)) {
      // see if the doesn't have a pct width
      const nsStylePosition* cellPosition = aCellFrame.GetStylePosition();
      // see if there isn't a pct width on the cell
      PRBool havePct = PR_FALSE;
      if (eStyleUnit_Percent == cellPosition->mWidth.GetUnit()) {
        float percent = cellPosition->mWidth.GetPercentValue();
        if (percent > 0.0f) {
          havePct = PR_TRUE;
        }
      }
      if (!havePct) {
        // see if there isn't a fix width on the cell
        PRBool haveFix = PR_FALSE;
        if (eStyleUnit_Coord == cellPosition->mWidth.GetUnit()) {
          nscoord coordValue = cellPosition->mWidth.GetCoordValue();
          if (coordValue > 0) { 
            haveFix = PR_TRUE;
          }
        }
        if (!haveFix) {
          // see if there isn't a prop width on the cell
          PRBool haveProp = PR_FALSE;
          if (eStyleUnit_Proportional == cellPosition->mWidth.GetUnit()) {
            nscoord intValue = cellPosition->mWidth.GetIntValue();
            if (intValue > 0) { 
              haveProp = PR_TRUE;
            }
          }
          if (!haveProp) {
            UpdateCol(*this, *colFrame, aCellFrame, cellMax, colMaxGetsBigger);
            // we should rebalance in case the max width determines the column width
            SetNeedStrategyBalance(PR_TRUE);
          }
        }
      }
    }
    else {
      UpdateCol(*this, *colFrame, aCellFrame, cellMax, colMaxGetsBigger);
    }
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::CharacterDataChanged ( nsPresContext aPresContext,
nsIContent aChild,
PRBool  aAppend 
) [virtual, inherited]

This call is invoked when content is changed in the content tree.

The first frame that maps that content is asked to deal with the change by generating an incremental reflow command.

Parameters:
aPresContextthe presentation context
aContentthe content node that was changed
aAppenda hint to the frame about the change

Implements nsIFrame.

Reimplemented in nsTextFrame, nsSVGGlyphFrame, and nsLeafBoxFrame.

Definition at line 2264 of file nsFrame.cpp.

{
  NS_NOTREACHED("should only be called for text frames");
  return NS_OK;
}
void nsFrame::CheckInvalidateSizeChange ( nsPresContext aPresContext,
nsHTMLReflowMetrics aDesiredSize,
const nsHTMLReflowState aReflowState 
) [inherited]

Helper method to invalidate portions of a standard container frame if the reflow state indicates that the size has changed (specifically border, background and outline).

We assume that the difference between the old frame area and the new frame area is invalidated by some other means.

Parameters:
aPresContextthe presentation context
aDesiredSizethe new size of the frame
aReflowStatethe reflow that was just done on this frame

Definition at line 2652 of file nsFrame.cpp.

{
  if (aDesiredSize.width == mRect.width
      && aDesiredSize.height == mRect.height)
    return;

  // Below, we invalidate the old frame area (or, in the case of
  // outline, combined area) if the outline, border or background
  // settings indicate that something other than the difference
  // between the old and new areas needs to be painted. We are
  // assuming that the difference between the old and new areas will
  // be invalidated by some other means. That also means invalidating
  // the old frame area is the same as invalidating the new frame area
  // (since in either case the UNION of old and new areas will be
  // invalidated)

  // Invalidate the entire old frame+outline if the frame has an outline
  PRBool anyOutline;
  nsRect r = ComputeOutlineRect(this, &anyOutline,
                                aDesiredSize.mOverflowArea);
  if (anyOutline) {
    Invalidate(r);
    return;
  }

  // Invalidate the old frame borders if the frame has borders. Those borders
  // may be moving.
  const nsStyleBorder* border = GetStyleBorder();
  NS_FOR_CSS_SIDES(side) {
    if (border->GetBorderWidth(side) != 0) {
      Invalidate(nsRect(0, 0, mRect.width, mRect.height));
      return;
    }
  }

  // Invalidate the old frame background if the frame has a background
  // whose position depends on the size of the frame
  const nsStyleBackground* background = GetStyleBackground();
  if (background->mBackgroundFlags &
      (NS_STYLE_BG_X_POSITION_PERCENT | NS_STYLE_BG_Y_POSITION_PERCENT)) {
    Invalidate(nsRect(0, 0, mRect.width, mRect.height));
    return;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1747 of file nsTableFrame.cpp.

{
  if (!aReflowState.frame) ABORT0();
  nsIFrame* prevInFlow = aReflowState.frame->GetPrevInFlow();

  if (!prevInFlow                                             &&   // 1st in flow                                            && // 1st in flow
      ((NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight) ||   // no computed height
       (0                    == aReflowState.mComputedHeight))  && 
      ::IsPctStyleHeight(aReflowState.mStylePosition)) {           // pct height

    if (::AncestorsHaveStyleHeight(aReflowState)) {
      nsTableFrame::RequestSpecialHeightReflow(aReflowState);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::CheckVisibility ( nsPresContext aContext,
PRInt32  aStartIndex,
PRInt32  aEndIndex,
PRBool  aRecurse,
PRBool aFinished,
PRBool _retval 
) [virtual, inherited]

called to see if the children of the frame are visible from indexstart to index end.

this does not change any state. returns PR_TRUE only if the indexes are valid and any of the children are visible. for textframes this index is the character index. if aStart = aEnd result will be PR_FALSE

Parameters:
aStartstart index of first child from 0-N (number of children)
aEndend index of last child from 0-N
aRecurseshould this frame talk to siblings to get to the contents other children?
aFinisheddid this frame have the aEndIndex? or is there more work to do
_retvalreturn value true or false. false = range is not rendered.

Implements nsIFrame.

Reimplemented in nsTextFrame.

Definition at line 4035 of file nsFrame.cpp.

NS_IMETHODIMP nsBox::ChildrenMustHaveWidgets ( PRBool aMust) const [virtual, inherited]

Hack for deck who requires that all its children has widgets.

Implements nsIFrame.

Reimplemented in nsDeckFrame.

Definition at line 160 of file nsBox.cpp.

{
  aMust = PR_FALSE;
  return NS_OK;
}

empty the column frame cache

Definition at line 7667 of file nsTableFrame.cpp.

{
  PRBool result = PR_FALSE;
  nsTableCellMap * cellMap = GetCellMap();
  NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
  if (cellMap) {
    result = cellMap->ColHasSpanningCells(aColIndex);
  }
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 7678 of file nsTableFrame.cpp.

{
  PRBool result = PR_FALSE;
  nsTableCellMap * cellMap = GetCellMap();
  NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
  if (cellMap) {
    result = cellMap->ColIsSpannedInto(aColIndex);
  }
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_METHOD nsTableFrame::CollapseRowGroupIfNecessary ( nsIFrame aRowGroupFrame,
const nscoord aYTotalOffset,
nscoord aYGroupOffset,
PRInt32 aRowX 
) [protected]

Definition at line 2308 of file nsTableFrame.cpp.

{
  const nsStyleVisibility* groupVis = aRowGroupFrame->GetStyleVisibility();
  
  PRBool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE == groupVis->mVisible);
  if (collapseGroup) {
    SetNeedToCollapseRows(PR_TRUE);
  }
  nsIFrame* rowFrame = aRowGroupFrame->GetFirstChild(nsnull);

  while (nsnull != rowFrame) {
    const nsStyleDisplay* rowDisplay = rowFrame->GetStyleDisplay();
    if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay) {
      const nsStyleVisibility* rowVis = rowFrame->GetStyleVisibility();
      PRBool collapseRow = (NS_STYLE_VISIBILITY_COLLAPSE == rowVis->mVisible);
      if (collapseRow) {
        SetNeedToCollapseRows(PR_TRUE);
      }
      nsRect rowRect = rowFrame->GetRect();
      if (collapseGroup || collapseRow) {
        aYGroupOffset += rowRect.height;
        rowRect.height = 0;
        rowFrame->SetRect(rowRect);
        nsIFrame* cellFrame = rowFrame->GetFirstChild(nsnull);
        while (nsnull != cellFrame) {
          const nsStyleDisplay* cellDisplay = cellFrame->GetStyleDisplay();
          if (NS_STYLE_DISPLAY_TABLE_CELL == cellDisplay->mDisplay) {
            nsTableCellFrame* cFrame = (nsTableCellFrame*)cellFrame;
            nsRect cRect = cFrame->GetRect();
            cRect.height -= rowRect.height;
            cFrame->SetCollapseOffsetY(-aYGroupOffset);
            cFrame->SetRect(cRect);
          }
          cellFrame = cellFrame->GetNextSibling();
        }
        // check if a cell above spans into here
        nsTableCellMap* cellMap = GetCellMap();
        if (cellMap) {
          PRInt32 numCols = cellMap->GetColCount();
          nsTableCellFrame* lastCell = nsnull;
          for (int colX = 0; colX < numCols; colX++) {
            CellData* cellData = cellMap->GetDataAt(aRowX, colX);
            if (cellData && cellData->IsRowSpan()) { // a cell above is spanning into here
              // adjust the real cell's rect only once
              nsTableCellFrame* realCell = cellMap->GetCellFrame(aRowX, colX, *cellData, PR_TRUE);
              NS_ASSERTION(realCell, "row span without origin?");
              if (realCell && (realCell != lastCell)) {
                nsRect realRect = realCell->GetRect();
                realRect.height -= rowRect.height;
                realCell->SetRect(realRect);
              }
              lastCell = realCell;
            }
          }
        }
      } else { // row is not collapsed but needs to be adjusted by those that are
        rowRect.y -= aYGroupOffset;
        rowFrame->SetRect(rowRect);
        // reset the collapse yoffset
        nsIFrame* cellFrame = rowFrame->GetFirstChild(nsnull);
        while (cellFrame) {
          const nsStyleDisplay* cellDisplay = cellFrame->GetStyleDisplay();
          if (NS_STYLE_DISPLAY_TABLE_CELL == cellDisplay->mDisplay) {
            nsTableCellFrame* cFrame = (nsTableCellFrame*)cellFrame;
            // reset the offset as this row is not collapsed
            cFrame->SetCollapseOffsetY(0);
          }
          cellFrame = cellFrame->GetNextSibling();
        }
      }
      aRowX++;
    }
    rowFrame = rowFrame->GetNextSibling();
  } // end row frame while

  nsRect groupRect = aRowGroupFrame->GetRect();
  groupRect.height -= aYGroupOffset;
  groupRect.y -= aYTotalOffset;
  aRowGroupFrame->SetRect(groupRect);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 nsTableFrame::CollectRows ( nsIFrame aFrame,
nsVoidArray aCollection 
) [protected]

Definition at line 1251 of file nsTableFrame.cpp.

{
  if (!aFrame) return 0;
  PRInt32 numRows = 0;
  nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(aFrame);
  if (rgFrame) {
    nsIFrame* childFrame = rgFrame->GetFirstChild(nsnull);
    while (childFrame) {
      if (nsLayoutAtoms::tableRowFrame == childFrame->GetType()) {
        aCollection.AppendElement(childFrame);
        numRows++;
      }
      else {
        numRows += CollectRows(childFrame, aCollection);
      }
      childFrame = childFrame->GetNextSibling();
    }
  }
  return numRows;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual PRBool nsFrame::ComputesOwnOverflowArea ( ) [inline, virtual, inherited]

Implements nsBox.

Reimplemented in nsBoxFrame, and nsLeafBoxFrame.

Definition at line 152 of file nsFrame.h.

{ return PR_TRUE; }
void nsFrame::ConsiderChildOverflow ( nsRect aOverflowArea,
nsIFrame aChildFrame 
) [inherited]

Definition at line 4452 of file nsFrame.cpp.

{
  const nsStyleDisplay* disp = GetStyleDisplay();
  // check here also for hidden as table frames (table, tr and td) currently 
  // don't wrap their content into a scrollable frame if overflow is specified
  if (!disp->IsTableClip()) {
    nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty();
    if (overflowArea) {
      nsRect childOverflow(*overflowArea);
      childOverflow.MoveBy(aChildFrame->GetPosition());
      aOverflowArea.UnionRect(aOverflowArea, childOverflow);
    }
    else {
      aOverflowArea.UnionRect(aOverflowArea, aChildFrame->GetRect());
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsBox::CoordNeedsRecalc ( nscoord aCoord) [inherited]

Definition at line 640 of file nsBox.cpp.

{
  aFlex = -1;
}

Here is the caller graph for this function:

nsIFrame * nsFrame::CorrectStyleParentFrame ( nsIFrame aProspectiveParent,
nsIAtom aChildPseudo 
) [static, inherited]

Adjust the given parent frame to the right style context parent frame for the child, given the pseudo-type of the prospective child.

This handles things like walking out of table pseudos and so forth.

Parameters:
aProspectiveParentwhat GetParent() on the child returns. Must not be null.
aChildPseudothe child's pseudo type, if any.

Definition at line 4557 of file nsFrame.cpp.

{
  NS_PRECONDITION(aProspectiveParent, "Must have a prospective parent");

  // Anon boxes are parented to their actual parent already, except
  // for non-elements.  Those should not be treated as an anon box.
  if (aChildPseudo && aChildPseudo != nsCSSAnonBoxes::mozNonElement &&
      nsCSSAnonBoxes::IsAnonBox(aChildPseudo)) {
    NS_ASSERTION(aChildPseudo != nsCSSAnonBoxes::mozAnonymousBlock &&
                 aChildPseudo != nsCSSAnonBoxes::mozAnonymousPositionedBlock,
                 "Should have dealt with kids that have NS_FRAME_IS_SPECIAL "
                 "elsewhere");
    return aProspectiveParent;
  }

  // Otherwise, walk up out of all anon boxes
  nsIFrame* parent = aProspectiveParent;
  do {
    if (parent->GetStateBits() & NS_FRAME_IS_SPECIAL) {
      nsIFrame* sibling;
      nsresult rv =
        GetIBSpecialSibling(parent->GetPresContext(), parent, &sibling);
      if (NS_FAILED(rv)) {
        // If GetIBSpecialSibling fails, then what?  we used to return what is
        // now |aProspectiveParent|, but maybe |parent| would make more sense?
        NS_NOTREACHED("Shouldn't get here");
        return aProspectiveParent;
      }

      if (sibling) {
        // |parent| was the block in an {ib} split; use the inline as
        // |the style parent.
        parent = sibling;
      }
    }
      
    nsIAtom* parentPseudo = parent->GetStyleContext()->GetPseudoType();
    if (!parentPseudo || !nsCSSAnonBoxes::IsAnonBox(parentPseudo) ||
        parentPseudo == nsCSSAnonBoxes::dummyOption) {
      return parent;
    }

    parent = parent->GetParent();
  } while (parent);

  // We can get here if aProspectiveParent is the scrollframe for a viewport
  // and the kids are the anonymous scrollbars.
  NS_ASSERTION(aProspectiveParent->GetStyleContext()->GetPseudoType() ==
               nsCSSAnonBoxes::viewportScroll,
               "Should have found a parent before this");
  return aProspectiveParent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::CreateAnonymousColFrames ( PRInt32  aNumColsToAdd,
nsTableColType  aColType,
PRBool  aDoAppend,
nsIFrame aPrevCol = nsnull 
)

Definition at line 857 of file nsTableFrame.cpp.

{
  // get the last col group frame
  nsTableColGroupFrame* colGroupFrame = nsnull;
  nsIFrame* childFrame = mColGroups.FirstChild();
  while (childFrame) {
    if (nsLayoutAtoms::tableColGroupFrame == childFrame->GetType()) {
      colGroupFrame = (nsTableColGroupFrame *)childFrame;
    }
    childFrame = childFrame->GetNextSibling();
  }

  nsTableColGroupType lastColGroupType = eColGroupContent; 
  nsTableColGroupType newColGroupType  = eColGroupContent; 
  if (colGroupFrame) {
    lastColGroupType = colGroupFrame->GetColType();
  }
  if (eColAnonymousCell == aColType) {
    if (eColGroupAnonymousCell != lastColGroupType) {
      newColGroupType = eColGroupAnonymousCell;
    }
  }
  else if (eColAnonymousCol == aColType) {
    if (eColGroupAnonymousCol != lastColGroupType) {
      newColGroupType = eColGroupAnonymousCol;
    }
  }
  else {
    NS_ASSERTION(PR_FALSE, "CreateAnonymousColFrames called incorrectly");
    return;
  }

  if (eColGroupContent != newColGroupType) {
    PRInt32 colIndex = (colGroupFrame) ? colGroupFrame->GetStartColumnIndex() + colGroupFrame->GetColCount()
                                       : 0;
    colGroupFrame = CreateAnonymousColGroupFrame(newColGroupType);
    if (!colGroupFrame) {
      return;
    }
    mColGroups.AppendFrame(this, colGroupFrame); // add the new frame to the child list
    colGroupFrame->SetStartColumnIndex(colIndex);
  }

  nsIFrame* prevCol = (aDoAppend) ? colGroupFrame->GetChildList().LastChild() : aPrevColIn;

  nsIFrame* firstNewFrame;
  CreateAnonymousColFrames(colGroupFrame, aNumColsToAdd, aColType,
                           PR_TRUE, prevCol, &firstNewFrame);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::CreateAnonymousColFrames ( nsTableColGroupFrame aColGroupFrame,
PRInt32  aNumColsToAdd,
nsTableColType  aColType,
PRBool  aAddToColGroupAndTable,
nsIFrame aPrevCol,
nsIFrame **  aFirstNewFrame 
)

Definition at line 913 of file nsTableFrame.cpp.

{
  NS_PRECONDITION(aColGroupFrame, "null frame");
  *aFirstNewFrame = nsnull;
  nsIFrame* lastColFrame = nsnull;
  nsPresContext* presContext = GetPresContext();
  nsIPresShell *shell = presContext->PresShell();

  // Get the last col frame
  nsIFrame* childFrame = aColGroupFrame->GetFirstChild(nsnull);
  while (childFrame) {
    if (nsLayoutAtoms::tableColFrame == childFrame->GetType()) {
      lastColFrame = (nsTableColGroupFrame *)childFrame;
    }
    childFrame = childFrame->GetNextSibling();
  }

  PRInt32 startIndex = mColFrames.Count();
  PRInt32 lastIndex  = startIndex + aNumColsToAdd - 1; 

  for (PRInt32 childX = startIndex; childX <= lastIndex; childX++) {
    nsIContent* iContent;
    nsRefPtr<nsStyleContext> styleContext;
    nsStyleContext* parentStyleContext;

    if ((aColType == eColAnonymousCol) && aPrevFrameIn) {
      // a col due to a span in a previous col uses the style context of the col
      styleContext = aPrevFrameIn->GetStyleContext();
      // fix for bugzilla bug 54454: get the content from the prevFrame 
      iContent = aPrevFrameIn->GetContent();
    }
    else {
      // all other anonymous cols use a pseudo style context of the col group
      iContent = aColGroupFrame->GetContent();
      parentStyleContext = aColGroupFrame->GetStyleContext();
      styleContext = shell->StyleSet()->ResolvePseudoStyleFor(iContent,
                                                              nsCSSAnonBoxes::tableCol,
                                                              parentStyleContext);
    }
    // ASSERTION to check for bug 54454 sneaking back in...
    NS_ASSERTION(iContent, "null content in CreateAnonymousColFrames");

    // create the new col frame
    nsIFrame* colFrame;
    NS_NewTableColFrame(shell, &colFrame);
    ((nsTableColFrame *) colFrame)->SetColType(aColType);
    colFrame->Init(presContext, iContent, aColGroupFrame,
                   styleContext, nsnull);
    colFrame->SetInitialChildList(presContext, nsnull, nsnull);

    // Add the col to the sibling chain
    if (lastColFrame) {
      lastColFrame->SetNextSibling(colFrame);
    }
    lastColFrame = colFrame;
    if (childX == startIndex) {
      *aFirstNewFrame = colFrame;
    }
  }
  if (aAddToColGroupAndTable) {
    nsFrameList& cols = aColGroupFrame->GetChildList();
    // the chain already exists, now add it to the col group child list
    if (!aPrevFrameIn) {
      cols.AppendFrames(aColGroupFrame, *aFirstNewFrame);
    }
    // get the starting col index in the cache
    PRInt32 startColIndex = aColGroupFrame->GetStartColumnIndex();
    if (aPrevFrameIn) {
      nsTableColFrame* colFrame = 
        (nsTableColFrame*)nsTableFrame::GetFrameAtOrBefore((nsIFrame*) aColGroupFrame, aPrevFrameIn, 
                                                           nsLayoutAtoms::tableColFrame);
      if (colFrame) {
        startColIndex = colFrame->GetColIndex() + 1;
      }
    }
    aColGroupFrame->AddColsToTable(startColIndex, PR_TRUE, 
                                  *aFirstNewFrame, lastColFrame);
  }
}

Here is the call graph for this function:

Definition at line 836 of file nsTableFrame.cpp.

{
  nsIContent* colGroupContent = GetContent();
  nsPresContext* presContext = GetPresContext();
  nsIPresShell *shell = presContext->PresShell();

  nsRefPtr<nsStyleContext> colGroupStyle;
  colGroupStyle = shell->StyleSet()->ResolvePseudoStyleFor(colGroupContent,
                                                           nsCSSAnonBoxes::tableColGroup,
                                                           mStyleContext);
  // Create a col group frame
  nsIFrame* newFrame;
  nsresult result = NS_NewTableColGroupFrame(shell, &newFrame);
  if (NS_SUCCEEDED(result) && newFrame) {
    ((nsTableColGroupFrame *)newFrame)->SetColType(aColGroupType);
    newFrame->Init(presContext, colGroupContent, this, colGroupStyle, nsnull);
  }
  return (nsTableColGroupFrame *)newFrame;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsHTMLContainerFrame::CreateNextInFlow ( nsPresContext aPresContext,
nsIFrame aOuterFrame,
nsIFrame aFrame,
nsIFrame *&  aNextInFlowResult 
) [static, inherited]

Helper method to create next-in-flows if necessary.

Create a next-in-flow for aFrame.

If aFrame already has a next-in-flow then this method does nothing. Otherwise, a new continuation frame is created and linked into the flow. In addition, the new frame becomes the next-sibling of aFrame. If aPlaceholderResult is not null and aFrame is a float or positioned, then *aPlaceholderResult holds a placeholder.

Will return the newly created frame in aNextInFlowResult if and only if a new frame is created; otherwise nsnull is returned in aNextInFlowResult.

Definition at line 309 of file nsHTMLContainerFrame.cpp.

{
  aNextInFlowResult = nsnull;

  nsIFrame* nextInFlow = aFrame->GetNextInFlow();
  if (nsnull == nextInFlow) {
    // Create a continuation frame for the child frame and insert it
    // into our lines child list.
    nsIFrame* nextFrame = aFrame->GetNextSibling();

    nsresult rv = aPresContext->PresShell()->FrameConstructor()->
      CreateContinuingFrame(aPresContext, aFrame, aOuterFrame, &nextInFlow);
    if (NS_FAILED(rv)) {
      return rv;
    }
    aFrame->SetNextSibling(nextInFlow);
    nextInFlow->SetNextSibling(nextFrame);

    NS_FRAME_LOG(NS_FRAME_TRACE_NEW_FRAMES,
       ("nsHTMLContainerFrame::CreateNextInFlow: frame=%p nextInFlow=%p",
        aFrame, nextInFlow));

    aNextInFlowResult = nextInFlow;
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsHTMLContainerFrame::CreateViewForFrame ( nsIFrame aFrame,
nsIFrame aContentParentFrame,
PRBool  aForce 
) [static, inherited]

Helper method to wrap views around frames.

Used by containers under special circumstances (can be used by leaf frames as well)

Parameters:
aContentParentFrameif non-null, this is the frame which would have held aFrame except that aFrame was reparented to an alternative geometric parent. This is necessary so that aFrame can remember to get its Z-order from aContentParentFrame.

Definition at line 505 of file nsHTMLContainerFrame.cpp.

{
  if (aFrame->HasView()) {
    return NS_OK;
  }

  // If we don't yet have a view, see if we need a view
  if (!(aForce || FrameNeedsView(aFrame))) {
    // don't need a view
    return NS_OK;
  }

  nsIView* parentView = aFrame->GetParent()->GetParentViewForChildFrame(aFrame);
  NS_ASSERTION(parentView, "no parent with view");

  nsIViewManager* viewManager = parentView->GetViewManager();
  NS_ASSERTION(viewManager, "null view manager");
    
  // Create a view
  nsIView* view = viewManager->CreateView(aFrame->GetRect(), parentView);
  if (!view)
    return NS_ERROR_OUT_OF_MEMORY;

  SyncFrameViewProperties(aFrame->GetPresContext(), aFrame, nsnull, view);

  // Insert the view into the view hierarchy. If the parent view is a
  // scrolling view we need to do this differently
  nsIScrollableView*  scrollingView = parentView->ToScrollableView();
  if (scrollingView) {
    scrollingView->SetScrolledView(view);
  } else {
    nsIView* insertBefore = nsLayoutUtils::FindSiblingViewFor(parentView, aFrame);
    // we insert this view 'above' the insertBefore view, unless insertBefore is null,
    // in which case we want to call with aAbove == PR_FALSE to insert at the beginning
    // in document order
    viewManager->InsertChild(parentView, view, insertBefore, insertBefore != nsnull);

    if (nsnull != aContentParentFrame) {
      nsIView* zParentView = aContentParentFrame->GetClosestView();
      if (zParentView != parentView) {
        insertBefore = nsLayoutUtils::FindSiblingViewFor(zParentView, aFrame);
        viewManager->InsertZPlaceholder(zParentView, view, insertBefore, insertBefore != nsnull);
      }
    }
  }

  // XXX If it's fixed positioned, then create a widget so it floats
  // above the scrolling area
  const nsStyleDisplay* display = aFrame->GetStyleContext()->GetStyleDisplay();
  if (NS_STYLE_POSITION_FIXED == display->mPosition) {
    aFrame->CreateWidgetForView(view);
  }

  // Reparent views on any child frames (or their descendants) to this
  // view. We can just call ReparentFrameViewTo on this frame because
  // we know this frame has no view, so it will crawl the children. Also,
  // we know that any descendants with views must have 'parentView' as their
  // parent view.
  ReparentFrameViewTo(aFrame, viewManager, view, parentView);

  // Remember our view
  aFrame->SetView(view);

  NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
               ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p view=%p",
                aFrame));
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsIFrame::CreateWidgetForView ( nsIView aView) [virtual, inherited]

This frame needs a view with a widget (e.g.

because it's fixed positioned), so we call this to create the widget. If widgets for this frame type need to be of a certain type or require special initialization, that can be done here.

Definition at line 942 of file nsFrame.cpp.

{
  return aView->CreateWidget(kWidgetCID);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsContainerFrame::DeleteNextInFlowChild ( nsPresContext aPresContext,
nsIFrame aNextInFlow 
) [virtual, inherited]

Remove and delete aNextInFlow and its next-in-flows.

Updates the sibling and flow pointers

Definition at line 1036 of file nsContainerFrame.cpp.

{
  nsIFrame* prevInFlow = aNextInFlow->GetPrevInFlow();
  NS_PRECONDITION(prevInFlow, "bad prev-in-flow");
  NS_PRECONDITION(mFrames.ContainsFrame(aNextInFlow), "bad geometric parent");

  // If the next-in-flow has a next-in-flow then delete it, too (and
  // delete it first).
  // Do this in a loop so we don't overflow the stack for frames
  // with very many next-in-flows
  nsIFrame* nextNextInFlow = aNextInFlow->GetNextInFlow();
  if (nextNextInFlow) {
    nsAutoVoidArray frames;
    for (nsIFrame* f = nextNextInFlow; f; f = f->GetNextInFlow()) {
      frames.AppendElement(f);
    }
    for (PRInt32 i = frames.Count() - 1; i >= 0; --i) {
      nsIFrame* delFrame = NS_STATIC_CAST(nsIFrame*, frames.ElementAt(i));
      NS_STATIC_CAST(nsContainerFrame*, delFrame->GetParent())
        ->DeleteNextInFlowChild(aPresContext, delFrame);
    }
  }

#ifdef IBMBIDI
  if ((prevInFlow->GetStateBits() & NS_FRAME_IS_BIDI) &&
      (NS_STATIC_CAST(nsIFrame*,
                      aPresContext->PropertyTable()->GetProperty(prevInFlow, nsLayoutAtoms::nextBidi)) ==
       aNextInFlow)) {
    return;
  }
#endif // IBMBIDI

  // Disconnect the next-in-flow from the flow list
  nsSplittableFrame::BreakFromPrevFlow(aNextInFlow);

  // Take the next-in-flow out of the parent's child list
  PRBool result = mFrames.RemoveFrame(aNextInFlow);
  if (!result) {
    // We didn't find the child in the parent's principal child list.
    // Maybe it's on the overflow list?
    nsFrameList overflowFrames(GetOverflowFrames(aPresContext, PR_TRUE));

    if (overflowFrames.IsEmpty() || !overflowFrames.RemoveFrame(aNextInFlow)) {
      NS_ASSERTION(result, "failed to remove frame");
    }

    // Set the overflow property again
    if (overflowFrames.NotEmpty()) {
      SetOverflowFrames(aPresContext, overflowFrames.FirstChild());
    }
  }

  // Delete the next-in-flow frame and its descendants.
  aNextInFlow->Destroy(aPresContext);

  NS_POSTCONDITION(!prevInFlow->GetNextInFlow(), "non null next-in-flow");
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsTableFrame::Destroy ( nsPresContext aPresContext) [virtual]
See also:
nsIFrame::Destroy

Reimplemented from nsContainerFrame.

Definition at line 309 of file nsTableFrame.cpp.

{
  mColGroups.DestroyFrames(aPresContext);
  return nsHTMLContainerFrame::Destroy(aPresContext);
}

Here is the call graph for this function:

Definition at line 1048 of file nsTableFrame.cpp.

{
  // only remove cols that are of type eTypeAnonymous cell (they are at the end)
  PRInt32 endIndex   = mColFrames.Count() - 1;
  PRInt32 startIndex = (endIndex - aNumFrames) + 1;
  PRInt32 numColsRemoved = 0;
  for (PRInt32 colX = endIndex; colX >= startIndex; colX--) {
    nsTableColFrame* colFrame = GetColFrame(colX);
    if (colFrame && (eColAnonymousCell == colFrame->GetColType())) {
      nsTableColGroupFrame* cgFrame =
        NS_STATIC_CAST(nsTableColGroupFrame*, colFrame->GetParent());
      // remove the frame from the colgroup
      cgFrame->RemoveChild(*colFrame, PR_FALSE);
      // remove the frame from the cache, but not the cell map 
      RemoveCol(nsnull, colX, PR_TRUE, PR_FALSE);
      numColsRemoved++;
    }
    else {
      break; 
    }
  }
  return (aNumFrames - numColsRemoved);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::DidReflow ( nsPresContext aPresContext,
const nsHTMLReflowState aReflowState,
nsDidReflowStatus  aStatus 
) [virtual, inherited]

Post-reflow hook.

After a frame is reflowed this method will be called informing the frame that this reflow process is complete, and telling the frame the status returned by the Reflow member function.

This call may be invoked many times, while NS_FRAME_IN_REFLOW is set, before it is finally called once with a NS_FRAME_REFLOW_COMPLETE value. When called with a NS_FRAME_REFLOW_COMPLETE value the NS_FRAME_IN_REFLOW bit in the frame state will be cleared.

XXX This doesn't make sense. If the frame is reflowed but not complete, then the status should be NS_FRAME_NOT_COMPLETE and not NS_FRAME_COMPLETE XXX Don't we want the semantics to dictate that we only call this once for a given reflow?

Implements nsIFrame.

Reimplemented in nsSVGOuterSVGFrame, nsBoxFrame, nsMathMLContainerFrame, nsFormControlFrame, nsListControlFrame, and nsLeafBoxFrame.

Definition at line 2184 of file nsFrame.cpp.

{
  NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
                     ("nsFrame::DidReflow: aStatus=%d", aStatus));
  if (NS_FRAME_REFLOW_FINISHED == aStatus) {
    mState &= ~(NS_FRAME_IN_REFLOW | NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
                NS_FRAME_HAS_DIRTY_CHILDREN);
  }

  // Notify the percent height observer if this is an initial or resize reflow (XXX
  // it should probably be any type of reflow, but this would need further testing)
  // and there is a percent height but no computed height. The observer may be able to
  // initiate another reflow with a computed height. This happens in the case where a table
  // cell has no computed height but can fabricate one when the cell height is known.
  if (aReflowState && (aReflowState->mPercentHeightObserver)           && // an observer
      ((eReflowReason_Initial == aReflowState->reason) ||                 // initial or resize reflow
       (eReflowReason_Resize  == aReflowState->reason))                &&
      ((NS_UNCONSTRAINEDSIZE == aReflowState->mComputedHeight) ||         // no computed height 
       (0                    == aReflowState->mComputedHeight))        && 
      aReflowState->mStylePosition                                     && // percent height
      (eStyleUnit_Percent == aReflowState->mStylePosition->mHeight.GetUnit())) {

    nsIFrame* prevInFlow = GetPrevInFlow();
    if (!prevInFlow) { // 1st in flow
      aReflowState->mPercentHeightObserver->NotifyPercentHeight(*aReflowState);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsTableFrame::DidResizeReflow ( ) const [protected]

Definition at line 3997 of file nsTableFrame.cpp.

{
  nsTableFrame* firstInFlow = (nsTableFrame *)GetFirstInFlow();
  NS_ASSERTION(firstInFlow, "illegal state -- no first in flow");
  return (PRBool)firstInFlow->mBits.mDidResizeReflow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::DidSetStyleContext ( nsPresContext aPresContext) [protected, virtual, inherited]

Implements nsIFrame.

Reimplemented in nsSVGGradientFrame, nsSVGTextFrame, nsSVGGlyphFrame, nsSVGStopFrame, nsImageBoxFrame, nsSVGPathGeometryFrame, and nsBulletFrame.

Definition at line 681 of file nsFrame.cpp.

{
  return NS_OK;
}

Here is the caller graph for this function:

PRInt16 nsFrame::DisplaySelection ( nsPresContext aPresContext,
PRBool  isOkToTurnOn = PR_FALSE 
) [protected, inherited]

Definition at line 747 of file nsFrame.cpp.

{
  PRInt16 selType = nsISelectionController::SELECTION_OFF;

  nsCOMPtr<nsISelectionController> selCon;
  nsresult result = GetSelectionController(aPresContext, getter_AddRefs(selCon));
  if (NS_SUCCEEDED(result) && selCon) {
    result = selCon->GetDisplaySelection(&selType);
    if (NS_SUCCEEDED(result) && (selType != nsISelectionController::SELECTION_OFF)) {
      // Check whether style allows selection.
      PRBool selectable;
      IsSelectable(&selectable, nsnull);
      if (!selectable) {
        selType = nsISelectionController::SELECTION_OFF;
        isOkToTurnOn = PR_FALSE;
      }
    }
    if (isOkToTurnOn && (selType == nsISelectionController::SELECTION_OFF)) {
      selCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
      selType = nsISelectionController::SELECTION_ON;
    }
  }
  return selType;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTableFrame::DistributeHeightToRows ( const nsHTMLReflowState aReflowState,
nscoord  aAmount 
) [protected]

Definition at line 3626 of file nsTableFrame.cpp.

{ 
  nsPresContext *presContext = GetPresContext();
  float p2t;
  p2t = presContext->PixelsToTwips();

  nscoord cellSpacingY = GetCellSpacingY();

  nsMargin borderPadding = GetChildAreaOffset(&aReflowState);
  
  nsVoidArray rowGroups;
  PRUint32 numRowGroups;
  OrderRowGroups(rowGroups, numRowGroups, nsnull);

  nscoord amountUsed = 0;
  // distribute space to each pct height row whose row group doesn't have a computed 
  // height, and base the pct on the table height. If the row group had a computed 
  // height, then this was already done in nsTableRowGroupFrame::CalculateRowHeights
  nscoord pctBasis = aReflowState.mComputedHeight - (GetCellSpacingY() * (GetRowCount() + 1));
  nscoord yOriginRG = borderPadding.top + GetCellSpacingY();
  nscoord yEndRG = yOriginRG;
  PRUint32 rgX;
  for (rgX = 0; (rgX < numRowGroups); rgX++) {
    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame((nsIFrame*)rowGroups.ElementAt(rgX));
    nscoord amountUsedByRG = 0;
    nscoord yOriginRow = 0;
    nsRect rgRect = rgFrame->GetRect();
    if (rgFrame && !rgFrame->HasStyleHeight()) {
      nsTableRowFrame* rowFrame = rgFrame->GetFirstRow();
      while (rowFrame) {
        nsRect rowRect = rowFrame->GetRect();
        if ((amountUsed < aAmount) && rowFrame->HasPctHeight()) {
          nscoord pctHeight = nsTableFrame::RoundToPixel(rowFrame->GetHeight(pctBasis), p2t);
          nscoord amountForRow = PR_MIN(aAmount - amountUsed, pctHeight - rowRect.height);
          if (amountForRow > 0) {
            rowRect.height += amountForRow;
            rowFrame->SetRect(rowRect);
            yOriginRow += rowRect.height + cellSpacingY;
            yEndRG += rowRect.height + cellSpacingY;
            amountUsed += amountForRow;
            amountUsedByRG += amountForRow;
            //rowFrame->DidResize(aPresContext, aReflowState);        
            nsTableFrame::RePositionViews(rowFrame);
          }
        }
        else {
          if (amountUsed > 0) {
            rowFrame->SetPosition(nsPoint(rowRect.x, yOriginRow));
            nsTableFrame::RePositionViews(rowFrame);
          }
          yOriginRow += rowRect.height + cellSpacingY;
          yEndRG += rowRect.height + cellSpacingY;
        }
        rowFrame = rowFrame->GetNextRow();
      }
      if (amountUsed > 0) {
        rgRect.y = yOriginRG;
        rgRect.height += amountUsedByRG;
        rgFrame->SetRect(rgRect);
      }
    }
    else if (amountUsed > 0) {
      rgFrame->SetPosition(nsPoint(0, yOriginRG));
      // Make sure child views are properly positioned
      nsTableFrame::RePositionViews(rgFrame);
    }
    yOriginRG = yEndRG;
  }

  if (amountUsed >= aAmount) {
    ResizeCells(*this, presContext, aReflowState);
    return;
  }

  // get the first row without a style height where its row group has an unconstrianed height
  nsTableRowGroupFrame* firstUnStyledRG  = nsnull;
  nsTableRowFrame*      firstUnStyledRow = nsnull;
  for (rgX = 0; (rgX < numRowGroups) && !firstUnStyledRG; rgX++) {
    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame((nsIFrame*)rowGroups.ElementAt(rgX));
    if (rgFrame && !rgFrame->HasStyleHeight()) {
      nsTableRowFrame* rowFrame = rgFrame->GetFirstRow();
      while (rowFrame) {
        if (!rowFrame->HasStyleHeight()) {
          firstUnStyledRG = rgFrame;
          firstUnStyledRow = rowFrame;
          break;
        }
        rowFrame = rowFrame->GetNextRow();
      }
    }
  }

  nsTableRowFrame* lastElligibleRow = nsnull;
  // accumulate the correct divisor. This will be the total of all unstyled rows inside 
  // unstyled row groups, unless there are none, in which case, it will be all rows
  nscoord divisor = 0;
  for (rgX = 0; rgX < numRowGroups; rgX++) {
    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame((nsIFrame*)rowGroups.ElementAt(rgX));
    if (rgFrame && (!firstUnStyledRG || !rgFrame->HasStyleHeight())) {
      nsTableRowFrame* rowFrame = rgFrame->GetFirstRow();
      while (rowFrame) {
        if (!firstUnStyledRG || !rowFrame->HasStyleHeight()) {
          divisor += rowFrame->GetSize().height;
          lastElligibleRow = rowFrame;
        }
        rowFrame = rowFrame->GetNextRow();
      }
    }
  }
  if (divisor <= 0) {
    NS_ERROR("invalid divisor");
    return;
  }

  // allocate the extra height to the unstyled row groups and rows
  pctBasis = aAmount - amountUsed;
  yOriginRG = borderPadding.top + cellSpacingY;
  yEndRG = yOriginRG;
  for (rgX = 0; rgX < numRowGroups; rgX++) {
    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame((nsIFrame*)rowGroups.ElementAt(rgX));
    if (!rgFrame) continue; 
    nscoord amountUsedByRG = 0;
    nscoord yOriginRow = 0;
    nsRect rgRect = rgFrame->GetRect();
    // see if there is an eligible row group
    if (!firstUnStyledRG || !rgFrame->HasStyleHeight()) {
      nsTableRowFrame* rowFrame = rgFrame->GetFirstRow();
      while (rowFrame) {
        nsRect rowRect = rowFrame->GetRect();
        // see if there is an eligible row
        if (!firstUnStyledRow || !rowFrame->HasStyleHeight()) {
          // The amount of additional space each row gets is proportional to its height
          float percent = rowRect.height / ((float)divisor);
          // give rows their percentage, except for the last row which gets the remainder
          nscoord amountForRow = (rowFrame == lastElligibleRow) 
                                 ? aAmount - amountUsed : NSToCoordRound(((float)(pctBasis)) * percent);
          amountForRow = PR_MIN(nsTableFrame::RoundToPixel(amountForRow, p2t), aAmount - amountUsed);
          // update the row height
          nsRect newRowRect(rowRect.x, yOriginRow, rowRect.width, rowRect.height + amountForRow);
          rowFrame->SetRect(newRowRect);
          yOriginRow += newRowRect.height + cellSpacingY;
          yEndRG += newRowRect.height + cellSpacingY;

          amountUsed += amountForRow;
          amountUsedByRG += amountForRow;
          NS_ASSERTION((amountUsed <= aAmount), "invalid row allocation");
          //rowFrame->DidResize(aPresContext, aReflowState);        
          nsTableFrame::RePositionViews(rowFrame);
        }
        else {
          if (amountUsed > 0) {
            rowFrame->SetPosition(nsPoint(rowRect.x, yOriginRow));
            nsTableFrame::RePositionViews(rowFrame);
          }
          yOriginRow += rowRect.height + cellSpacingY;
          yEndRG += rowRect.height + cellSpacingY;
        }
        rowFrame = rowFrame->GetNextRow();
      }
      if (amountUsed > 0) {
        rgRect.y = yOriginRG;
        rgRect.height += amountUsedByRG;
        rgFrame->SetRect(rgRect);
      }
      // Make sure child views are properly positioned
      // XXX what happens if childFrame is a scroll frame and this gets skipped? see also below
    }
    else if (amountUsed > 0) {
      rgFrame->SetPosition(nsPoint(0, yOriginRG));
      // Make sure child views are properly positioned
      nsTableFrame::RePositionViews(rgFrame);
    }
    yOriginRG = yEndRG;
  }

  ResizeCells(*this, presContext, aReflowState);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsBox::DoesClipChildren ( ) [virtual, inherited]

Returns PR_TRUE if this box clips its children, e.g., if this box is an sc rollbox.

Reimplemented in nsXULScrollFrame, nsHTMLScrollFrame, and nsScrollbarFrame.

Definition at line 808 of file nsBox.cpp.

{
  const nsStyleDisplay* display = GetStyleDisplay();
  NS_ASSERTION((display->mOverflowY == NS_STYLE_OVERFLOW_CLIP) ==
               (display->mOverflowX == NS_STYLE_OVERFLOW_CLIP),
               "If one overflow is clip, the other should be too");
  return display->mOverflowX == NS_STYLE_OVERFLOW_CLIP;
}
PRBool nsBox::DoesNeedRecalc ( const nsSize aSize) [inherited]

Definition at line 646 of file nsBox.cpp.

{
  return (aSize.width == -1 || aSize.height == -1);
}

Here is the caller graph for this function:

PRBool nsBox::DoesNeedRecalc ( nscoord  aCoord) [inherited]

Definition at line 652 of file nsBox.cpp.

{
  return (aCoord == -1);
}
nsresult nsFrame::DoGetParentStyleContextFrame ( nsPresContext aPresContext,
nsIFrame **  aProviderFrame,
PRBool aIsChild 
) [inherited]

Definition at line 4612 of file nsFrame.cpp.

{
  *aIsChild = PR_FALSE;
  *aProviderFrame = nsnull;
  if (mContent && !mContent->GetParent() &&
      !GetStyleContext()->GetPseudoType()) {
    // we're a frame for the root.  We have no style context parent.
    return NS_OK;
  }
  
  if (!(mState & NS_FRAME_OUT_OF_FLOW)) {
    /*
     * If this frame is the anonymous block created when an inline
     * with a block inside it got split, then the parent style context
     * is on the first of the three special frames.  We can get to it
     * using GetIBSpecialSibling
     */
    if (mState & NS_FRAME_IS_SPECIAL) {
      nsresult rv = GetIBSpecialSibling(aPresContext, this, aProviderFrame);
      if (NS_FAILED(rv)) {
        NS_NOTREACHED("Shouldn't get here");
        *aProviderFrame = nsnull;
        return rv;
      }

      if (*aProviderFrame) {
        return NS_OK;
      }
    }

    // If this frame is one of the blocks that split an inline, we must
    // return the "special" inline parent, i.e., the parent that this
    // frame would have if we didn't mangle the frame structure.
    return GetCorrectedParent(aPresContext, this, aProviderFrame);
  }

  // For out-of-flow frames, we must resolve underneath the
  // placeholder's parent.
  nsIFrame *placeholder =
    aPresContext->FrameManager()->GetPlaceholderFrameFor(this);
  if (!placeholder) {
    NS_NOTREACHED("no placeholder frame for out-of-flow frame");
    GetCorrectedParent(aPresContext, this, aProviderFrame);
    return NS_ERROR_FAILURE;
  }
  return NS_STATIC_CAST(nsFrame*, placeholder)->
    GetParentStyleContextFrame(aPresContext, aProviderFrame, aIsChild);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsFrame::DoLayout ( nsBoxLayoutState aBoxLayoutState) [protected, inherited]

Reimplemented from nsBox.

Reimplemented in nsXULScrollFrame, nsSliderFrame, nsBoxFrame, nsMenuFrame, nsLeafBoxFrame, nsPopupSetFrame, nsListBoxBodyFrame, nsSplitterFrame, nsDeckFrame, and nsTextBoxFrame.

Definition at line 5221 of file nsFrame.cpp.

{
  nsRect ourRect(mRect);

  const nsHTMLReflowState* reflowState = aState.GetReflowState();
  nsPresContext* presContext = aState.PresContext();
  nsReflowStatus status = NS_FRAME_COMPLETE;
  nsHTMLReflowMetrics desiredSize(PR_FALSE);
  nsresult rv = NS_OK;
 
  if (reflowState) {

    nscoord* currentMEW = aState.GetMaxElementWidth();

    if (currentMEW) {
      desiredSize.mComputeMEW = PR_TRUE;
    }

    rv = BoxReflow(aState, presContext, desiredSize, *reflowState, status,
                   ourRect.x, ourRect.y, ourRect.width, ourRect.height);

    if (currentMEW && desiredSize.mMaxElementWidth > *currentMEW) {
      *currentMEW = desiredSize.mMaxElementWidth;
    }

    PRBool collapsed = PR_FALSE;
    IsCollapsed(aState, collapsed);
    if (collapsed) {
      SetSize(nsSize(0, 0));
    } else {

      // if our child needs to be bigger. This might happend with
      // wrapping text. There is no way to predict its height until we
      // reflow it. Now that we know the height reshuffle upward.
      if (desiredSize.width > ourRect.width ||
          desiredSize.height > ourRect.height) {

#ifdef DEBUG_GROW
        DumpBox(stdout);
        printf(" GREW from (%d,%d) -> (%d,%d)\n",
               ourRect.width, ourRect.height,
               desiredSize.width, desiredSize.height);
#endif

        if (desiredSize.width > ourRect.width)
          ourRect.width = desiredSize.width;

        if (desiredSize.height > ourRect.height)
          ourRect.height = desiredSize.height;
      }

      // ensure our size is what we think is should be. Someone could have
      // reset the frame to be smaller or something dumb like that. 
      SetSize(nsSize(ourRect.width, ourRect.height));
    }
  }

  SyncLayout(aState);

  return rv;
}

Here is the call graph for this function:

void nsTableFrame::ExpandBCDamageArea ( nsRect aRect) const [protected]

Definition at line 5691 of file nsTableFrame.cpp.

{
  PRInt32 numRows = GetRowCount();
  PRInt32 numCols = GetColCount();

  PRInt32 dStartX = aRect.x;
  PRInt32 dEndX   = aRect.XMost() - 1;
  PRInt32 dStartY = aRect.y;
  PRInt32 dEndY   = aRect.YMost() - 1;

  // expand the damage area in each direction
  if (dStartX > 0) {
    dStartX--;
  }
  if (dEndX < (numCols - 1)) {
    dEndX++;
  }
  if (dStartY > 0) {
    dStartY--;
  }
  if (dEndY < (numRows - 1)) {
    dEndY++;
  }
  // Check the damage area so that there are no cells spanning in or out. If there are any then
  // make the damage area as big as the table, similarly to the way the cell map decides whether
  // to rebuild versus expand. This could be optimized to expand to the smallest area that contains
  // no spanners, but it may not be worth the effort in general, and it would need to be done in the
  // cell map as well.
  PRBool haveSpanner = PR_FALSE;
  if ((dStartX > 0) || (dEndX < (numCols - 1)) || (dStartY > 0) || (dEndY < (numRows - 1))) {
    nsTableCellMap* tableCellMap = GetCellMap(); if (!tableCellMap) ABORT0();
    // Get the ordered row groups 
    PRUint32 numRowGroups;
    nsVoidArray rowGroups;
    OrderRowGroups(rowGroups, numRowGroups, nsnull);
    for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) {
      nsIFrame* kidFrame = (nsIFrame*)rowGroups.ElementAt(rgX);
      nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(kidFrame); if (!rgFrame) ABORT0();
      PRInt32 rgStartY = rgFrame->GetStartRowIndex();
      PRInt32 rgEndY   = rgStartY + rgFrame->GetRowCount() - 1;
      if (dEndY < rgStartY) 
        break;
      nsCellMap* cellMap = tableCellMap->GetMapFor(*rgFrame); if (!cellMap) ABORT0();
      // check for spanners from above and below
      if ((dStartY > 0) && (dStartY >= rgStartY) && (dStartY <= rgEndY)) {
        nsVoidArray* row = (nsVoidArray*)cellMap->mRows.ElementAt(dStartY - rgStartY); if (!row) ABORT0();
        for (PRInt32