Back to index

lightning-sunbird  0.9+nobinonly
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
nsSubDocumentFrame Class Reference
Inheritance diagram for nsSubDocumentFrame:
Inheritance graph
[legend]
Collaboration diagram for nsSubDocumentFrame:
Collaboration graph
[legend]

List of all members.

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

 nsSubDocumentFrame ()
NS_IMETHOD QueryInterface (REFNSIID aIID, void **aInstancePtr)
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)
virtual nsIAtomGetType () const
 Get the "type" of the frame.
NS_IMETHOD Init (nsPresContext *aPresContext, nsIContent *aContent, nsIFrame *aParent, nsStyleContext *aContext, nsIFrame *aPrevInFlow)
 Called to initialize the frame.
NS_IMETHOD Destroy (nsPresContext *aPresContext)
 Destroys this frame and each of its child frames (recursively calls Destroy() for each child)
NS_IMETHOD Reflow (nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
 The frame is given a maximum size and asked for its desired size.
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.
virtual PRBool SupportsVisibilityHidden ()
 Return PR_TRUE if and only if this frame obeys visibility:hidden.
NS_IMETHOD GetDocShell (nsIDocShell **aDocShell)
NS_IMETHOD VerifyTree () const
NS_IMETHOD Paint (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
 Paint is responsible for painting the frame.
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 SetInitialChildList (nsPresContext *aPresContext, nsIAtom *aListName, nsIFrame *aChildList)
 Called to set the initial list of frames.
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.
NS_IMETHOD ReplaceFrame (nsIAtom *aListName, nsIFrame *aOldFrame, nsIFrame *aNewFrame)
 This method is responsible for replacing the old frame with the new frame.
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)
virtual nsIAtomGetAdditionalChildListName (PRInt32 aIndex) const
 Used to iterate the list of additional child list names.
virtual nsIFrameGetFirstChild (nsIAtom *aListName) const
 Get the first child frame from the specified child list.
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 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 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 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 *)
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().
virtual PRBool IsContainingBlock () const
 Is this frame a containing block for non-positioned elements?
NS_IMETHOD SetSelected (nsPresContext *aPresContext, nsIDOMRange *aRange, PRBool aSelected, nsSpread aSpread)
 Selection related calls.
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 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.
NS_IMETHOD GetParentStyleContextFrame (nsPresContext *aPresContext, nsIFrame **aProviderFrame, PRBool *aIsChild)
 Called to retrieve this frame's accessible.
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)
virtual nsIFrameGetFirstInFlow () const
 Return the first frame in our current flow.
virtual nsIFrameGetLastInFlow () const
 Return the last frame in our current flow.
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 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 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 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 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

nsSize GetMargin ()
PRBool IsInline ()
nsresult ReloadURL ()
nsresult ShowDocShell ()
nsresult CreateViewAndWidget (nsContentType aContentType)
virtual void GetDesiredSize (nsPresContext *aPresContext, const nsHTMLReflowState &aReflowState, nsHTMLReflowMetrics &aDesiredSize)
 Return the desired size of the frame's content area.
virtual PRIntn GetSkipSides () const
void AddBordersAndPadding (nsPresContext *aPresContext, const nsHTMLReflowState &aReflowState, nsHTMLReflowMetrics &aDesiredSize, nsMargin &aBorderPadding)
 Subroutine to add in borders and padding.
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.
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)
virtual PRBool ParentDisablesSelection () const
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_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

nsCOMPtr< nsIFrameLoadermFrameLoader
nsIViewmInnerView
PRPackedBool mDidCreateDoc
PRPackedBool mOwnsFrameLoader
PRPackedBool mIsInline
nsRect mRect
nsIContentmContent
nsStyleContextmStyleContext
nsIFramemParent
nsIFramemNextSibling
nsFrameState mState

Static Protected Attributes

static PRBool gGotTheme = PR_FALSE
static nsIThemegTheme = nsnull

Friends

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

Definition at line 100 of file nsFrameFrame.cpp.


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


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:

void nsLeafFrame::AddBordersAndPadding ( nsPresContext aPresContext,
const nsHTMLReflowState aReflowState,
nsHTMLReflowMetrics aDesiredSize,
nsMargin aBorderPadding 
) [protected, inherited]

Subroutine to add in borders and padding.

Definition at line 98 of file nsLeafFrame.cpp.

{
  aBorderPadding = aReflowState.mComputedBorderPadding;
  aMetrics.width += aBorderPadding.left + aBorderPadding.right;
  aMetrics.height += aBorderPadding.top + aBorderPadding.bottom;
  aMetrics.ascent = aMetrics.height;
  aMetrics.descent = 0;
}

Here is the caller 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; }
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:

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

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

Implements nsIFrame.

Reimplemented in nsXULScrollFrame, nsTableFrame, nsHTMLScrollFrame, nsSVGOuterSVGFrame, nsBoxFrame, nsMenuFrame, nsSliderFrame, nsMathMLContainerFrame, nsTableRowGroupFrame, nsTableColGroupFrame, nsTableOuterFrame, nsHTMLButtonControlFrame, nsTableCellFrame, CanvasFrame, nsSVGTextFrame, nsSVGTSpanFrame, nsFieldSetFrame, nsRootBoxFrame, nsSVGInnerSVGFrame, ViewportFrame, nsTableRowFrame, nsSVGDefsFrame, nsSVGGenericContainerFrame, and nsColumnSetFrame.

Definition at line 584 of file nsFrame.cpp.

{
  NS_PRECONDITION(PR_FALSE, "not a container");
  return NS_ERROR_UNEXPECTED;
}
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 nsSubDocumentFrame::AttributeChanged ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [virtual]

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.

Reimplemented from nsFrame.

Definition at line 451 of file nsFrameFrame.cpp.

{
  if (aNameSpaceID != kNameSpaceID_None) {
    return NS_OK;
  }
  
  nsIAtom *type = aChild->Tag();

  if ((type != nsHTMLAtoms::object && aAttribute == nsHTMLAtoms::src) ||
      (type == nsHTMLAtoms::object && aAttribute == nsHTMLAtoms::data)) {
    ReloadURL();
  }
  // If the noResize attribute changes, dis/allow frame to be resized
  else if (aAttribute == nsHTMLAtoms::noresize) {
    // Note that we're not doing content type checks, but that's ok -- if
    // they'd fail we will just end up with a null framesetFrame.
    if (mContent->GetParent()->Tag() == nsHTMLAtoms::frameset) {
      nsIFrame* parentFrame = GetParent();

      if (parentFrame) {
        // There is no interface for nsHTMLFramesetFrame so QI'ing to
        // concrete class, yay!
        nsHTMLFramesetFrame* framesetFrame = nsnull;
        parentFrame->QueryInterface(NS_GET_IID(nsHTMLFramesetFrame),
                                    (void **)&framesetFrame);

        if (framesetFrame) {
          framesetFrame->RecalculateBorderResize();
        }
      }
    }
  }
  else if (aAttribute == nsHTMLAtoms::type) {
    if (!mFrameLoader) 
      return NS_OK;

    if (!mContent->IsContentOfType(nsIContent::eXUL)) {
      return NS_OK;
    }

    // Note: This logic duplicates a lot of logic in
    // nsFrameLoader::EnsureDocShell.  We should fix that.

    // Notify our enclosing chrome that our type has changed.  We only do this
    // if our parent is chrome, since in all other cases we're random content
    // subframes and the treeowner shouldn't worry about us.

    nsCOMPtr<nsIDocShell> docShell;
    mFrameLoader->GetDocShell(getter_AddRefs(docShell));
    nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(docShell));
    if (!docShellAsItem) {
      return NS_OK;
    }

    nsCOMPtr<nsIDocShellTreeItem> parentItem;
    docShellAsItem->GetParent(getter_AddRefs(parentItem));

    PRInt32 parentType;
    parentItem->GetItemType(&parentType);

    if (parentType != nsIDocShellTreeItem::typeChrome) {
      return NS_OK;
    }

    nsCOMPtr<nsIDocShellTreeOwner> parentTreeOwner;
    parentItem->GetTreeOwner(getter_AddRefs(parentTreeOwner));
    if (parentTreeOwner) {
      nsAutoString value;
      mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value);

      PRBool is_primary = value.LowerCaseEqualsLiteral("content-primary");

      // when a content panel is no longer primary, hide any open popups it may have
      if (!is_primary) {
        nsCOMPtr<nsIDocShell> docShell;
        GetDocShell(getter_AddRefs(docShell));
        if (docShell) {
          nsCOMPtr<nsIPresShell> presShell;
          docShell->GetPresShell(getter_AddRefs(presShell));

          nsCOMPtr<nsIPresShell_MOZILLA_1_8_BRANCH> presShell18 = do_QueryInterface(presShell);
          if (presShell18)
            presShell18->HidePopups();
        }
      }

      nsCOMPtr<nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH> owner2 =
        do_QueryInterface(parentTreeOwner);

      if (!owner2) {
        // XXXbz this adds stuff even if it's not of type content-*, but not
        // much we can do about that....
        parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary,
                                           value.get());
      } else {
        owner2->ContentShellRemoved(docShellAsItem);

        if (value.LowerCaseEqualsLiteral("content") ||
            StringBeginsWith(value, NS_LITERAL_STRING("content-"),
                             nsCaseInsensitiveStringComparator())) {
          PRBool is_targetable = is_primary ||
            value.LowerCaseEqualsLiteral("content-targetable");

          owner2->ContentShellAdded2(docShellAsItem, is_primary, is_targetable,
                                     value);
        }
      }
    }
  }

  return NS_OK;
}

Here is the call 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:

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:

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:

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:

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;
}
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:

Definition at line 794 of file nsFrameFrame.cpp.

{
  // create, init, set the parent of the view
  nsIView* outerView = GetView();
  NS_ASSERTION(outerView, "Must have an outer view already");
  nsRect viewBounds(0, 0, 0, 0); // size will be fixed during reflow

  nsIViewManager* viewMan = outerView->GetViewManager();
  // Create the inner view hidden if the outer view is already hidden
  // (it won't get hidden properly otherwise)
  nsIView* innerView = viewMan->CreateView(viewBounds, outerView,
                                           outerView->GetVisibility());
  if (!innerView) {
    NS_ERROR("Could not create inner view");
    return NS_ERROR_OUT_OF_MEMORY;
  }
  mInnerView = innerView;
  viewMan->InsertChild(outerView, innerView, nsnull, PR_TRUE);

  return innerView->CreateWidget(kCChildCID, nsnull, nsnull, PR_TRUE, PR_TRUE,
                                 aContentType);
}

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:

Destroys this frame and each of its child frames (recursively calls Destroy() for each child)

Reimplemented from nsFrame.

Definition at line 583 of file nsFrameFrame.cpp.

{
  if (mFrameLoader && mDidCreateDoc) {
    // Get the content viewer through the docshell, but don't call
    // GetDocShell() since we don't want to create one if we don't
    // have one.

    nsCOMPtr<nsIDocShell> docShell;
    mFrameLoader->GetDocShell(getter_AddRefs(docShell));

    if (docShell) {
      nsCOMPtr<nsIContentViewer> content_viewer;
      docShell->GetContentViewer(getter_AddRefs(content_viewer));

      if (content_viewer) {
        // Mark the content viewer as non-sticky so that the presentation
        // can safely go away when this frame is destroyed.

        content_viewer->SetSticky(PR_FALSE);
      }

      nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(docShell);
      NS_ASSERTION(baseWin, "Docshell must be an nsIBaseWindow");

      // Now reverse the steps we took in ShowDocShell().  But don't call
      // Destroy(); that will be handled by destroying our frame loader, if
      // needed.

      // Hide the content viewer now that the frame is going away...
      baseWin->SetVisibility(PR_FALSE);

      // Clear out the parentWidget, since it's about to die with us
      baseWin->SetParentWidget(nsnull);
    }
  }

  if (mFrameLoader && mOwnsFrameLoader) {
    // We own this frame loader, and we're going away, so destroy our
    // frame loader.

    mFrameLoader->Destroy();
  }

  return nsLeafFrame::Destroy(aPresContext);
}

Here is the call 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:

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:

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 nsFrame::FillCursorInformationFromStyle ( const nsStyleUserInterface ui,
nsIFrame::Cursor aCursor 
) [static, protected, inherited]

Definition at line 4861 of file nsFrame.cpp.

{
  aCursor.mCursor = ui->mCursor;
  aCursor.mHaveHotspot = PR_FALSE;
  aCursor.mHotspotX = aCursor.mHotspotY = 0.0f;

  for (nsCursorImage *item = ui->mCursorArray,
                 *item_end = ui->mCursorArray + ui->mCursorArrayLength;
       item < item_end; ++item) {
    PRUint32 status;
    nsresult rv = item->mImage->GetImageStatus(&status);
    if (NS_SUCCEEDED(rv) && (status & imgIRequest::STATUS_FRAME_COMPLETE)) {
      // This is the one we want
      item->mImage->GetImage(getter_AddRefs(aCursor.mContainer));
      aCursor.mHaveHotspot = item->mHaveHotspot;
      aCursor.mHotspotX = item->mHotspotX;
      aCursor.mHotspotY = item->mHotspotY;
      break;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIFrame::FinishAndStoreOverflow ( nsRect aOverflowArea,
nsSize  aNewSize 
) [inherited]

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.

Definition at line 4408 of file nsFrame.cpp.

{
  // This is now called FinishAndStoreOverflow() instead of 
  // StoreOverflow() because frame-generic ways of adding overflow
  // can happen here, e.g. CSS2 outline.
  // If we find more things other than outline that need to be added,
  // we should think about starting a new method like GetAdditionalOverflow()
  NS_ASSERTION(aNewSize.width == 0 || aNewSize.height == 0 ||
               aOverflowArea->Contains(nsRect(nsPoint(0, 0), aNewSize)),
               "Computed overflow area must contain frame bounds");

  PRBool geometricOverflow =
    aOverflowArea->x < 0 || aOverflowArea->y < 0 ||
    aOverflowArea->XMost() > aNewSize.width || aOverflowArea->YMost() > aNewSize.height;
  // Clear geometric overflow area if we clip our children
  NS_ASSERTION((GetStyleDisplay()->mOverflowY == NS_STYLE_OVERFLOW_CLIP) ==
               (GetStyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_CLIP),
               "If one overflow is clip, the other should be too");
  if (geometricOverflow &&
      GetStyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_CLIP) {
    *aOverflowArea = nsRect(nsPoint(0, 0), aNewSize);
    geometricOverflow = PR_FALSE;
  }

  PRBool hasOutline;
  nsRect outlineRect(ComputeOutlineRect(this, &hasOutline, *aOverflowArea));

  if (hasOutline || geometricOverflow) {
    // Throw out any overflow if we're -moz-hidden-unscrollable
    mState |= NS_FRAME_OUTSIDE_CHILDREN;
    nsRect* overflowArea = GetOverflowAreaProperty(PR_TRUE); 
    NS_ASSERTION(overflowArea, "should have created rect");
    *aOverflowArea = *overflowArea = outlineRect;
  } 
  else {
    if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
      // remove the previously stored overflow area 
      DeleteProperty(nsLayoutAtoms::overflowAreaProperty);
    }
    mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
  }   
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIFrame::FinishAndStoreOverflow ( nsHTMLReflowMetrics aMetrics) [inline, inherited]

Definition at line 1156 of file nsIFrame.h.

                                                             {
    FinishAndStoreOverflow(&aMetrics->mOverflowArea, nsSize(aMetrics->width, aMetrics->height));
  }

Here is the call graph for this function:

void nsFrame::FireDOMEvent ( const nsAString &  aDOMEventName,
nsIContent aContent = nsnull 
) [protected, inherited]

Definition at line 961 of file nsFrame.cpp.

{
  nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(aContent ? aContent : mContent);
  
  if (domNode) {
    nsPLDOMEvent *event = new nsPLDOMEvent(domNode, aDOMEventName);
    if (event && NS_FAILED(event->PostDOMEvent())) {
      PL_DestroyEvent(event);
    }
  }
}

Here is the call graph for this function:

nsIAtom * nsFrame::GetAdditionalChildListName ( PRInt32  aIndex) const [virtual, inherited]

Used to iterate the list of additional child list names.

Returns the atom name for the additional child list at the specified 0-based index, or a NULL pointer if there are no more named child lists.

Note that the list is only the additional named child lists and does not include the unnamed principal child list.

Implements nsIFrame.

Reimplemented in nsTableFrame, nsMenuFrame, nsTableOuterFrame, ViewportFrame, and nsContainerFrame.

Definition at line 719 of file nsFrame.cpp.

{
  NS_PRECONDITION(aIndex >= 0, "invalid index number");
  return nsnull;
}
nsStyleContext * nsFrame::GetAdditionalStyleContext ( PRInt32  aIndex) const [virtual, inherited]

These methods are to access any additional style contexts that the frame may be holding.

These are contexts that are children of the frame's primary context and are NOT used as style contexts for any child frames. These contexts also MUST NOT have any child contexts whatsoever. If you need to insert style contexts into the style tree, then you should create pseudo element frames to own them The indicies must be consecutive and implementations MUST return an NS_ERROR_INVALID_ARG if asked for an index that is out of range.

Implements nsIFrame.

Reimplemented in nsHTMLButtonControlFrame, nsMathMLmfracFrame, nsGfxCheckboxControlFrame, nsMathMLmsqrtFrame, nsGfxRadioControlFrame, nsMathMLmoFrame, nsMathMLmrootFrame, and nsMathMLmfencedFrame.

Definition at line 703 of file nsFrame.cpp.

{
  NS_PRECONDITION(aIndex >= 0, "invalid index number");
  return nsnull;
}
nsIFrame * nsIFrame::GetAncestorWithView ( ) const [inherited]

Find the closest ancestor (excluding |this| !) that has a view.

Definition at line 2374 of file nsFrame.cpp.

{
  for (nsIFrame* f = mParent; nsnull != f; f = f->GetParent()) {
    if (f->HasView()) {
      return f;
    }
  }
  return nsnull;
}

Here is the caller graph for this function:

nsIFrame * nsIFrame::GetAncestorWithViewExternal ( ) const [virtual, inherited]

Definition at line 2368 of file nsFrame.cpp.

{
  return GetAncestorWithView();
}

Here is the call graph for this function:

NS_IMETHODIMP nsFrame::GetAscent ( nsBoxLayoutState aBoxLayoutState,
nscoord aAscent 
) [virtual, inherited]

Reimplemented from nsBox.

Reimplemented in nsXULScrollFrame, nsBoxFrame, nsTextControlFrame, nsImageBoxFrame, nsLeafBoxFrame, and nsTextBoxFrame.

Definition at line 5194 of file nsFrame.cpp.

{
  nsBoxLayoutMetrics *metrics = BoxMetrics();
  if (!DoesNeedRecalc(metrics->mAscent)) {
    aAscent = metrics->mAscent;
    return NS_OK;
  }

  PRBool isCollapsed = PR_FALSE;
  IsCollapsed(aState, isCollapsed);
  if (isCollapsed) {
    metrics->mAscent = 0;
  } else {
    // Refresh our caches with new sizes.
    RefreshSizeCache(aState);
    metrics->mAscent = metrics->mBlockAscent;
    nsMargin m(0, 0, 0, 0);
    GetInset(m);
    metrics->mAscent += m.top;
  }

  aAscent = metrics->mAscent;

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsBox::GetBorder ( nsMargin aBorderAndPadding) [virtual, inherited]

Implements nsIFrame.

Definition at line 553 of file nsBox.cpp.

{
  aMargin.SizeTo(0,0,0,0);
    
  const nsStyleDisplay* disp = GetStyleDisplay();
  if (disp->mAppearance && gTheme) {
    // Go to the theme for the border.
    nsPresContext *context = GetPresContext();
    if (gTheme->ThemeSupportsWidget(context, this, disp->mAppearance)) {
      nsMargin margin(0, 0, 0, 0);
      gTheme->GetWidgetBorder(context->DeviceContext(), this,
                              disp->mAppearance, &margin);
      float p2t = context->ScaledPixelsToTwips();
      aMargin.top = NSIntPixelsToTwips(margin.top, p2t);
      aMargin.right = NSIntPixelsToTwips(margin.right, p2t);
      aMargin.bottom = NSIntPixelsToTwips(margin.bottom, p2t);
      aMargin.left = NSIntPixelsToTwips(margin.left, p2t);
      return NS_OK;
    }
  }

  aMargin = GetStyleBorder()->GetBorder();

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsIFrame::GetBorderAndPadding ( nsMargin aBorderAndPadding) [inherited]

Reimplemented in nsGridRowLeafFrame, and nsGroupBoxFrame.

Definition at line 535 of file nsBox.cpp.

{
  aBorderAndPadding.SizeTo(0, 0, 0, 0);
  nsresult rv = GetBorder(aBorderAndPadding);
  if (NS_FAILED(rv))
    return rv;

  nsMargin padding;
  rv = GetPadding(padding);
  if (NS_FAILED(rv))
    return rv;

  aBorderAndPadding += padding;

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsIFrame::GetChildBox ( nsIBox **  aBox) [inline, inherited]

Definition at line 1422 of file nsIFrame.h.

  {
    // box layout ends at box-wrapped frames, so don't allow these frames
    // to report child boxes.
    *aBox = IsBoxFrame() ? GetFirstChild(nsnull) : nsnull;
    return NS_OK;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetChildFrameContainingOffset ( PRInt32  inContentOffset,
PRBool  inHint,
PRInt32 outFrameContentOffset,
nsIFrame **  outChildFrame 
) [virtual, inherited]

Get the child frame of this frame which contains the given content offset.

outChildFrame may be this frame, or nsnull on return. outContentOffset returns the content offset relative to the start of the returned node. You can also pass a hint which tells the method to stick to the end of the first found frame or the beginning of the next in case the offset falls on a boundary.

Implements nsIFrame.

Reimplemented in nsTextFrame.

Definition at line 3198 of file nsFrame.cpp.

{
  NS_PRECONDITION(outChildFrame && outFrameContentOffset, "Null parameter");
  *outFrameContentOffset = (PRInt32)inHint;
  //the best frame to reflect any given offset would be a visible frame if possible
  //i.e. we are looking for a valid frame to place the blinking caret 
  nsRect rect = GetRect();
  if (!rect.width || !rect.height)
  {
    //if we have a 0 width or height then lets look for another frame that possibly has
    //the same content.  If we have no frames in flow then just let us return 'this' frame
    nsIFrame* nextFlow = GetNextInFlow();
    if (nextFlow)
      return nextFlow->GetChildFrameContainingOffset(inContentOffset, inHint, outFrameContentOffset, outChildFrame);
  }
  *outChildFrame = this;
  return NS_OK;
}

Here is the call graph for this function:

nsIView * nsIFrame::GetClosestView ( nsPoint aOffset = nsnull) const [inherited]

Find the closest view (on |this| or an ancestor).

If aOffset is non-null, it will be set to the offset of |this| from the returned view.

Definition at line 4339 of file nsFrame.cpp.

{
  nsPoint offset(0,0);
  for (const nsIFrame *f = this; f; f = f->GetParent()) {
    if (f->HasView()) {
      if (aOffset)
        *aOffset = offset;
      return f->GetView();
    }
    offset += f->GetPosition();
  }

  NS_NOTREACHED("No view on any parent?  How did that happen?");
  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIContent* nsIFrame::GetContent ( ) const [inline, inherited]

Get the content object associated with this frame.

Does not add a reference.

Definition at line 547 of file nsIFrame.h.

{ return mContent; }
nsresult nsFrame::GetContentAndOffsetsFromPoint ( nsPresContext aCX,
const nsPoint aPoint,
nsIContent **  aNewContent,
PRInt32 aContentOffset,
PRInt32 aContentOffsetEnd,
PRBool aBeginFrameContent 
) [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsTextFrame, nsXULScrollFrame, nsHTMLScrollFrame, and BRFrame.

Definition at line 1958 of file nsFrame.cpp.

{
  if (!aNewContent)
    return NS_ERROR_NULL_POINTER;

  // Traverse through children and look for the best one to give this
  // to if it fails the getposition call, make it yourself also only
  // look at primary list
  nsIFrame *closestFrame = nsnull;
  nsIView *view = GetClosestView();
  nsIFrame *kid = GetFirstChild(nsnull);

  if (kid) {
#define HUGE_DISTANCE 999999 //some HUGE number that will always fail first comparison

    PRInt32 closestXDistance = HUGE_DISTANCE;
    PRInt32 closestYDistance = HUGE_DISTANCE;

    while (nsnull != kid) {

      // Skip over generated content kid frames, or frames
      // that don't have a proper parent-child relationship!

      PRBool skipThisKid = (kid->GetStateBits() & NS_FRAME_GENERATED_CONTENT) != 0;
#if 0
      if (!skipThisKid) {
        // The frame's content is not generated. Now check
        // if it is anonymous content!

        nsIContent* kidContent = kid->GetContent();
        if (kidContent) {
          nsCOMPtr<nsIContent> content = kidContent->GetParent();

          if (content) {
            PRInt32 kidCount = content->ChildCount();
            PRInt32 kidIndex = content->IndexOf(kidContent);

            // IndexOf() should return -1 for the index if it doesn't
            // find kidContent in it's child list.

            if (kidIndex < 0 || kidIndex >= kidCount) {
              // Must be anonymous content! So skip it!
              skipThisKid = PR_TRUE;
            }
          }
        }
      }
#endif //XXX we USED to skip anonymous content i dont think we should anymore leaving this here as a flah

      if (skipThisKid) {
        kid = kid->GetNextSibling();
        continue;
      }

      // Kid frame has content that has a proper parent-child
      // relationship. Now see if the aPoint inside it's bounding
      // rect or close by.

      nsPoint offsetPoint(0,0);
      nsIView * kidView = nsnull;
      kid->GetOffsetFromView(offsetPoint, &kidView);

      nsRect rect = kid->GetRect();
      rect.x = offsetPoint.x;
      rect.y = offsetPoint.y;

      nscoord fromTop = aPoint.y - rect.y;
      nscoord fromBottom = aPoint.y - rect.y - rect.height;

      PRInt32 yDistance;
      if (fromTop > 0 && fromBottom < 0)
        yDistance = 0;
      else
        yDistance = PR_MIN(abs(fromTop), abs(fromBottom));

      if (yDistance <= closestYDistance && rect.width > 0 && rect.height > 0)
      {
        if (yDistance < closestYDistance)
          closestXDistance = HUGE_DISTANCE;

        nscoord fromLeft = aPoint.x - rect.x;
        nscoord fromRight = aPoint.x - rect.x - rect.width;

        PRInt32 xDistance;
        if (fromLeft > 0 && fromRight < 0)
          xDistance = 0;
        else
          xDistance = PR_MIN(abs(fromLeft), abs(fromRight));

        if (xDistance == 0 && yDistance == 0)
        {
          closestFrame = kid;
          break;
        }

        if (xDistance < closestXDistance || (xDistance == closestXDistance && rect.x <= aPoint.x))
        {
          // If we are only near (not directly over) then don't traverse a frame with independent
          // selection (e.g. text and list controls) unless we're already inside such a frame,
          // except in "browsewithcaret" mode, bug 268497.
          if (!(kid->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION) ||
              (GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION) ||
              nsContentUtils::GetBoolPref("accessibility.browsewithcaret")) {
            closestXDistance = xDistance;
            closestYDistance = yDistance;
            closestFrame     = kid;
          }
        }
        // else if (xDistance > closestXDistance)
        //   break;//done
      }
    
      kid = kid->GetNextSibling();
    }
    if (closestFrame) {

      // If we cross a view boundary, we need to adjust
      // the coordinates because GetPosition() expects
      // them to be relative to the closest view.

      nsPoint newPoint     = aPoint;
      nsIView *closestView = closestFrame->GetClosestView();

      if (closestView && view != closestView)
        newPoint -= closestView->GetOffsetTo(view);

      // printf("      0x%.8x   0x%.8x  %4d  %4d\n",
      //        closestFrame, closestView, closestXDistance, closestYDistance);

      return closestFrame->GetContentAndOffsetsFromPoint(aCX, newPoint, aNewContent,
                                                         aContentOffset, aContentOffsetEnd,aBeginFrameContent);
    }
  }

  if (!mContent)
    return NS_ERROR_NULL_POINTER;

  nsPoint offsetPoint;
  GetOffsetFromView(offsetPoint, &view);
  nsRect thisRect = GetRect();
  thisRect.x = offsetPoint.x;
  thisRect.y = offsetPoint.y;

  NS_IF_ADDREF(*aNewContent = mContent->GetParent());
  if (*aNewContent){
    
    PRInt32 contentOffset(aContentOffset); //temp to hold old value in case of failure
    
    contentOffset = (*aNewContent)->IndexOf(mContent);
    if (contentOffset < 0) 
    {
      return NS_ERROR_FAILURE;
    }
    aContentOffset = contentOffset; //its clear save the result

    aBeginFrameContent = PR_TRUE;
    if (thisRect.Contains(aPoint))
      aContentOffsetEnd = aContentOffset +1;
    else 
    {
      //if we are a collapsed frame then dont check to see if we need to skip past this content
      //see bug http://bugzilla.mozilla.org/show_bug.cgi?id=103888
      if (thisRect.width && thisRect.height && ((thisRect.x + thisRect.width) < aPoint.x  || thisRect.y > aPoint.y))
      {
        aBeginFrameContent = PR_FALSE;
        aContentOffset++;
      }
      aContentOffsetEnd = aContentOffset;
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetContentForEvent ( nsPresContext aPresContext,
nsEvent aEvent,
nsIContent **  aContent 
) [virtual, inherited]

Implements nsIFrame.

Reimplemented in CanvasFrame, and nsHTMLCanvasFrame.

Definition at line 951 of file nsFrame.cpp.

{
  *aContent = GetContent();
  NS_IF_ADDREF(*aContent);
  return NS_OK;
}

Here is the call graph for this function:

virtual nsIFrame* nsIFrame::GetContentInsertionFrame ( ) [inline, virtual, inherited]

Get the frame that should be the parent for the frames of child elements.

Reimplemented in nsXULScrollFrame, nsHTMLScrollFrame, nsHTMLButtonControlFrame, nsTableOuterFrame, nsListControlFrame, nsTableCellFrame, nsColumnSetFrame, and nsXTFXULDisplayFrame.

Definition at line 552 of file nsIFrame.h.

{ return this; }

Here is the caller graph for this function:

virtual already_AddRefed<nsIContent> nsIFrame::GetContentInsertionNode ( ) [inline, virtual, inherited]

Get the child content node whose frame should be used as the parent for the frames of child elements.

A frame can implement this method, instead of GetContentInsertionFrame, if its insertion point corresponds to a content node, and the frame for that node is not constructed immediately when the frame is initialized.

Reimplemented in nsXTFXULDisplayFrame.

Definition at line 561 of file nsIFrame.h.

{ return nsnull; }
NS_IMETHODIMP nsFrame::GetCursor ( const nsPoint aPoint,
nsIFrame::Cursor aCursor 
) [virtual, inherited]

Get the cursor for a given frame.

Implements nsIFrame.

Reimplemented in nsTextFrame, nsHTMLFramesetBorderFrame, nsHTMLFramesetFrame, nsBoxFrame, nsTreeBodyFrame, and nsSplitterFrame.

Definition at line 2137 of file nsFrame.cpp.

{
  FillCursorInformationFromStyle(GetStyleUserInterface(), aCursor);
  if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
    aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
  }


  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsFrame::GetDataForTableSelection ( nsIFrameSelection aFrameSelection,
nsIPresShell aPresShell,
nsMouseEvent aMouseEvent,
nsIContent **  aParentContent,
PRInt32 aContentOffset,
PRInt32 aTarget 
) [protected, inherited]

Definition at line 1002 of file nsFrame.cpp.

{
  if (!aFrameSelection || !aPresShell || !aMouseEvent || !aParentContent || !aContentOffset || !aTarget)
    return NS_ERROR_NULL_POINTER;

  *aParentContent = nsnull;
  *aContentOffset = 0;
  *aTarget = 0;

  PRInt16 displaySelection;
  nsresult result = aPresShell->GetSelectionFlags(&displaySelection);
  if (NS_FAILED(result))
    return result;

  PRBool selectingTableCells = PR_FALSE;
  aFrameSelection->GetTableCellSelection(&selectingTableCells);

  // DISPLAY_ALL means we're in an editor.
  // If already in cell selection mode, 
  //  continue selecting with mouse drag or end on mouse up,
  //  or when using shift key to extend block of cells
  //  (Mouse down does normal selection unless Ctrl/Cmd is pressed)
  PRBool doTableSelection =
     displaySelection == nsISelectionDisplay::DISPLAY_ALL && selectingTableCells &&
     (aMouseEvent->message == NS_MOUSE_MOVE ||
      aMouseEvent->message == NS_MOUSE_LEFT_BUTTON_UP || 
      aMouseEvent->isShift);

  if (!doTableSelection)
  {  
    // In Browser, special 'table selection' key must be pressed for table selection
    // or when just Shift is pressed and we're already in table/cell selection mode
#if defined(XP_MAC) || defined(XP_MACOSX)
    doTableSelection = aMouseEvent->isMeta || (aMouseEvent->isShift && selectingTableCells);
#else
    doTableSelection = aMouseEvent->isControl || (aMouseEvent->isShift && selectingTableCells);
#endif
  }
  if (!doTableSelection) 
    return NS_OK;

  // Get the cell frame or table frame (or parent) of the current content node
  nsIFrame *frame = this;
  PRBool foundCell = PR_FALSE;
  PRBool foundTable = PR_FALSE;

  // Get the limiting node to stop parent frame search
  nsCOMPtr<nsIContent> limiter;
  result = aFrameSelection->GetLimiter(getter_AddRefs(limiter));

  //We don't initiate row/col selection from here now,
  //  but we may in future
  //PRBool selectColumn = PR_FALSE;
  //PRBool selectRow = PR_FALSE;

  while (frame && NS_SUCCEEDED(result))
  {
    // Check for a table cell by querying to a known CellFrame interface
    nsITableCellLayout *cellElement;
    result = (frame)->QueryInterface(NS_GET_IID(nsITableCellLayout), (void **)&cellElement);
    if (NS_SUCCEEDED(result) && cellElement)
    {
      foundCell = PR_TRUE;
      //TODO: If we want to use proximity to top or left border
      //      for row and column selection, this is the place to do it
      break;
    }
    else
    {
      // If not a cell, check for table
      // This will happen when starting frame is the table or child of a table,
      //  such as a row (we were inbetween cells or in table border)
      nsITableLayout *tableElement;
      result = (frame)->QueryInterface(NS_GET_IID(nsITableLayout), (void **)&tableElement);
      if (NS_SUCCEEDED(result) && tableElement)
      {
        foundTable = PR_TRUE;
        //TODO: How can we select row when along left table edge
        //  or select column when along top edge?
        break;
      } else {
        frame = frame->GetParent();
        result = NS_OK;
        // Stop if we have hit the selection's limiting content node
        if (frame && frame->GetContent() == limiter.get())
          break;
      }
    }
  }
  // We aren't in a cell or table
  if (!foundCell && !foundTable) return NS_OK;

  nsIContent* tableOrCellContent = frame->GetContent();
  if (!tableOrCellContent) return NS_ERROR_FAILURE;

  nsCOMPtr<nsIContent> parentContent = tableOrCellContent->GetParent();
  if (!parentContent) return NS_ERROR_FAILURE;

  PRInt32 offset = parentContent->IndexOf(tableOrCellContent);
  // Not likely?
  if (offset < 0) return NS_ERROR_FAILURE;

  // Everything is OK -- set the return values
  *aParentContent = parentContent;
  NS_ADDREF(*aParentContent);

  *aContentOffset = offset;

#if 0
  if (selectRow)
    *aTarget = nsISelectionPrivate::TABLESELECTION_ROW;
  else if (selectColumn)
    *aTarget = nsISelectionPrivate::TABLESELECTION_COLUMN;
  else 
#endif
  if (foundCell)
    *aTarget = nsISelectionPrivate::TABLESELECTION_CELL;
  else if (foundTable)
    *aTarget = nsISelectionPrivate::TABLESELECTION_TABLE;

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsBox::GetDefaultFlex ( PRInt32 aFlex) [protected, virtual, inherited]

Definition at line 1363 of file nsBox.cpp.

{ 
  aFlex = 0; 
  return PR_TRUE; 
}

Here is the caller graph for this function:

void nsSubDocumentFrame::GetDesiredSize ( nsPresContext aPresContext,
const nsHTMLReflowState aReflowState,
nsHTMLReflowMetrics aDesiredSize 
) [protected, virtual]

Return the desired size of the frame's content area.

Note that this method doesn't need to deal with padding or borders (the caller will deal with it). In addition, the ascent will be set to the height and the descent will be set to zero.

Implements nsLeafFrame.

Definition at line 293 of file nsFrameFrame.cpp.

{
  // <frame> processing does not use this routine, only <iframe>
  float p2t = 0;
  if (!mContent->IsContentOfType(nsIContent::eXUL))
    // If no width/height was specified, use 300/150.
    // This is for compatability with IE.
    p2t = aPresContext->ScaledPixelsToTwips();

  if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) {
    aDesiredSize.width = aReflowState.mComputedWidth;
  }
  else {
    aDesiredSize.width = PR_MAX(PR_MIN(NSIntPixelsToTwips(300, p2t),
                                       aReflowState.mComputedMaxWidth), 
                                aReflowState.mComputedMinWidth);
  }
  if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) {
    aDesiredSize.height = aReflowState.mComputedHeight;
  }
  else {
    aDesiredSize.height = PR_MAX(PR_MIN(NSIntPixelsToTwips(150, p2t),
                                        aReflowState.mComputedMaxHeight),
                                 aReflowState.mComputedMinHeight);
  }
  aDesiredSize.ascent = aDesiredSize.height;
  aDesiredSize.descent = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsIFrame::GetDirection ( PRBool aIsNormal) [inline, inherited]

XXX to be removed.

Definition at line 1458 of file nsIFrame.h.

  { aIsNormal = IsNormalDirection(); return NS_OK; }

Here is the call graph for this function:

Implements nsIFrameFrame.

Definition at line 647 of file nsFrameFrame.cpp.

{
  *aDocShell = nsnull;

  nsIContent* content = GetContent();
  if (!content) {
    // Hmm, no content in this frame
    // that's odd, not much to be done here then.
    return NS_OK;
  }

  if (!mFrameLoader) {
    nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(content);

    if (loaderOwner) {
      loaderOwner->GetFrameLoader(getter_AddRefs(mFrameLoader));
    }

    if (!mFrameLoader) {
      // No frame loader available from the content, create our own...
      mFrameLoader = new nsFrameLoader(content);
      if (!mFrameLoader)
        return NS_ERROR_OUT_OF_MEMORY;

      // ... remember that we own this frame loader...
      mOwnsFrameLoader = PR_TRUE;

      // ... and tell it to start loading.
      // the failure to load a URL does not constitute failure to 
      // create/initialize the docshell and therefore the LoadFrame() 
      // call's return value should not be propagated.
      mFrameLoader->LoadFrame();
    }
  }

  return mFrameLoader->GetDocShell(aDocShell);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gets the first or last possible caret position within the frame

Parameters:
[in]aStarttrue for getting the first possible caret position false for getting the last possible caret position
Returns:
The caret position in an nsPeekOffsetStruct (the fields set are mResultContent and mContentOffset; the returned value is a 'best effort' in case errors are encountered rummaging through the frame.

Definition at line 3478 of file nsFrame.cpp.

{
  nsPeekOffsetStruct result;

  result.mResultContent = this->GetContent();
  result.mContentOffset = 0;

  nsIFrame *resultFrame = this;

  if (aStart)
    nsFrame::GetFirstLeaf(GetPresContext(), &resultFrame);
  else
    nsFrame::GetLastLeaf(GetPresContext(), &resultFrame);

  NS_ASSERTION(resultFrame,"result frame for carent positioning is Null!");

  if (!resultFrame)
    return result;

  // there should be some more validity checks here, or earlier in the code,
  // in case we get to to some 'dummy' frames at the end of the content
    
  nsIContent* content = resultFrame->GetContent();

  NS_ASSERTION(resultFrame,"result frame content for carent positioning is Null!");

  if (!content)
    return result;
  
  // special case: if this is not a textnode,
  // position the caret to the offset of its parent instead
  // (position the caret to non-text element may make the caret missing)

  if (!content->IsContentOfType(nsIContent::eTEXT)) {
    // special case in effect
    nsIContent* parent = content->GetParent();
    NS_ASSERTION(parent,"element has no parent!");
    if (parent) {
      result.mResultContent = parent;
      result.mContentOffset = parent->IndexOf(content);
      if (!aStart)
        result.mContentOffset++; // go to end of this frame
      return result;
    }
  }

  result.mResultContent = content;

  PRInt32 start, end;
  nsresult rv;
  rv = resultFrame->GetOffsets(start,end);
  if (NS_SUCCEEDED(rv)) {
    result.mContentOffset = aStart ? start : end;
  }

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIFrame * nsFrame::GetFirstChild ( nsIAtom aListName) const [virtual, inherited]

Get the first child frame from the specified child list.

Parameters:
aListNamethe name of the child list. A NULL pointer for the atom name means the unnamed principal child list
Returns:
the child frame, or NULL if there is no such child
See also:
#GetAdditionalListName()

Implements nsIFrame.

Reimplemented in nsTableFrame, nsMenuFrame, nsTableOuterFrame, ViewportFrame, and nsContainerFrame.

Definition at line 726 of file nsFrame.cpp.

{
  return nsnull;
}

Here is the caller graph for this function:

virtual nsIFrame* nsIFrame::GetFirstInFlow ( ) const [inline, virtual, inherited]

Return the first frame in our current flow.

Reimplemented in nsContinuingTextFrame, and nsSplittableFrame.

Definition at line 872 of file nsIFrame.h.

                                           {
    return NS_CONST_CAST(nsIFrame*, this);
  }

Here is the caller graph for this function:

void nsFrame::GetFirstLeaf ( nsPresContext aPresContext,
nsIFrame **  aFrame 
) [static, inherited]

Definition at line 4692 of file nsFrame.cpp.

{
  if (!aFrame || !*aFrame)
    return;
  nsIFrame *child = *aFrame;
  while (1){
    child = child->GetFirstChild(nsnull);
    if (!child)
      return;//nothing to do
    *aFrame = child;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetFlex ( nsBoxLayoutState aBoxLayoutState,
nscoord aFlex 
) [virtual, inherited]

Reimplemented from nsBox.

Reimplemented in nsBoxFrame, nsGridRowGroupFrame, and nsLeafBoxFrame.

Definition at line 5177 of file nsFrame.cpp.

{
  nsBoxLayoutMetrics *metrics = BoxMetrics();
  if (!DoesNeedRecalc(metrics->mFlex)) {
     aFlex = metrics->mFlex;
     return NS_OK;
  }

  metrics->mFlex = 0;
  nsBox::GetFlex(aState, metrics->mFlex);

  aFlex = metrics->mFlex;

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsFrame::GetFrameForPoint ( const nsPoint aPoint,
nsFramePaintLayer  aWhichLayer,
nsIFrame **  aFrame 
) [virtual, inherited]

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.

A frame should return itself if it should recieve the events. A successful return value indicates that a point was found.

Implements nsIFrame.

Reimplemented in nsTableFrame, nsSVGOuterSVGFrame, nsSliderFrame, nsMenuPopupFrame, nsTableColGroupFrame, nsTableRowGroupFrame, nsHTMLFramesetBorderFrame, nsMenuFrame, nsHTMLFramesetFrame, nsTableOuterFrame, nsTableCellFrame, nsBoxFrame, nsTableColFrame, nsFormControlFrame, CanvasFrame, nsTableRowFrame, nsSplitterFrame, nsFieldSetFrame, nsRootBoxFrame, nsTextControlFrame, nsHTMLButtonControlFrame, nsLeafBoxFrame, nsStackFrame, nsMathMLmactionFrame, ViewportFrame, nsContainerFrame, nsDeckFrame, nsColumnSetFrame, nsTreeColFrame, nsListItemFrame, nsTitleBarFrame, and nsButtonBoxFrame.

Definition at line 2150 of file nsFrame.cpp.

{
  if ((aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) &&
      (mRect.Contains(aPoint))) {
    if (GetStyleVisibility()->IsVisible()) {
      *aFrame = this;
      return NS_OK;
    }
  }
  return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsFrame::GetFrameFromDirection ( nsPresContext aPresContext,
nsPeekOffsetStruct aPos 
) [protected, inherited]

Definition at line 4071 of file nsFrame.cpp.

{
  nsIFrame *blockFrame = this;
  nsIFrame *thisBlock;
  PRInt32   thisLine;
  nsCOMPtr<nsILineIteratorNavigator> it; 
  PRBool preferLeft = aPos->mPreferLeft;
  nsresult result = NS_ERROR_FAILURE;
  while (NS_FAILED(result) && blockFrame)
  {
    thisBlock = blockFrame;
    blockFrame = blockFrame->GetParent();
    result = NS_OK;
    if (blockFrame) {
      result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
    }
  }
  if (!blockFrame || !it)
    return NS_ERROR_FAILURE;
  result = it->FindLineContaining(thisBlock, &thisLine);
  if (NS_FAILED(result))
    return result;

  nsIFrame *traversedFrame = this;

  nsIFrame *firstFrame;
  nsIFrame *lastFrame;
  nsRect  nonUsedRect;
  PRInt32 lineFrameCount;
  PRUint32 lineFlags;

#ifdef IBMBIDI
  /* Check whether the visual and logical order of the frames are different */
  PRBool lineIsReordered = PR_FALSE;
  nsIFrame *firstVisual;
  nsIFrame *lastVisual;
  PRBool lineIsRTL;
  PRBool lineJump = PR_FALSE;

  it->GetDirection(&lineIsRTL);
  result = it->CheckLineOrder(thisLine, &lineIsReordered, &firstVisual, &lastVisual);
  if (NS_FAILED(result))
    return result;

  if (lineIsReordered) {
    firstFrame = firstVisual;
    lastFrame = lastVisual;
  }
  else
#endif
  {
    result = it->GetLine(thisLine, &firstFrame, &lineFrameCount,nonUsedRect,
                         &lineFlags);
    if (NS_FAILED(result))
      return result;

    lastFrame = firstFrame;
    for (;lineFrameCount > 1;lineFrameCount --){
      result = it->GetNextSiblingOnLine(lastFrame, thisLine);
      if (NS_FAILED(result) || !lastFrame){
        NS_ASSERTION(0,"should not be reached nsFrame\n");
        return NS_ERROR_FAILURE;
      }
    }
  }

  GetFirstLeaf(aPresContext, &firstFrame);
  GetLastLeaf(aPresContext, &lastFrame);
  //END LINE DATA CODE
  if 
#ifndef IBMBIDI  // jumping lines in RTL paragraphs
      ((aPos->mDirection == eDirNext && lastFrame == this)
       ||(aPos->mDirection == eDirPrevious && firstFrame == this))
#else
      (((lineIsRTL) &&
        ((aPos->mDirection == eDirNext && firstFrame == this)
         ||(aPos->mDirection == eDirPrevious && lastFrame == this)))
       ||
       ((!lineIsRTL) &&
        ((aPos->mDirection == eDirNext && lastFrame == this)
         ||(aPos->mDirection == eDirPrevious && firstFrame == this))))
#endif
  {
    if (aPos->mJumpLines != PR_TRUE)
      return NS_ERROR_FAILURE;//we are done. cannot jump lines
#ifdef IBMBIDI
    lineJump = PR_TRUE;
#endif
    if (aPos->mAmount != eSelectWord)
    {
      preferLeft = (PRBool)!preferLeft;//drift to other side
      aPos->mAmount = eSelectNoAmount;
    }
    else{
      if (aPos->mEatingWS)//done finding what we wanted
        return NS_ERROR_FAILURE;
      if (aPos->mDirection == eDirNext)
      {
        preferLeft = (PRBool)!preferLeft;//drift to other side
      }
#ifdef IBMBIDI
      if (lineIsRTL)
        aPos->mAmount = eSelectNoAmount;
#endif
    }

  }
  if (aPos->mAmount == eSelectDir)
    aPos->mAmount = eSelectNoAmount;//just get to next frame.
  nsCOMPtr<nsIBidirectionalEnumerator> frameTraversal;
#ifdef IBMBIDI
  result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal),
                                lineIsReordered ? VISUAL : LEAF,
                                aPresContext, 
                                traversedFrame, aPos->mScrollViewStop);
#else
  //if we are a container frame we MUST init with last leaf for eDirNext
  //
  result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF, aPresContext, traversedFrame, aPos->mScrollViewStop);
#endif
  if (NS_FAILED(result))
    return result;
  nsISupports *isupports = nsnull;
#ifdef IBMBIDI
  nsIFrame *newFrame;

  for (;;) {
    if (lineIsRTL) 
      if (aPos->mDirection == eDirPrevious)
        result = frameTraversal->Next();
      else 
        result = frameTraversal->Prev();
    else
#endif
      if (aPos->mDirection == eDirNext)
        result = frameTraversal->Next();
      else 
        result = frameTraversal->Prev();
    
  if (NS_FAILED(result))
    return result;
  result = frameTraversal->CurrentItem(&isupports);
  if (NS_FAILED(result))
    return result;
  if (!isupports)
    return NS_ERROR_NULL_POINTER;
  //we must CAST here to an nsIFrame. nsIFrame doesnt really follow the rules
  //for speed reasons
#ifndef IBMBIDI
  nsIFrame *newFrame = (nsIFrame *)isupports;
#else
  
  newFrame = (nsIFrame *)isupports;
  nsIContent *content = newFrame->GetContent();
  if (!lineJump && (content == mContent))
  {
    //we will continue if this is NOT a text node. 
    //in the case of a text node since that does not mean we are stuck. it could mean a change in style for
    //the text node.  in the case of a hruleframe with generated before and after content, we do not
    //want the splittable generated frame to get us stuck on an HR
    if (nsLayoutAtoms::textFrame != newFrame->GetType())
      continue;  //we should NOT be getting stuck on the same piece of content on the same line. skip to next line.
  }
  PRBool isBidiGhostFrame = (newFrame->GetRect().IsEmpty() &&
                             (newFrame->GetStateBits() & NS_FRAME_IS_BIDI));
  if (isBidiGhostFrame)
  {
    // If the rectangle is empty and the NS_FRAME_IS_BIDI flag is set, this is most likely 
    // a non-renderable frame created at the end of the line by Bidi reordering.
    lineJump = PR_TRUE;
    aPos->mAmount = eSelectNoAmount;
  }
  else
  {
    PRBool selectable =  PR_TRUE; //usually fine
    newFrame->IsSelectable(&selectable, nsnull);
    if (selectable)
      break; // for (;;)
  }
  PRBool newLineIsRTL = PR_FALSE;
  if (lineJump) {
    blockFrame = newFrame;
    nsresult result = NS_ERROR_FAILURE;
    while (NS_FAILED(result) && blockFrame)
    {
      thisBlock = blockFrame;
      blockFrame = blockFrame->GetParent();
      result = NS_OK;
      if (blockFrame) {
        result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator), getter_AddRefs(it));
      }
    }
    if (!blockFrame || !it)
      return NS_ERROR_FAILURE;
    result = it->FindLineContaining(thisBlock, &thisLine);
    if (NS_FAILED(result))
      return result;
    it->GetDirection(&newLineIsRTL);

    result = it->CheckLineOrder(thisLine, &lineIsReordered, &firstVisual, &lastVisual);
    if (NS_FAILED(result))
      return result;

    if (lineIsReordered)
    {
      firstFrame = firstVisual;
      lastFrame = lastVisual;
    }
    else
    {
      result = it->GetLine(thisLine, &firstFrame, &lineFrameCount, nonUsedRect,
                           &lineFlags);
      if (NS_FAILED(result))
        return result;
      if (!firstFrame)
        return NS_ERROR_FAILURE;

      lastFrame = firstFrame;
      for (;lineFrameCount > 1;lineFrameCount --){
        result = it->GetNextSiblingOnLine(lastFrame, thisLine);
        if (NS_FAILED(result) || !lastFrame){
          NS_ASSERTION(0,"should not be reached nsFrame\n");
          return NS_ERROR_FAILURE;
        }
      }
    }

    GetFirstLeaf(aPresContext, &firstFrame);
    GetLastLeaf(aPresContext, &lastFrame);

    if (newLineIsRTL) {
      if (aPos->mDirection == eDirPrevious)
        newFrame = firstFrame;
      else
        newFrame = lastFrame;
    }
    else {
      if (aPos->mDirection == eDirNext)
        newFrame = firstFrame;
      else
        newFrame = lastFrame;
      }
    }
    PRBool selectable =  PR_TRUE; //usually fine
    newFrame->IsSelectable(&selectable, nsnull);
    if (!selectable)
      lineJump = PR_FALSE;
  } // for (;;) we will break from inside
#endif // IBMBIDI
  if (aPos->mDirection == eDirNext)
    aPos->mStartOffset = 0;
  else
    aPos->mStartOffset = -1;
#ifdef IBMBIDI
  PRUint8 oldLevel = NS_GET_EMBEDDING_LEVEL(this);
  PRUint8 newLevel = NS_GET_EMBEDDING_LEVEL(newFrame);
  if (newLevel & 1) // The new frame is RTL, go to the other end
    aPos->mStartOffset = -1 - aPos->mStartOffset;

  if ((aPos->mAmount == eSelectNoAmount) && ((newLevel & 1) != (oldLevel & 1)))  {
    preferLeft = (PRBool)!preferLeft;
  }
#endif
  aPos->mResultFrame = newFrame;
  aPos->mPreferLeft = preferLeft;
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsBox::GetHAlign ( Halignment aAlign) [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsBoxFrame.

Definition at line 434 of file nsBox.cpp.

{
  aAlign = hAlign_Left;
   return NS_OK;
}
NS_IMETHODIMP nsBox::GetIndexOf ( nsIBox *  aChild,
PRInt32 aIndex 
) [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsBoxFrame.

Definition at line 1370 of file nsBox.cpp.

{
  // return -1. We have no children
  *aIndex = -1;
  return NS_OK;
}
nsresult nsIFrame::GetInset ( nsMargin aInset) [inline, inherited]

Definition at line 1443 of file nsIFrame.h.

{ aInset.SizeTo(0, 0, 0, 0); return NS_OK; }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual nsIFrame* nsIFrame::GetLastInFlow ( ) const [inline, virtual, inherited]

Return the last frame in our current flow.

Reimplemented in nsTextFrame, and nsSplittableFrame.

Definition at line 879 of file nsIFrame.h.

                                          {
    return NS_CONST_CAST(nsIFrame*, this);
  }

Here is the caller graph for this function:

void nsFrame::GetLastLeaf ( nsPresContext aPresContext,
nsIFrame **  aFrame 
) [static, inherited]

Definition at line 4669 of file nsFrame.cpp.

{
  if (!aFrame || !*aFrame)
    return;
  nsIFrame *child = *aFrame;
  //if we are a block frame then go for the last line of 'this'
  while (1){
    child = child->GetFirstChild(nsnull);
    if (!child)
      return;//nothing to do
    nsIFrame* siblingFrame;
    nsIContent* content;
    //ignore anonymous elements, e.g. mozTableAdd* mozTableRemove*
    //see bug 278197 comment #12 #13 for details
    while ((siblingFrame = child->GetNextSibling()) &&
           (content = siblingFrame->GetContent()) &&
           !content->IsNativeAnonymous())
      child = siblingFrame;
    *aFrame = child;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsBox::GetLayoutFlags ( PRUint32 aFlags) [protected, virtual, inherited]

Reimplemented in nsMenuPopupFrame.

Definition at line 528 of file nsBox.cpp.

{
  aFlags = 0;
}

Here is the caller graph for this function:

NS_IMETHODIMP nsBox::GetLayoutManager ( nsIBoxLayout **  aLayout) [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsBoxFrame.

Definition at line 679 of file nsBox.cpp.

{
  *aLayout = nsnull;
  return NS_OK;
}

Here is the caller graph for this function:

PRInt32 nsFrame::GetLineNumber ( nsIFrame aFrame) [static, protected, inherited]

Definition at line 4042 of file nsFrame.cpp.

{
  nsIFrame *blockFrame = aFrame;
  nsIFrame *thisBlock;
  PRInt32   thisLine;
  nsCOMPtr<nsILineIteratorNavigator> it; 
  nsresult result = NS_ERROR_FAILURE;
  while (NS_FAILED(result) && blockFrame)
  {
    thisBlock = blockFrame;
    blockFrame = blockFrame->GetParent();
    result = NS_OK;
    if (blockFrame) {
      result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
    }
  }
  if (!blockFrame || !it)
    return NS_ERROR_FAILURE;
  result = it->FindLineContaining(thisBlock, &thisLine);
  if (NS_FAILED(result))
    return -1;
  return thisLine;
}

Here is the call graph for this function:

NS_IMETHODIMP nsBox::GetMargin ( nsMargin aMargin) [virtual, inherited]

Implements nsIFrame.

Definition at line 611 of file nsBox.cpp.

{
  aMargin.SizeTo(0,0,0,0);
  GetStyleMargin()->GetMargin(aMargin);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 629 of file nsFrameFrame.cpp.

{
  nsSize result(-1, -1);
  nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
  if (content) {
    const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::marginwidth);
    if (attr && attr->Type() == nsAttrValue::eInteger)
      result.width = attr->GetIntegerValue();
    attr = content->GetParsedAttr(nsHTMLAtoms::marginheight);
    if (attr && attr->Type() == nsAttrValue::eInteger)
      result.height = attr->GetIntegerValue();
  }
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetMaxSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aSize 
) [virtual, inherited]

Reimplemented from nsBox.

Reimplemented in nsXULScrollFrame, nsSliderFrame, nsBoxFrame, nsTextControlFrame, and nsLeafBoxFrame.

Definition at line 5149 of file nsFrame.cpp.

{
  // Don't use the cache if we have HTMLReflowState constraints --- they might have changed
  nsBoxLayoutMetrics *metrics = BoxMetrics();
  if (!DoesNeedRecalc(metrics->mMaxSize)) {
     aSize = metrics->mMaxSize;
     return NS_OK;
  }

  aSize.width = NS_INTRINSICSIZE;
  aSize.height = NS_INTRINSICSIZE;

  PRBool isCollapsed = PR_FALSE;
  IsCollapsed(aState, isCollapsed);
  if (isCollapsed) {
    return NS_OK;
  } else {
    metrics->mMaxSize.width = NS_INTRINSICSIZE;
    metrics->mMaxSize.height = NS_INTRINSICSIZE;
    nsBox::GetMaxSize(aState, metrics->mMaxSize);
  }

  aSize = metrics->mMaxSize;

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsFrame::GetMinSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aSize 
) [virtual, inherited]

Reimplemented from nsBox.

Reimplemented in nsXULScrollFrame, nsSliderFrame, nsMenuFrame, nsBoxFrame, nsTextControlFrame, nsTreeBodyFrame, nsImageBoxFrame, nsLeafBoxFrame, and nsTextBoxFrame.

Definition at line 5114 of file nsFrame.cpp.

{
  // Don't use the cache if we have HTMLReflowState constraints --- they might have changed
  nsBoxLayoutMetrics *metrics = BoxMetrics();
  if (!DoesNeedRecalc(metrics->mMinSize)) {
     aSize = metrics->mMinSize;
     return NS_OK;
  }

  aSize.width = 0;
  aSize.height = 0;

  PRBool isCollapsed = PR_FALSE;
  IsCollapsed(aState, isCollapsed);
  if (isCollapsed) {
    return NS_OK;
  } else {
    // get our size in CSS.
    PRBool completelyRedefined = nsIBox::AddCSSMinSize(aState, this, metrics->mMinSize);

    // Refresh our caches with new sizes.
    if (!completelyRedefined) {
       RefreshSizeCache(aState);
       metrics->mMinSize = metrics->mBlockMinSize;
       AddInset(metrics->mMinSize);
       nsIBox::AddCSSMinSize(aState, this, metrics->mMinSize);
    }
  }

  aSize = metrics->mMinSize;

  return NS_OK;
}

Here is the call graph for this function:

nsSize nsBox::GetMinSizeForScrollArea ( nsBoxLayoutState aBoxLayoutState) [virtual, inherited]

This returns the minimum size for the scroll area if this frame is being scrolled.

Usually it's (0,0).

Implements nsIFrame.

Reimplemented in nsListBoxBodyFrame.

Definition at line 728 of file nsBox.cpp.

{
  return nsSize(0, 0);
}

Here is the call graph for this function:

virtual nsIView* nsIFrame::GetMouseCapturer ( ) const [inline, virtual, inherited]

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.

The view need not be this frame's view, it could be the view on a child.

Reimplemented in nsXULScrollFrame, nsHTMLScrollFrame, nsSliderFrame, and nsSplitterFrame.

Definition at line 1125 of file nsIFrame.h.

{ return nsnull; }

Here is the caller graph for this function:

NS_IMETHODIMP nsBox::GetMouseThrough ( PRBool aMouseThrough) [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsBoxFrame, nsLeafBoxFrame, nsTitleBarFrame, and nsButtonBoxFrame.

Definition at line 1353 of file nsBox.cpp.

{
  if (mParent && mParent->IsBoxFrame())
    return mParent->GetMouseThrough(aMouseThrough);

  aMouseThrough = PR_FALSE;
  return NS_OK;
}

Here is the call graph for this function:

nsresult nsIFrame::GetNextBox ( nsIBox **  aBox) [inline, inherited]

Definition at line 1429 of file nsIFrame.h.

  {
    *aBox = (mParent && mParent->IsBoxFrame()) ? mNextSibling : nsnull;
    return NS_OK;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

nsIFrame * nsFrame::GetNextInFlow ( ) const [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsTextFrame, and nsSplittableFrame.

Definition at line 2305 of file nsFrame.cpp.

{
  return nsnull;
}

Here is the caller graph for this function:

nsresult nsFrame::GetNextPrevLineFromeBlockFrame ( nsPresContext aPresContext,
nsPeekOffsetStruct aPos,
nsIFrame aBlockFrame,
PRInt32  aLineStart,
PRInt8  aOutSideLimit 
) [static, inherited]

Definition at line 3226 of file nsFrame.cpp.

{
  //magic numbers aLineStart will be -1 for end of block 0 will be start of block
  if (!aBlockFrame || !aPos)
    return NS_ERROR_NULL_POINTER;

  aPos->mResultFrame = nsnull;
  aPos->mResultContent = nsnull;
  aPos->mPreferLeft = (aPos->mDirection == eDirNext);

   nsresult result;
  nsCOMPtr<nsILineIteratorNavigator> it; 
  result = aBlockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
  if (NS_FAILED(result) || !it)
    return result;
  PRInt32 searchingLine = aLineStart;
  PRInt32 countLines;
  result = it->GetNumLines(&countLines);
  if (aOutSideLimit > 0) //start at end
    searchingLine = countLines;
  else if (aOutSideLimit <0)//start at begining
    searchingLine = -1;//"next" will be 0  
  else 
    if ((aPos->mDirection == eDirPrevious && searchingLine == 0) || 
       (aPos->mDirection == eDirNext && searchingLine >= (countLines -1) )){
      //we need to jump to new block frame.
           return NS_ERROR_FAILURE;
    }
  PRInt32 lineFrameCount;
  nsIFrame *resultFrame = nsnull;
  nsIFrame *farStoppingFrame = nsnull; //we keep searching until we find a "this" frame then we go to next line
  nsIFrame *nearStoppingFrame = nsnull; //if we are backing up from edge, stop here
  nsIFrame *firstFrame;
  nsIFrame *lastFrame;
  nsRect  rect;
  PRBool isBeforeFirstFrame, isAfterLastFrame;
  PRBool found = PR_FALSE;
  while (!found)
  {
    if (aPos->mDirection == eDirPrevious)
      searchingLine --;
    else
      searchingLine ++;
    if ((aPos->mDirection == eDirPrevious && searchingLine < 0) || 
       (aPos->mDirection == eDirNext && searchingLine >= countLines ))
    {
      //we need to jump to new block frame.
      return NS_ERROR_FAILURE;
    }
    PRUint32 lineFlags;
    result = it->GetLine(searchingLine, &firstFrame, &lineFrameCount,
                         rect, &lineFlags);
    if (!lineFrameCount) 
      continue;
    if (NS_SUCCEEDED(result)){
      lastFrame = firstFrame;
      for (;lineFrameCount > 1;lineFrameCount --){
        //result = lastFrame->GetNextSibling(&lastFrame, searchingLine);
        result = it->GetNextSiblingOnLine(lastFrame, searchingLine);
        if (NS_FAILED(result) || !lastFrame){
          NS_ASSERTION(0,"should not be reached nsFrame\n");
          return NS_ERROR_FAILURE;
        }
      }
      GetLastLeaf(aPresContext, &lastFrame);

      if (aPos->mDirection == eDirNext){
        nearStoppingFrame = firstFrame;
        farStoppingFrame = lastFrame;
      }
      else{
        nearStoppingFrame = lastFrame;
        farStoppingFrame = firstFrame;
      }
      nsPoint offset;
      nsIView * view; //used for call of get offset from view
      aBlockFrame->GetOffsetFromView(offset,&view);
      nscoord newDesiredX  = aPos->mDesiredX - offset.x;//get desired x into blockframe coordinates!
      result = it->FindFrameAt(searchingLine, newDesiredX, &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
      if(NS_FAILED(result))
        continue;
    }

    if (NS_SUCCEEDED(result) && resultFrame)
    {
      nsCOMPtr<nsILineIteratorNavigator> newIt; 
      //check to see if this is ANOTHER blockframe inside the other one if so then call into its lines
      result = resultFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(newIt));
      if (NS_SUCCEEDED(result) && newIt)
      {
        aPos->mResultFrame = resultFrame;
        return NS_OK;
      }
      //resultFrame is not a block frame

      nsCOMPtr<nsIBidirectionalEnumerator> frameTraversal;
      result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), EXTENSIVE,
                                    aPresContext, resultFrame, aPos->mScrollViewStop);
      if (NS_FAILED(result))
        return result;
      nsISupports *isupports = nsnull;
      nsIFrame *storeOldResultFrame = resultFrame;
      while ( !found ){
        nsPresContext *context = aPos->mShell->GetPresContext();
        nsPoint point;
        point.x = aPos->mDesiredX;

        nsRect tempRect = resultFrame->GetRect();
        nsPoint offset;
        nsIView * view; //used for call of get offset from view
        result = resultFrame->GetOffsetFromView(offset, &view);
        if (NS_FAILED(result))
          return result;
        point.y = tempRect.height + offset.y;

        //special check. if we allow non-text selection then we can allow a hit location to fall before a table. 
        //otherwise there is no way to get and click signal to fall before a table (it being a line iterator itself)
        PRInt16 isEditor = 0;
        nsIPresShell *shell = aPresContext->GetPresShell();
        if (!shell)
          return NS_ERROR_FAILURE;
        shell->GetSelectionFlags ( &isEditor );
        isEditor = isEditor == nsISelectionDisplay::DISPLAY_ALL;
        if ( isEditor ) 
        {
          if (resultFrame->GetType() == nsLayoutAtoms::tableOuterFrame)
          {
            if (((point.x - offset.x + tempRect.x)<0) ||  ((point.x - offset.x+ tempRect.x)>tempRect.width))//off left/right side
            {
              nsIContent* content = resultFrame->GetContent();
              if (content)
              {
                nsIContent* parent = content->GetParent();
                if (parent)
                {
                  aPos->mResultContent = parent;
                  aPos->mContentOffset = parent->IndexOf(content);
                  aPos->mPreferLeft = PR_FALSE;
                  if ((point.x - offset.x+ tempRect.x)>tempRect.width)
                  {
                    aPos->mContentOffset++;//go to end of this frame
                    aPos->mPreferLeft = PR_TRUE;
                  }
                  aPos->mContentOffsetEnd = aPos->mContentOffset;
                  //result frame is the result frames parent.
                  aPos->mResultFrame = resultFrame->GetParent();
                  return NS_POSITION_BEFORE_TABLE;
                }
              }
            }
          }
        }

        if (!resultFrame->HasView())
        {
          rect = resultFrame->GetRect();
          result = resultFrame->GetContentAndOffsetsFromPoint(context,point,
                                        getter_AddRefs(aPos->mResultContent),
                                        aPos->mContentOffset,
                                        aPos->mContentOffsetEnd,
                                        aPos->mPreferLeft);
          if (NS_SUCCEEDED(result))
          {
            PRBool selectable;
            resultFrame->IsSelectable(&selectable, nsnull);
            if (selectable)
            {
              found = PR_TRUE;
              break;
            }
          }
        }

        if (aPos->mDirection == eDirPrevious && (resultFrame == farStoppingFrame))
          break;
        if (aPos->mDirection == eDirNext && (resultFrame == nearStoppingFrame))
          break;
        //always try previous on THAT line if that fails go the other way
        result = frameTraversal->Prev();
        if (NS_FAILED(result))
          break;
        result = frameTraversal->CurrentItem(&isupports);
        if (NS_FAILED(result) || !isupports)
          return result;
        //we must CAST here to an nsIFrame. nsIFrame doesnt really follow the rules
        resultFrame = (nsIFrame *)isupports;
      }

      if (!found){
        resultFrame = storeOldResultFrame;
        result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF,
                                      aPresContext, resultFrame, aPos->mScrollViewStop);
      }
      while ( !found ){
        nsPresContext *context = aPos->mShell->GetPresContext();

        nsPoint point;
        point.x = aPos->mDesiredX;
        point.y = 0;

        result = resultFrame->GetContentAndOffsetsFromPoint(context,point,
                                          getter_AddRefs(aPos->mResultContent), aPos->mContentOffset,
                                          aPos->mContentOffsetEnd, aPos->mPreferLeft);
        if (NS_SUCCEEDED(result))
        {
          PRBool selectable;
          resultFrame->IsSelectable(&selectable, nsnull);
          if (selectable)
          {
            found = PR_TRUE;
            if (resultFrame == farStoppingFrame)
              aPos->mPreferLeft = PR_FALSE;
            else
              aPos->mPreferLeft = PR_TRUE;
            break;
          }
        }
        if (aPos->mDirection == eDirPrevious && (resultFrame == nearStoppingFrame))
          break;
        if (aPos->mDirection == eDirNext && (resultFrame == farStoppingFrame))
          break;
        //previous didnt work now we try "next"
        result = frameTraversal->Next();
        if (NS_FAILED(result))
          break;
        result = frameTraversal->CurrentItem(&isupports);
        if (NS_FAILED(result) || !isupports)
          break;
        //we must CAST here to an nsIFrame. nsIFrame doesnt really follow the rules
        resultFrame = (nsIFrame *)isupports;
      }
      aPos->mResultFrame = resultFrame;
    }
    else {
        //we need to jump to new block frame.
      aPos->mAmount = eSelectLine;
      aPos->mStartOffset = 0;
      aPos->mEatingWS = PR_FALSE;
      aPos->mPreferLeft = !(aPos->mDirection == eDirNext);
      if (aPos->mDirection == eDirPrevious)
        aPos->mStartOffset = -1;//start from end
     return aBlockFrame->PeekOffset(aPresContext, aPos);
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIFrame* nsIFrame::GetNextSibling ( ) const [inline, inherited]

Child frames are linked together in a singly-linked list.

Definition at line 694 of file nsIFrame.h.

{ return mNextSibling; }
NS_IMETHODIMP nsFrame::GetOffsetFromView ( nsPoint aOffset,
nsIView **  aView 
) const [virtual, inherited]

Returns the offset from this frame to the closest geometric parent that has a view.

Also returns the containing view or null in case of error

Implements nsIFrame.

Definition at line 2446 of file nsFrame.cpp.

{
  NS_PRECONDITION(nsnull != aView, "null OUT parameter pointer");
  nsIFrame* frame = (nsIFrame*)this;

  *aView = nsnull;
  aOffset.MoveTo(0, 0);
  do {
    aOffset += frame->GetPosition();
    frame = frame->GetParent();
  } while (frame && !frame->HasView());
  if (frame)
    *aView = frame->GetView();
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetOffsets ( PRInt32 start,
PRInt32 end 
) const [virtual, inherited]

Get the offsets of the frame.

most will be 0,0

Implements nsIFrame.

Reimplemented in nsTextFrame.

Definition at line 673 of file nsFrame.cpp.

{
  aStart = 0;
  aEnd = 0;
  return NS_OK;
}

Here is the caller graph for this function:

nsPoint nsIFrame::GetOffsetTo ( const nsIFrame aOther) const [inherited]

Get the offset between the coordinate systems of |this| and aOther.

Adding the return value to a point in the coordinate system of |this| will transform the point to the coordinate system of aOther.

aOther must be non-null.

This function is fastest when aOther is an ancestor of |this|.

NOTE: this actually returns the offset from aOther to |this|, but that offset is added to transform coordinates from |this| to aOther.

Definition at line 2390 of file nsFrame.cpp.

{
  NS_PRECONDITION(aOther,
                  "Must have frame for destination coordinate system!");
  // Note that if we hit a view while walking up the frame tree we need to stop
  // and switch to traversing the view tree so that we will deal with scroll
  // views properly.
  nsPoint offset(0, 0);
  const nsIFrame* f;
  for (f = this; !f->HasView() && f != aOther; f = f->GetParent()) {
    offset += f->GetPosition();
  }
  
  if (f != aOther) {
    // We found a view.  Switch to the view tree
    nsPoint toViewOffset(0, 0);
    nsIView* otherView = aOther->GetClosestView(&toViewOffset);
    offset += f->GetView()->GetOffsetTo(otherView) - toViewOffset;
  }
  
  return offset;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsPoint nsIFrame::GetOffsetToExternal ( const nsIFrame aOther) const [virtual, inherited]

Definition at line 2385 of file nsFrame.cpp.

{
  return GetOffsetTo(aOther);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsIFrame::GetOrdinal ( nsBoxLayoutState aBoxLayoutState,
PRUint32 aOrdinal 
) [inherited]

Definition at line 762 of file nsBox.cpp.

{
  aOrdinal = DEFAULT_ORDINAL_GROUP;
  nsIBox::AddCSSOrdinal(aState, this, aOrdinal);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsIFrame::GetOrientation ( PRBool aIsHorizontal) [inline, inherited]

XXX to be removed.

Definition at line 1454 of file nsIFrame.h.

  { aIsHorizontal = IsHorizontal(); return NS_OK; }

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetOriginToViewOffset ( nsPoint aOffset,
nsIView **  aView 
) const [virtual, inherited]

Returns the offset from this frame's upper left corner to the upper left corner of the view returned by a call to GetView().

aOffset will contain the offset to the view or (0,0) if the frame has no view. aView will contain a pointer to the view returned by GetView(). aView is optional, that is, you may pass null if you are not interested in getting a pointer to the view.

Implements nsIFrame.

Definition at line 2484 of file nsFrame.cpp.

{
  nsresult rv = NS_OK;

  aOffset.MoveTo(0,0);

  if (aView)
    *aView = nsnull;

  if (HasView()) {
    nsIView *view = GetView();
    nsIView *parentView = nsnull;
    nsPoint offsetToParentView;
    rv = GetOffsetFromView(offsetToParentView, &parentView);

    if (NS_SUCCEEDED(rv)) {
      nsPoint viewOffsetFromParent(0,0);
      nsIView *pview = view;

      nsIViewManager* vVM = view->GetViewManager();

      while (pview && pview != parentView) {
        viewOffsetFromParent += pview->GetPosition();

        nsIView *tmpView = pview->GetParent();
        if (tmpView && vVM != tmpView->GetViewManager()) {
          // Don't cross ViewManager boundaries!
          // XXXbz why not?
          break;
        }
        pview = tmpView;
      }

#ifdef DEBUG_KIN
      if (pview != parentView) {
        // XXX: At this point, pview is probably null since it traversed
        //      all the way up view's parent hierarchy and did not run across
        //      parentView. In the future, instead of just returning an offset
        //      of (0,0) for this case, we may want offsetToParentView to
        //      include the offset from the parentView to the top of the
        //      view hierarchy which would make both offsetToParentView and
        //      viewOffsetFromParent, offsets to the global coordinate space.
        //      We'd have to investigate any perf impact this would have before
        //      checking in such a change, so for now we just return (0,0).
        //      -- kin    
        NS_WARNING("view is not a descendant of parentView!");
      }
#endif // DEBUG

      if (pview == parentView)
        aOffset = offsetToParentView - viewOffsetFromParent;

      if (aView)
        *aView = view;
    }
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetOverflow ( nsSize aOverflow) [virtual, inherited]

Implements nsIFrame.

Definition at line 4913 of file nsFrame.cpp.

{
  aOverflow = BoxMetrics()->mOverflow;
  return NS_OK;
}

Here is the call graph for this function:

nsRect * nsIFrame::GetOverflowAreaProperty ( PRBool  aCreateIfNecessary = PR_FALSE) [inherited]

Create or retrieve the previously stored overflow area, if the frame does not overflow and no creation is required return nsnull.

Parameters:
aPresContextPresContext
aCreateIfNecessarycreate a new nsRect for the overflow area
Returns:
pointer to the overflow area rectangle

Definition at line 4383 of file nsFrame.cpp.

{
  if (!((GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) || aCreateIfNecessary)) {
    return nsnull;
  }

  nsPropertyTable *propTable = GetPresContext()->PropertyTable();
  void *value = propTable->GetProperty(this,
                                       nsLayoutAtoms::overflowAreaProperty);

  if (value) {
    return (nsRect*)value;  // the property already exists
  } else if (aCreateIfNecessary) {
    // The property isn't set yet, so allocate a new rect, set the property,
    // and return the newly allocated rect
    nsRect*  overflow = new nsRect(0, 0, 0, 0);
    propTable->SetProperty(this, nsLayoutAtoms::overflowAreaProperty,
                           overflow, DestroyRectFunc, nsnull);
    return overflow;
  }

  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsRect nsIFrame::GetOverflowRect ( ) const [inherited]

Computes a rect that includes this frame, all its descendant frames, this frame's outline (if any), and all descendant frames' outlines (if any).

This is the union of everything that might be painted by this frame subtree.

Returns:
the rect relative to this frame's origin

Definition at line 2635 of file nsFrame.cpp.

{
  // Note that in some cases the overflow area might not have been
  // updated (yet) to reflect any outline set on the frame or the area
  // of child frames. That's OK because any reflow that updates these
  // areas will invalidate the appropriate area, so any (mis)uses of
  // this method will be fixed up.
  nsRect* storedOA = NS_CONST_CAST(nsIFrame*, this)
    ->GetOverflowAreaProperty(PR_FALSE);
  if (storedOA) {
    return *storedOA;
  } else {
    return nsRect(nsPoint(0, 0), GetSize());
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsBox::GetPadding ( nsMargin aBorderAndPadding) [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsXULScrollFrame.

Definition at line 580 of file nsBox.cpp.

{
  const nsStyleDisplay *disp = GetStyleDisplay();
  if (disp->mAppearance && gTheme) {
    // Go to the theme for the padding.
    nsPresContext *context = GetPresContext();
    if (gTheme->ThemeSupportsWidget(context, this, disp->mAppearance)) {
      nsMargin margin(0, 0, 0, 0);
      PRBool useThemePadding;

      useThemePadding = gTheme->GetWidgetPadding(context->DeviceContext(),
                                                 this, disp->mAppearance,
                                                 &margin);
      if (useThemePadding) {
        float p2t = context->ScaledPixelsToTwips();
        aMargin.top = NSIntPixelsToTwips(margin.top, p2t);
        aMargin.right = NSIntPixelsToTwips(margin.right, p2t);
        aMargin.bottom = NSIntPixelsToTwips(margin.bottom, p2t);
        aMargin.left = NSIntPixelsToTwips(margin.left, p2t);
        return NS_OK;
      }
    }
  }

  aMargin.SizeTo(0,0,0,0);
  GetStylePadding()->GetPadding(aMargin);

  return NS_OK;
}

Here is the call graph for this function:

nsIFrame* nsIFrame::GetParent ( ) const [inline, inherited]

Accessor functions for geometric parent.

Definition at line 653 of file nsIFrame.h.

{ return mParent; }
NS_IMETHODIMP nsFrame::GetParentStyleContextFrame ( nsPresContext aPresContext,
nsIFrame **  aProviderFrame,
PRBool aIsChild 
) [virtual, inherited]

Called to retrieve this frame's accessible.

If this frame implements Accessibility return a valid accessible If not return NS_ERROR_NOT_IMPLEMENTED. Note: nsAccessible must be refcountable. Do not implement directly on your frame Use a mediatior of some kind. Get the frame whose style context should be the parent of this frame's style context (i.e., provide the parent style context). This frame must either be an ancestor of this frame or a child. If this frame returns a child frame, then the child frame must be sure to return a grandparent or higher!

Parameters:
aPresContext,:PresContext
aProviderFrame,:The frame whose style context should be the parent of this frame's style context. Null is permitted, and means that this frame's style context should be the root of the style context tree.
aIsChild,:True if |aProviderFrame| is set to a child of this frame; false if it is an ancestor or null.

Implements nsIFrame.

Reimplemented in nsTableFrame, and nsTableOuterFrame.

Definition at line 4472 of file nsFrame.cpp.

{
  return DoGetParentStyleContextFrame(aPresContext, aProviderFrame, aIsChild);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIView * nsIFrame::GetParentViewForChildFrame ( nsIFrame aFrame) const [virtual, inherited]

This view will be used to parent the views of any children.

This allows us to insert an anonymous inner view to parent some children.

Reimplemented in nsXULScrollFrame, and nsHTMLScrollFrame.

Definition at line 2317 of file nsFrame.cpp.

{
  return GetClosestView();
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetPointFromOffset ( nsPresContext inPresContext,
nsIRenderingContext inRendContext,
PRInt32  inOffset,
nsPoint outPoint 
) [virtual, inherited]

Get a point (in the frame's coordinate space) given an offset into the content.

This point should be on the baseline of text with the correct horizontal offset

Implements nsIFrame.

Reimplemented in nsTextFrame.

Definition at line 3179 of file nsFrame.cpp.

{
  NS_PRECONDITION(outPoint != nsnull, "Null parameter");
  nsPoint bottomLeft(0, 0);
  if (mContent)
  {
    nsIContent* newContent = mContent->GetParent();
    if (newContent){
      PRInt32 newOffset = newContent->IndexOf(mContent);

      if (inOffset > newOffset)
        bottomLeft.x = GetRect().width;
    }
  }
  *outPoint = bottomLeft;
  return NS_OK;
}

Here is the call graph for this function:

nsPoint nsIFrame::GetPosition ( ) const [inline, inherited]

Definition at line 665 of file nsIFrame.h.

{ return nsPoint(mRect.x, mRect.y); }
NS_IMETHODIMP nsFrame::GetPrefSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aSize 
) [virtual, inherited]

Reimplemented from nsBox.

Reimplemented in nsXULScrollFrame, nsSliderFrame, nsMenuFrame, nsBoxFrame, nsTextControlFrame, nsListBoxBodyFrame, nsNativeScrollbarFrame, nsImageBoxFrame, nsListItemFrame, nsLeafBoxFrame, and nsTextBoxFrame.

Definition at line 5074 of file nsFrame.cpp.

{
  // If the size is cached, and there are no HTML constraints that we might
  // be depending on, then we just return the cached size.
  nsBoxLayoutMetrics *metrics = BoxMetrics();
  if (!DoesNeedRecalc(metrics->mPrefSize)) {
     aSize = metrics->mPrefSize;
     return NS_OK;
  }

  aSize.width = 0;
  aSize.height = 0;

  PRBool isCollapsed = PR_FALSE;
  IsCollapsed(aState, isCollapsed);
  if (isCollapsed) {
    return NS_OK;
  } else {
    // get our size in CSS.
    PRBool completelyRedefined = nsIBox::AddCSSPrefSize(aState, this, metrics->mPrefSize);

    // Refresh our caches with new sizes.
    if (!completelyRedefined) {
       RefreshSizeCache(aState);
       metrics->mPrefSize = metrics->mBlockPrefSize;

       // notice we don't need to add our borders or padding
       // in. Thats because the block did it for us.
       // but we do need to add insets so debugging will work.
       AddInset(metrics->mPrefSize);
       nsIBox::AddCSSPrefSize(aState, this, metrics->mPrefSize);
    }
  }

  aSize = metrics->mPrefSize;

  return NS_OK;
}

Here is the call graph for this function:

nsPresContext* nsIFrame::GetPresContext ( ) const [inline, inherited]

Definition at line 407 of file nsIFrame.h.

Here is the call graph for this function:

nsIFrame * nsFrame::GetPrevInFlow ( ) const [virtual, inherited]

Flow member functions.

Implements nsIFrame.

Reimplemented in nsContinuingTextFrame, and nsSplittableFrame.

Definition at line 2289 of file nsFrame.cpp.

{
  return nsnull;
}

Here is the caller graph for this function:

nsRect nsIFrame::GetRect ( ) const [inline, inherited]

Bounding rect of the frame.

The values are in twips, and the origin is relative to the upper-left of the geometric parent. The size includes the content area, borders, and padding.

Note: moving or sizing the frame does not affect the view's size or position.

Definition at line 664 of file nsIFrame.h.

{ return mRect; }
nsIntRect nsIFrame::GetScreenRect ( ) const [inherited]

Get the screen rect of the frame.

Returns:
the pixel rect of the frame in screen coordinates.

Definition at line 2419 of file nsFrame.cpp.

{
  nsIntRect retval(0,0,0,0);
  nsPoint toViewOffset(0,0);
  nsIView* view = GetClosestView(&toViewOffset);

  if (view) {
    nsPoint toWidgetOffset(0,0);
    nsIWidget* widget = view->GetNearestWidget(&toWidgetOffset);

    if (widget) {
      nsRect ourRect = mRect;
      ourRect.MoveTo(toViewOffset + toWidgetOffset);
      ourRect.ScaleRoundOut(GetPresContext()->TwipsToPixels());
      // Is it safe to pass the same rect for both args of WidgetToScreen?
      // It's not clear, so let's not...
      nsIntRect ourPxRect(ourRect.x, ourRect.y, ourRect.width, ourRect.height);
      
      widget->WidgetToScreen(ourPxRect, retval);
    }
  }

  return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIntRect nsIFrame::GetScreenRectExternal ( ) const [virtual, inherited]

Definition at line 2414 of file nsFrame.cpp.

{
  return GetScreenRect();
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetSelected ( PRBool aSelected) const [virtual, inherited]

Implements nsIFrame.

Reimplemented in nsSVGGlyphFrame.

Definition at line 3170 of file nsFrame.cpp.

{
  if (!aSelected )
    return NS_ERROR_NULL_POINTER;
  *aSelected = (PRBool)(mState & NS_FRAME_SELECTED_CONTENT);
  return NS_OK;
}

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::GetSelectionController ( nsPresContext aPresContext,
nsISelectionController **  aSelCon 
) [virtual, inherited]

Called to retrieve the SelectionController associated with the frame.

Parameters:
aSelConwill contain the selection controller associated with the frame.

Implements nsIFrame.

Definition at line 2993 of file nsFrame.cpp.

{
  if (!aPresContext || !aSelCon)
    return NS_ERROR_INVALID_ARG;

  nsIFrame *frame = this;
  while (frame && (frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION)) {
    nsITextControlFrame *tcf;
    if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsITextControlFrame),(void**)&tcf))) {
      return tcf->GetSelectionContr(aSelCon);
    }
    frame = frame->GetParent();
  }

  nsIPresShell *shell = aPresContext->GetPresShell();
  if (shell) {
    nsCOMPtr<nsISelectionController> selCon = do_QueryInterface(shell);
    NS_IF_ADDREF(*aSelCon = selCon);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsFrame::GetSelectionForVisCheck ( nsPresContext aPresContext,
nsISelection **  aSelection 
) [protected, inherited]

Definition at line 2919 of file nsFrame.cpp.

{
  *aSelection = nsnull;
  nsresult rv = NS_OK;

  // start by checking to see if we are paginated which probably means
  // we are in print preview or printing
  if (aPresContext->IsPaginated()) {
    // now see if we are rendering selection only
    if (aPresContext->IsRenderingOnlySelection()) {
      // Check the quick way first (typically only leaf nodes)
      PRBool isSelected = (mState & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT;
      // if we aren't selected in the mState,
      // we could be a container so check to see if we are in the selection range
      // this is a expensive
      if (!isSelected) {
        nsIPresShell *shell = aPresContext->GetPresShell();
        if (shell) {
          nsCOMPtr<nsISelectionController> selcon(do_QueryInterface(shell));
          if (selcon) {
            rv = selcon->GetSelection(nsISelectionController::SELECTION_NORMAL, aSelection);
          }
        }
      }
    }
  } 

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsSize nsIFrame::GetSize ( ) const [inline, inherited]

Definition at line 666 of file nsIFrame.h.

{ return nsSize(mRect.width, mRect.height); }

Here is the call graph for this function:

PRIntn nsSubDocumentFrame::GetSkipSides ( ) const [protected, virtual]

Definition at line 287 of file nsFrameFrame.cpp.

{
  return 0;
}
nsFrameState nsIFrame::GetStateBits ( ) const [inline, inherited]

Get the current frame-state value for this frame.

aResult is filled in with the state bits.

Definition at line 818 of file nsIFrame.h.

{ return mState; }
nsStyleContext* nsIFrame::GetStyleContext ( ) const [inline, inherited]

Get the style context associated with this frame.

Definition at line 579 of file nsIFrame.h.

{ return mStyleContext; }
const nsStyleStruct* nsIFrame::GetStyleData ( nsStyleStructID  aSID) const [inline, inherited]

Definition at line 606 of file nsIFrame.h.

                                                                {
#ifdef _IMPL_NS_LAYOUT
    NS_ASSERTION(mStyleContext, "No style context found!");
    return mStyleContext->GetStyleData(aSID);
#else
    return GetStyleDataExternal(aSID);
#endif
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const nsStyleStruct * nsFrame::GetStyleDataExternal ( nsStyleStructID  aSID) const [virtual, inherited]

Get the style data associated with this frame.

This returns a const style struct pointer that should never be modified. See |nsIStyleContext::GetStyleData| for more information.

The use of the typesafe functions below is preferred to direct use of this function.

Implements nsIFrame.

Definition at line 4787 of file nsFrame.cpp.

{
  NS_ASSERTION(mStyleContext, "unexpected null pointer");
  return mStyleContext->GetStyleData(aSID);
}
nsIAtom * nsSubDocumentFrame::GetType ( ) const [virtual]

Get the "type" of the frame.

May return a NULL atom pointer

See also:
nsLayoutAtoms

Reimplemented from nsFrame.

Definition at line 332 of file nsFrameFrame.cpp.

{
  return nsLayoutAtoms::subDocumentFrame;
}
NS_IMETHODIMP nsBox::GetVAlign ( Valignment aAlign) [virtual, inherited]

Implements nsIFrame.

Definition at line 427 of file nsBox.cpp.

{
  aAlign = vAlign_Top;
   return NS_OK;
}
nsIView * nsIFrame::GetView ( ) const [inherited]

Definition at line 2324 of file nsFrame.cpp.

{
  // Check the frame state bit and see if the frame has a view
  if (!(GetStateBits() & NS_FRAME_HAS_VIEW))
    return nsnull;

  // Check for a property on the frame
  nsresult rv;
  void *value = GetProperty(nsLayoutAtoms::viewProperty, &rv);

  NS_ENSURE_SUCCESS(rv, nsnull);
  NS_ASSERTION(value, "frame state bit was set but frame has no view");
  return NS_STATIC_CAST(nsIView*, value);
}

Here is the call graph for this function:

nsIView * nsIFrame::GetViewExternal ( ) const [virtual, inherited]

Definition at line 2340 of file nsFrame.cpp.

{
  return GetView();
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsFrame::GetWasCollapsed ( nsBoxLayoutState aState) [protected, virtual, inherited]

Reimplemented from nsBox.

Reimplemented in nsBoxFrame, and nsLeafBoxFrame.

Definition at line 5724 of file nsFrame.cpp.

{
  return BoxMetrics()->mWasCollapsed;
}

Here is the call graph for this function:

nsIWidget * nsIFrame::GetWindow ( ) const [virtual, inherited]

Returns the window that contains this frame.

If this frame has a view and the view has a window, then this frames window is returned, otherwise this frame's geometric parent is checked recursively upwards. XXX virtual because gfx callers use it! (themes)

Definition at line 2557 of file nsFrame.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::HandleDrag ( nsPresContext aPresContext,
nsGUIEvent aEvent,
nsEventStatus aEventStatus 
) [inherited]

Reimplemented in nsSliderFrame, nsSplitterFrame, nsScrollbarFrame, and nsScrollbarButtonFrame.

Definition at line 1724 of file nsFrame.cpp.

{
  PRBool  selectable;
  PRUint8 selectStyle;
  IsSelectable(&selectable, &selectStyle);
  if (!selectable)
    return NS_OK;
  if (DisplaySelection(aPresContext) == nsISelectionController::SELECTION_OFF) {
    return NS_OK;
  }
  nsIPresShell *presShell = aPresContext->PresShell();

  nsCOMPtr<nsIFrameSelection> frameselection;
  nsCOMPtr<nsISelectionController> selCon;
  
  nsresult result = GetSelectionController(aPresContext,
                                           getter_AddRefs(selCon));
  if (NS_SUCCEEDED(result) && selCon)
  {
    frameselection = do_QueryInterface(selCon); //this MAY implement
  }
  if (!frameselection)
    frameselection = presShell->FrameSelection();

  PRBool mouseDown = PR_FALSE;
  if (NS_SUCCEEDED(frameselection->GetMouseDownState(&mouseDown)) && !mouseDown)
    return NS_OK;            

  frameselection->StopAutoScrollTimer();
  // If we have capturing view, it must be ensured that |this| doesn't 
  // get deleted during HandleDrag.
  nsWeakFrame weakFrame = GetNearestCapturingView(this) ? this : nsnull;

  // Check if we are dragging in a table cell
  nsCOMPtr<nsIContent> parentContent;
  PRInt32 contentOffset;
  PRInt32 target;
  nsMouseEvent *me = (nsMouseEvent *)aEvent;
  result = GetDataForTableSelection(frameselection, presShell, me,
                                    getter_AddRefs(parentContent),
                                    &contentOffset, &target);      

  if (NS_SUCCEEDED(result) && parentContent)
    frameselection->HandleTableSelection(parentContent, contentOffset, target, me);
  else
    frameselection->HandleDrag(aPresContext, this, aEvent->point);

  if (weakFrame) {
    nsIView* captureView = GetNearestCapturingView(this);
    if (captureView) {
      // Get the view that aEvent->point is relative to. This is disgusting.
      nsPoint dummyPoint;
      nsIView* eventView;
      GetOffsetFromView(dummyPoint, &eventView);
      nsPoint pt = aEvent->point + eventView->GetOffsetTo(captureView);
      frameselection->StartAutoScrollTimer(aPresContext, captureView, pt, 30);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::HandleEvent ( nsPresContext aPresContext,
nsGUIEvent aEvent,
nsEventStatus aEventStatus 
) [virtual, inherited]

Event handling of GUI events.

Parameters:
aEventevent structure describing the type of event and rge widget where the event originated The |point| member of this is in the coordinate system of the view returned by GetOffsetFromView.
aEventStatusa return value indicating whether the event was handled and whether default processing should be done

XXX From a frame's perspective it's unclear what the effect of the event status is. Does it cause the event to continue propagating through the frame hierarchy or is it just returned to the widgets?

See also:
nsGUIEvent
nsEventStatus

Implements nsIFrame.

Reimplemented in nsSliderFrame, nsMenuPopupFrame, nsMenuFrame, nsHTMLFramesetBorderFrame, nsHTMLFramesetFrame, nsTreeBodyFrame, CanvasFrame, nsFormControlFrame, nsSplitterFrame, nsTextControlFrame, nsRootBoxFrame, nsListControlFrame, nsHTMLButtonControlFrame, nsGfxRadioControlFrame, nsAutoRepeatBoxFrame, nsGfxButtonControlFrame, nsResizerFrame, nsScrollbarButtonFrame, nsTitleBarFrame, and nsButtonBoxFrame.

Definition at line 977 of file nsFrame.cpp.

{
  switch (aEvent->message)
  {
  case NS_MOUSE_MOVE:
    {
      HandleDrag(aPresContext, aEvent, aEventStatus);
    }break;
  case NS_MOUSE_LEFT_BUTTON_DOWN:
    {
      HandlePress(aPresContext, aEvent, aEventStatus);
    }break;
  case NS_MOUSE_LEFT_BUTTON_UP:
    {
      HandleRelease(aPresContext, aEvent, aEventStatus);
    } break;
  default:
    break;
  }//end switch
  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsFrame::HandleMultiplePress ( nsPresContext aPresContext,
nsGUIEvent aEvent,
nsEventStatus aEventStatus 
) [inherited]

Multiple Mouse Press -- line or paragraph selection -- for the frame.

Wouldn't it be nice if this didn't have to be hardwired into Frame code?

Reimplemented in nsTextFrame, nsSliderFrame, nsSplitterFrame, nsScrollbarFrame, and nsScrollbarButtonFrame.

Definition at line 1573 of file nsFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(aEventStatus);
  if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
    return NS_OK;
  }

  nsresult rv;
  if (DisplaySelection(aPresContext) == nsISelectionController::SELECTION_OFF) {
    return NS_OK;
  }

  // Find out whether we're doing line or paragraph selection.
  // Currently, triple-click selects line unless the user sets
  // browser.triple_click_selects_paragraph; quadruple-click
  // selects paragraph, if any platform actually implements it.
  PRBool selectPara = PR_FALSE;
  nsMouseEvent *me = (nsMouseEvent *)aEvent;
  if (!me) return NS_OK;

#if 0 // Paragraph selection is currently broken - so disable it
  if (me->clickCount == 4)
    selectPara = PR_TRUE;
  else
#endif
  if (me->clickCount == 3)
  {
    selectPara =
      nsContentUtils::GetBoolPref("browser.triple_click_selects_paragraph");
  }
  else
    return NS_OK;
#ifdef DEBUG_akkana
  if (selectPara) printf("Selecting Paragraph\n");
  else printf("Selecting Line\n");
#endif

  // Line or paragraph selection:
  PRInt32 startPos = 0;
  PRInt32 contentOffsetEnd = 0;
  nsCOMPtr<nsIContent> newContent;
  PRBool beginContent = PR_FALSE;
  rv = GetContentAndOffsetsFromPoint(aPresContext,
                                     aEvent->point,
                                     getter_AddRefs(newContent),
                                     startPos,
                                     contentOffsetEnd,
                                     beginContent);
  if (NS_FAILED(rv)) return rv;
  
  
  return PeekBackwardAndForward(selectPara ? eSelectParagraph
                                           : eSelectBeginLine,
                                selectPara ? eSelectParagraph
                                           : eSelectEndLine,
                                startPos, aPresContext, PR_TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsFrame::HandlePress ( nsPresContext aPresContext,
nsGUIEvent aEvent,
nsEventStatus aEventStatus 
) [inherited]

Handles the Mouse Press Event for the frame.

Reimplemented in nsSliderFrame, nsSplitterFrame, nsScrollbarFrame, and nsScrollbarButtonFrame.

Definition at line 1272 of file nsFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(aEventStatus);
  if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
    return NS_OK;
  }

  //We often get out of sync state issues with mousedown events that
  //get interrupted by alerts/dialogs.
  //Check with the ESM to see if we should process this one
  PRBool eventOK;
  aPresContext->EventStateManager()->EventStatusOK(aEvent, &eventOK);
  if (!eventOK) 
    return NS_OK;

  nsresult rv;
  nsIPresShell *shell = aPresContext->GetPresShell();
  if (!shell)
    return NS_ERROR_FAILURE;

  // if we are in Navigator and the click is in a draggable node, we don't want
  // to start selection because we don't want to interfere with a potential
  // drag of said node and steal all its glory.
  PRInt16 isEditor = 0;
  shell->GetSelectionFlags ( &isEditor );
  //weaaak. only the editor can display frame selction not just text and images
  isEditor = isEditor == nsISelectionDisplay::DISPLAY_ALL;

  nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
  if (!isEditor && !keyEvent->isAlt) {
    
    for (nsIContent* content = mContent; content;
         content = content->GetParent()) {
      if ( nsContentUtils::ContentIsDraggable(content) ) {
        // coordinate stuff is the fix for bug #55921
        nsIView *dummyView = 0;
        nsRect frameRect = mRect;
        nsPoint offsetPoint;

        GetOffsetFromView(offsetPoint, &dummyView);

        frameRect.x = offsetPoint.x;
        frameRect.y = offsetPoint.y;

        if (frameRect.x <= aEvent->point.x && (frameRect.x + frameRect.width >= aEvent->point.x) &&
            frameRect.y <= aEvent->point.y && (frameRect.y + frameRect.height >= aEvent->point.y))
          return NS_OK;
      }
    }
  } // if browser, not editor

  // check whether style allows selection
  // if not, don't tell selection the mouse event even occurred.  
  PRBool  selectable;
  PRUint8 selectStyle;
  rv = IsSelectable(&selectable, &selectStyle);
  if (NS_FAILED(rv)) return rv;
  
  // check for select: none
  if (!selectable)
    return NS_OK;

  // When implementing NS_STYLE_USER_SELECT_ELEMENT, NS_STYLE_USER_SELECT_ELEMENTS and
  // NS_STYLE_USER_SELECT_TOGGLE, need to change this logic
  PRBool useFrameSelection = (selectStyle == NS_STYLE_USER_SELECT_TEXT);

  if (!IsMouseCaptured(aPresContext))
    CaptureMouse(aPresContext, PR_TRUE);

  PRInt16 displayresult = nsISelectionController::SELECTION_OFF;
  nsCOMPtr<nsISelectionController> selCon;
  rv = GetSelectionController(aPresContext, getter_AddRefs(selCon));
  //get the selection controller
  if (NS_SUCCEEDED(rv) && selCon) 
  {
    selCon->GetDisplaySelection(&displayresult);
    if (displayresult == nsISelectionController::SELECTION_OFF)
      return NS_OK;//nothing to do we cannot affect selection from here
  }

  //get the frame selection from sel controller

  // nsFrameState  state = GetStateBits();
  // if (state & NS_FRAME_INDEPENDENT_SELECTION) 
  nsCOMPtr<nsIFrameSelection> frameselection;

  if (useFrameSelection)
    frameselection = do_QueryInterface(selCon); //this MAY implement

  if (!frameselection)//if we must get it from the pres shell's
    frameselection = shell->FrameSelection();

  if (!frameselection)
    return NS_ERROR_FAILURE;

  nsMouseEvent *me = (nsMouseEvent *)aEvent;

#if defined(XP_MAC) || defined(XP_MACOSX)
  if (me->isControl)
    return NS_OK;//short ciruit. hard coded for mac due to time restraints.
#endif
    
  if (me->clickCount >1 )
  {
    rv = frameselection->SetMouseDownState( PR_TRUE );
  
    frameselection->SetMouseDoubleDown(PR_TRUE);
    return HandleMultiplePress(aPresContext, aEvent, aEventStatus);
  }

  nsCOMPtr<nsIContent> content;
  PRInt32 startOffset = 0, endOffset = 0;
  PRBool  beginFrameContent = PR_FALSE;

  rv = GetContentAndOffsetsFromPoint(aPresContext, aEvent->point, getter_AddRefs(content), startOffset, endOffset, beginFrameContent);
  // do we have CSS that changes selection behaviour?