Back to index

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

#include <nsMenuFrame.h>

Inheritance diagram for nsMenuFrame:
Inheritance graph
[legend]
Collaboration diagram for nsMenuFrame:
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

 nsMenuFrame (nsIPresShell *aShell)
NS_DECL_ISUPPORTS NS_IMETHOD DoLayout (nsBoxLayoutState &aBoxLayoutState)
 If subclassing please subclass this method not layout.
NS_IMETHOD GetMinSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetPrefSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD Init (nsPresContext *aPresContext, nsIContent *aContent, nsIFrame *aParent, nsStyleContext *aContext, nsIFrame *aPrevInFlow)
 Initialize us.
NS_IMETHOD IsActive (PRBool &aResult)
virtual nsIFrameGetFirstChild (nsIAtom *aListName) const
 Get the first child frame from the specified child list.
NS_IMETHOD SetInitialChildList (nsPresContext *aPresContext, nsIAtom *aListName, nsIFrame *aChildList)
 Called to set the initial list of frames.
virtual nsIAtomGetAdditionalChildListName (PRInt32 aIndex) const
 Used to iterate the list of additional child list names.
NS_IMETHOD Destroy (nsPresContext *aPresContext)
 Destroys this frame and each of its child frames (recursively calls Destroy() for each child)
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 HandleEvent (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
 Event handling of GUI events.
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 ActivateMenu (PRBool aActivateFlag)
NS_IMETHOD SelectMenu (PRBool aActivateFlag)
NS_IMETHOD OpenMenu (PRBool aActivateFlag)
NS_IMETHOD MenuIsOpen (PRBool &aResult)
NS_IMETHOD MenuIsContainer (PRBool &aResult)
NS_IMETHOD MenuIsChecked (PRBool &aResult)
NS_IMETHOD MenuIsDisabled (PRBool &aResult)
NS_IMETHOD GetActiveChild (nsIDOMElement **aResult)
NS_IMETHOD SetActiveChild (nsIDOMElement *aChild)
NS_IMETHOD UngenerateMenu ()
NS_IMETHOD SelectFirstItem ()
NS_IMETHOD Escape (PRBool &aHandledFlag)
NS_IMETHOD Enter ()
NS_IMETHOD ShortcutNavigation (nsIDOMKeyEvent *aKeyEvent, PRBool &aHandledFlag)
NS_IMETHOD KeyboardNavigation (PRUint32 aKeyCode, PRBool &aHandledFlag)
NS_IMETHOD SetParent (const nsIFrame *aParent)
virtual nsIMenuParentGetMenuParent ()
virtual nsIFrameGetMenuChild ()
NS_IMETHOD GetRadioGroupName (nsString &aName)
NS_IMETHOD GetMenuType (nsMenuType &aType)
NS_IMETHOD MarkChildrenStyleChange ()
NS_IMETHOD MarkAsGenerated ()
virtual nsIScrollableViewGetScrollableView ()
nsresult DestroyPopupFrames (nsPresContext *aPresContext)
PRBool IsOpen ()
PRBool IsMenu ()
PRBool IsDisabled ()
PRBool IsGenerated ()
NS_IMETHOD ToggleMenuState ()
void SetIsMenu (PRBool aIsMenu)
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
SetLayoutManager (nsIBoxLayout *aLayout)
NS_IMETHOD GetLayoutManager (nsIBoxLayout **aLayout)
NS_IMETHOD RelayoutChildAtOrdinal (nsBoxLayoutState &aState, nsIBox *aChild)
NS_IMETHOD GetIndexOf (nsIBox *aChild, PRInt32 *aIndex)
NS_IMETHOD GetMaxSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetFlex (nsBoxLayoutState &aBoxLayoutState, nscoord &aFlex)
NS_IMETHOD GetAscent (nsBoxLayoutState &aBoxLayoutState, nscoord &aAscent)
NS_IMETHOD GetVAlign (Valignment &aAlign)
NS_IMETHOD GetVAlign (Valignment &aAlign)
NS_IMETHOD GetHAlign (Halignment &aAlign)
NS_IMETHOD NeedsRecalc ()
NS_IMETHOD GetMouseThrough (PRBool &aMouseThrough)
virtual PRBool ComputesOwnOverflowArea ()
NS_IMETHOD GetCursor (const nsPoint &aPoint, nsIFrame::Cursor &aCursor)
 Get the cursor for a given 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 Reflow (nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
 The frame is given a maximum size and asked for its desired size.
virtual nsIAtomGetType () const
 Get the "type" of the frame.
NS_IMETHOD DidReflow (nsPresContext *aPresContext, const nsHTMLReflowState *aReflowState, nsDidReflowStatus aStatus)
 Post-reflow hook.
virtual nsresult GetContentOf (nsIContent **aContent)
NS_IMETHOD Paint (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
 Paint is responsible for painting the frame.
nsIBox * GetBoxAt (PRInt32 aIndex)
PRInt32 GetChildCount ()
void FireDOMEventSynch (const nsAString &aDOMEventName, nsIContent *aContent=nsnull)
 NS_HIDDEN_ (void *) GetProperty(nsIAtom *aPropertyName
 NS_HIDDEN_ (nsresult) DeleteProperty(nsIAtom *aPropertyName) const
NS_IMETHOD ReplaceFrame (nsIAtom *aListName, nsIFrame *aOldFrame, nsIFrame *aNewFrame)
 This method is responsible for replacing the old frame with the new frame.
virtual PRBool IsLeaf () const
 Is this a leaf frame? Frames that want the frame constructor to be able to construct kids for them should return false, all others should return true.
virtual void DeleteNextInFlowChild (nsPresContext *aPresContext, nsIFrame *aNextInFlow)
 Remove and delete aNextInFlow and its next-in-flows.
nsresult ReflowChild (nsIFrame *aKidFrame, nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nscoord aX, nscoord aY, PRUint32 aFlags, nsReflowStatus &aStatus)
 Invokes the WillReflow() function, positions the frame and its view (if requested), and then calls Reflow().
NS_IMETHOD IsSplittable (nsSplittableType &aIsSplittable) const
 Return how your frame can be split.
virtual nsIFrameGetPrevInFlow () const
 Flow member functions.
NS_IMETHOD SetPrevInFlow (nsIFrame *)
virtual nsIFrameGetNextInFlow () const
NS_IMETHOD SetNextInFlow (nsIFrame *)
virtual nsIFrameGetFirstInFlow () const
 Return the first frame in our current flow.
virtual nsIFrameGetLastInFlow () const
 Return the last frame in our current flow.
voidoperator new (size_t sz, nsIPresShell *aPresShell) CPP_THROW_NEW
void operator delete (void *aPtr, size_t sz)
NS_IMETHOD QueryInterface (const nsIID &aIID, void **aInstancePtr)
NS_IMETHOD CalcBorderPadding (nsMargin &aBorderPadding) const
virtual nsStyleContextGetAdditionalStyleContext (PRInt32 aIndex) const
 These methods are to access any additional style contexts that the frame may be holding.
virtual void SetAdditionalStyleContext (PRInt32 aIndex, nsStyleContext *aStyleContext)
NS_IMETHOD GetContentForEvent (nsPresContext *aPresContext, nsEvent *aEvent, nsIContent **aContent)
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 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 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 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 SetIncludeOverflow (PRBool aInclude)
NS_IMETHOD GetOverflow (nsSize &aOverflow)
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 RelayoutDirtyChild (nsBoxLayoutState &aState, nsIBox *aChild)
NS_IMETHOD MarkStyleChange (nsBoxLayoutState &aState)
NS_IMETHOD ChildrenMustHaveWidgets (PRBool &aMust) const
 Hack for deck who requires that all its children has widgets.
virtual PRBool DoesClipChildren ()
 Returns PR_TRUE if this box clips its children, e.g., if this box is an sc rollbox.
PRBool DoesNeedRecalc (const nsSize &aSize)
PRBool DoesNeedRecalc (nscoord aCoord)
void SizeNeedsRecalc (nsSize &aSize)
void CoordNeedsRecalc (nscoord &aCoord)
void AddBorderAndPadding (nsSize &aSize)
void AddInset (nsSize &aSize)
void AddMargin (nsSize &aSize)
nsPresContextGetPresContext () const
virtual void RemovedAsPrimaryFrame (nsPresContext *aPresContext)
nsIContentGetContent () const
 Get the content object associated with this frame.
virtual nsIFrameGetContentInsertionFrame ()
 Get the frame that should be the parent for the frames of child elements.
virtual already_AddRefed
< nsIContent
GetContentInsertionNode ()
 Get the child content node whose frame should be used as the parent for the frames of child elements.
virtual void AdjustOffsetsForBidi (PRInt32 aStart, PRInt32 aEnd)
 Reset the offsets when splitting frames during Bidi reordering.
nsStyleContextGetStyleContext () const
 Get the style context associated with this frame.
void SetStyleContext (nsPresContext *aPresContext, nsStyleContext *aContext)
const nsStyleStructGetStyleData (nsStyleStructID aSID) const
nsIFrameGetParent () const
 Accessor functions for geometric parent.
nsRect GetRect () const
 Bounding rect of the frame.
nsPoint GetPosition () const
nsSize GetSize () const
void SetRect (const nsRect &aRect)
void SetPosition (const nsPoint &aPt)
void SetSize (const nsSize &aSize)
nsIFrameGetNextSibling () const
 Child frames are linked together in a singly-linked list.
void SetNextSibling (nsIFrame *aNextSibling)
virtual PRBool CanPaintBackground ()
 Does the frame paint its background? If not, then all or part of it will be painted by ancestors.
virtual PRBool NeedsView ()
 Does this frame type always need a view?
virtual nsresult CreateWidgetForView (nsIView *aView)
 This frame needs a view with a widget (e.g.
nsFrameState GetStateBits () const
 Get the current frame-state value for this frame.
void AddStateBits (nsFrameState aBits)
 Update the current frame-state value for this frame.
void RemoveStateBits (nsFrameState aBits)
PRBool HasView () const
 Accessor functions to get/set the associated view object.
nsIViewGetView () const
virtual nsIViewGetViewExternal () const
nsresult SetView (nsIView *aView)
virtual nsIViewGetParentViewForChildFrame (nsIFrame *aFrame) const
 This view will be used to parent the views of any children.
nsIViewGetClosestView (nsPoint *aOffset=nsnull) const
 Find the closest view (on |this| or an ancestor).
nsIFrameGetAncestorWithView () const
 Find the closest ancestor (excluding |this| !) that has a view.
virtual nsIFrameGetAncestorWithViewExternal () const
nsPoint GetOffsetTo (const nsIFrame *aOther) const
 Get the offset between the coordinate systems of |this| and aOther.
virtual nsPoint GetOffsetToExternal (const nsIFrame *aOther) const
nsIntRect GetScreenRect () const
 Get the screen rect of the frame.
virtual nsIntRect GetScreenRectExternal () const
virtual PRBool AreAncestorViewsVisible () const
 Returns true if and only if all views, from |GetClosestView| up to the top of the view hierarchy are visible.
virtual nsIWidgetGetWindow () const
 Returns the window that contains this frame.
virtual PRBool IsFrameOfType (PRUint32 aFlags) const
 API for doing a quick check if a frame is of a given type.
virtual PRBool IsFloatContainingBlock () const
 Is this frame a containing block for floating elements? Note that very few frames are, so default to false.
virtual nsIViewGetMouseCapturer () const
 Does this frame want to capture the mouse when the user clicks in it or its children? If so, return the view which should be targeted for mouse capture.
void Invalidate (const nsRect &aDamageRect, PRBool aImmediate=PR_FALSE) const
 Invalidate part of the frame by asking the view manager to repaint.
nsRect GetOverflowRect () const
 Computes a rect that includes this frame, all its descendant frames, this frame's outline (if any), and all descendant frames' outlines (if any).
void FinishAndStoreOverflow (nsRect *aOverflowArea, nsSize aNewSize)
 Set/unset the NS_FRAME_OUTSIDE_CHILDREN flag and store the overflow area as a frame property in the frame manager so that it can be retrieved later without reflowing the frame.
void FinishAndStoreOverflow (nsHTMLReflowMetrics *aMetrics)
PRBool IsGeneratedContentFrame ()
 IsGeneratedContentFrame returns whether a frame corresponds to generated content.
PRBool IsPseudoFrame (nsIContent *aParentContent)
 IsPseudoFrame returns whether a frame is a pseudo frame (eg an anonymous table-row frame created for a CSS table-cell without an enclosing table-row.
nsRectGetOverflowAreaProperty (PRBool aCreateIfNecessary=PR_FALSE)
 Create or retrieve the previously stored overflow area, if the frame does not overflow and no creation is required return nsnull.
virtual PRBool SupportsVisibilityHidden ()
 Return PR_TRUE if and only if this frame obeys visibility:hidden.
virtual PRBool IsFocusable (PRInt32 *aTabIndex=nsnull, PRBool aWithMouse=PR_FALSE)
 Check if this frame is focusable and in the current tab order.
PRBool IsBoxFrame () const
PRBool IsBoxWrapped () const
 GetOrdinal (nsBoxLayoutState &aBoxLayoutState, PRUint32 &aOrdinal)
nsresult IsDirty (PRBool &aIsDirty)
nsresult HasDirtyChildren (PRBool &aIsDirty)
nsresult GetChildBox (nsIBox **aBox)
nsresult GetNextBox (nsIBox **aBox)
NS_IMETHOD GetBorderAndPadding (nsMargin &aBorderAndPadding)
nsresult GetInset (nsMargin &aInset)
PRBool IsHorizontal () const
nsresult GetOrientation (PRBool &aIsHorizontal)
 XXX to be removed.
PRBool IsNormalDirection () const
nsresult GetDirection (PRBool &aIsNormal)
 XXX to be removed.
nsPeekOffsetStruct GetExtremeCaretPosition (PRBool aStart)
 gets the first or last possible caret position within the frame

Static Public Member Functions

static PRBool IsSizedToPopup (nsIContent *aContent, PRBool aRequireAlways)
static nsIMenuParentGetContextMenu ()
static nsresult CreateViewForFrame (nsPresContext *aPresContext, nsIFrame *aChild, nsStyleContext *aStyleContext, PRBool aForce)
 Boxed don't support fixed positionioning of their children.
static PRBool IsInitialReflowForPrintPreview (nsBoxLayoutState &aState, PRBool &aIsChrome)
 Returns PR_TRUE when the reflow reason is "Initial" and doing Print Preview when returning PR_FALSE aIsChrome's value is indeterminate aIsChrome - Returns PR_TRUE when document is chrome, otherwise PR_FALSE.
static nsresult LayoutChildAt (nsBoxLayoutState &aState, nsIBox *aBox, const nsRect &aRect)
static PRInt32 LengthOf (nsIFrame *aFrameList)
static void PositionFrameView (nsIFrame *aKidFrame)
 Position the view associated with |aKidFrame|, if there is one.
static void SyncFrameViewAfterReflow (nsPresContext *aPresContext, nsIFrame *aFrame, nsIView *aView, const nsRect *aCombinedArea, PRUint32 aFlags=0)
static void SyncFrameViewAfterSizeChange (nsPresContext *aPresContext, nsIFrame *aFrame, nsStyleContext *aStyleContext, nsIView *aView, PRUint32 aFlags=0)
static void SyncFrameViewProperties (nsPresContext *aPresContext, nsIFrame *aFrame, nsStyleContext *aStyleContext, nsIView *aView, PRUint32 aFlags=0)
static PRBool FrameNeedsView (nsIFrame *aFrame)
static nsresult FinishReflowChild (nsIFrame *aKidFrame, nsPresContext *aPresContext, const nsHTMLReflowState *aReflowState, nsHTMLReflowMetrics &aDesiredSize, nscoord aX, nscoord aY, PRUint32 aFlags)
 The second half of frame reflow.
static void PositionChildViews (nsIFrame *aFrame)
 Position the views of |aFrame|'s descendants.
static void RemoveFromFlow (nsIFrame *aFrame)
static void BreakFromPrevFlow (nsIFrame *aFrame)
static nsresult GetNextPrevLineFromeBlockFrame (nsPresContext *aPresContext, nsPeekOffsetStruct *aPos, nsIFrame *aBlockFrame, PRInt32 aLineStart, PRInt8 aOutSideLimit)
static nsIFrameCorrectStyleParentFrame (nsIFrame *aProspectiveParent, nsIAtom *aChildPseudo)
 Adjust the given parent frame to the right style context parent frame for the child, given the pseudo-type of the prospective child.
static void GetLastLeaf (nsPresContext *aPresContext, nsIFrame **aFrame)
static void GetFirstLeaf (nsPresContext *aPresContext, nsIFrame **aFrame)
static void Shutdown ()
static void AddBorderAndPadding (nsIBox *aBox, nsSize &aSize)
static void AddInset (nsIBox *aBox, nsSize &aSize)
static void AddMargin (nsIBox *aChild, nsSize &aSize)
static void AddMargin (nsSize &aSize, const nsMargin &aMargin)
static void BoundsCheckMinMax (nsSize &aMinSize, nsSize &aMaxSize)
static void BoundsCheck (nsSize &aMinSize, nsSize &aPrefSize, nsSize &aMaxSize)
static void BoundsCheck (nscoord &aMinSize, nscoord &aPrefSize, nscoord &aMaxSize)
static PRBool AddCSSPrefSize (nsBoxLayoutState &aState, nsIBox *aBox, nsSize &aSize)
static PRBool AddCSSMinSize (nsBoxLayoutState &aState, nsIBox *aBox, nsSize &aSize)
static PRBool AddCSSMaxSize (nsBoxLayoutState &aState, nsIBox *aBox, nsSize &aSize)
static PRBool AddCSSFlex (nsBoxLayoutState &aState, nsIBox *aBox, nscoord &aFlex)
static PRBool AddCSSCollapsed (nsBoxLayoutState &aState, nsIBox *aBox, PRBool &aCollapsed)
static PRBool AddCSSOrdinal (nsBoxLayoutState &aState, nsIBox *aBox, PRUint32 &aOrdinal)

Public Attributes

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

Static Public Attributes

static nsMenuDismissalListenersDismissalListener = nsnull

Protected Types

enum  eMouseThrough { unset, never, always }

Protected Member Functions

virtual void RePositionPopup (nsBoxLayoutState &aState)
void ConvertPosition (nsIContent *aPopupElt, nsString &aAnchor, nsString &aAlign)
void UpdateMenuType (nsPresContext *aPresContext)
void UpdateMenuSpecialState (nsPresContext *aPresContext)
void OpenMenuInternal (PRBool aActivateFlag)
void GetMenuChildrenElement (nsIContent **aResult)
void BuildAcceleratorText ()
void Execute (nsGUIEvent *aEvent)
PRBool OnCreate ()
PRBool OnCreated ()
PRBool OnDestroy ()
PRBool OnDestroyed ()
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 ~nsMenuFrame ()
PRBool SizeToPopup (nsBoxLayoutState &aState, nsSize &aSize)
 NS_HIDDEN_ (nsresult) Notify(nsITimer *aTimer)
virtual PRBool HasStyleChange ()
virtual void SetStyleChangeFlag (PRBool aDirty)
virtual PRBool GetWasCollapsed (nsBoxLayoutState &aState)
virtual void SetWasCollapsed (nsBoxLayoutState &aState, PRBool aWas)
virtual void PaintChild (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsIFrame *aFrame, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
 Redefined to handle collapsed as well as removing unneeded crap having to do with frame state and overlapping that only applied to HTML not XUL.
virtual void PaintChildren (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
virtual PRBool GetInitialEqualSize (PRBool &aEqualSize)
virtual void GetInitialOrientation (PRBool &aIsHorizontal)
virtual void GetInitialDirection (PRBool &aIsNormal)
virtual PRBool GetInitialHAlignment (Halignment &aHalign)
virtual PRBool GetInitialVAlignment (Valignment &aValign)
virtual PRBool GetInitialAutoStretch (PRBool &aStretch)
nsresult RegUnregAccessKey (nsPresContext *aPresContext, PRBool aDoReg)
virtual nsresult GetFrameForPointChild (const nsPoint &aPoint, nsFramePaintLayer aWhichLayer, nsIFrame *aChild, PRBool aCheckMouseThrough, nsIFrame **aFrame)
 NS_HIDDEN_ (void) CheckBoxOrder(nsBoxLayoutState &aState)
nsresult GetFrameForPointUsing (const nsPoint &aPoint, nsIAtom *aList, nsFramePaintLayer aWhichLayer, PRBool aConsiderSelf, nsIFrame **aFrame)
nsIFrameGetOverflowFrames (nsPresContext *aPresContext, PRBool aRemoveProperty) const
 Get the frames on the overflow list.
nsresult SetOverflowFrames (nsPresContext *aPresContext, nsIFrame *aOverflowFrames)
 Set the overflow list.
PRBool MoveOverflowToChildList (nsPresContext *aPresContext)
 Moves any frames on both the prev-in-flow's overflow list and the receiver's overflow to the receiver's child list.
void PushChildren (nsPresContext *aPresContext, nsIFrame *aFromChild, nsIFrame *aPrevSibling)
 Push aFromChild and its next siblings to the next-in-flow.
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)
void InitBoxMetrics (PRBool aClear)
nsBoxLayoutMetricsBoxMetrics () const
void FireDOMEvent (const nsAString &aDOMEventName, nsIContent *aContent=nsnull)
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)
virtual PRBool GetDefaultFlex (PRInt32 &aFlex)
virtual void GetLayoutFlags (PRUint32 &aFlags)

Static Protected Member Functions

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

Protected Attributes

nsFrameList mPopupFrames
PRPackedBool mIsMenu
PRPackedBool mMenuOpen
PRPackedBool mCreateHandlerSucceeded
PRPackedBool mChecked
nsMenuType mType
nsIMenuParentmMenuParent
nsRefPtr< nsMenuTimerMediatormTimerMediator
nsCOMPtr< nsITimermOpenTimer
nsPresContextmPresContext
nsString mGroupName
nsSize mLastPref
nsSize mPrefSize
nsSize mMinSize
nsSize mMaxSize
nscoord mFlex
nscoord mAscent
nsCOMPtr< nsIBoxLayoutmLayoutManager
nsFrameList mFrames
nsIFramemPrevInFlow
nsIFramemNextInFlow
nsRect mRect
nsIContentmContent
nsStyleContextmStyleContext
nsIFramemParent
nsIFramemNextSibling
nsFrameState mState

Static Protected Attributes

static nsrefcnt gRefCnt = 0
static nsStringgShiftText = nsnull
static nsStringgControlText = nsnull
static nsStringgMetaText = nsnull
static nsStringgAltText = nsnull
static nsStringgModifierSeparator = nsnull
static PRBool gGotTheme = PR_FALSE
static nsIThemegTheme = nsnull

Friends

class nsMenuTimerMediator
class nsASyncMenuInitialization
nsresult NS_NewBoxFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame, PRBool aIsRoot, nsIBoxLayout *aLayoutManager)
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

Note:
*** Methods marked with '
See also:
comment ***' may cause the frame to be deleted during the method call. Be careful whenever using those methods.

Definition at line 101 of file nsMenuFrame.h.


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

nsMenuFrame::~nsMenuFrame ( ) [protected, virtual]

Definition at line 276 of file nsMenuFrame.cpp.

{
  // Clean up shared statics
  if (--gRefCnt == 0) {
    delete gShiftText;
    gShiftText = nsnull;
    delete gControlText;  
    gControlText = nsnull;
    delete gMetaText;  
    gMetaText = nsnull;
    delete gAltText;  
    gAltText = nsnull;
    delete gModifierSeparator;
    gModifierSeparator = nsnull;
  }
}

Member Function Documentation

NS_IMETHODIMP nsMenuFrame::ActivateMenu ( PRBool  aActivateFlag) [virtual]

Implements nsIMenuFrame.

Definition at line 785 of file nsMenuFrame.cpp.

{
  nsIFrame* frame = mPopupFrames.FirstChild();
  nsMenuPopupFrame* menuPopup = (nsMenuPopupFrame*)frame;
  
  if (!menuPopup) 
    return NS_OK;

  if (aActivateFlag) {
      nsRect rect = menuPopup->GetRect();
      nsIView* view = menuPopup->GetView();
      nsIViewManager* viewManager = view->GetViewManager();
      rect.x = rect.y = 0;
      viewManager->ResizeView(view, rect);

      // make sure the scrolled window is at 0,0
      if (mLastPref.height <= rect.height) {
        nsIBox* child;
        menuPopup->GetChildBox(&child);

        nsCOMPtr<nsIScrollableFrame> scrollframe(do_QueryInterface(child));
        if (scrollframe) {
          scrollframe->ScrollTo(nsPoint(0,0));
        }
      }

      viewManager->UpdateView(view, rect, NS_VMREFRESH_IMMEDIATE);
      viewManager->SetViewVisibility(view, nsViewVisibility_kShow);

  } else {
    if (mMenuOpen) {
      nsWeakFrame weakFrame(this);
      nsWeakFrame weakPopup(menuPopup);
      FireDOMEventSynch(NS_LITERAL_STRING("DOMMenuInactive"), menuPopup->GetContent());
      NS_ENSURE_TRUE(weakFrame.IsAlive() && weakPopup.IsAlive(), NS_OK);
    }
    nsIView* view = menuPopup->GetView();
    NS_ASSERTION(view, "View is gone, looks like someone forgot to rollup the popup!");
    if (view) {
      nsIViewManager* viewManager = view->GetViewManager();
      if (viewManager) { // the view manager can be null during widget teardown
        viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
        viewManager->ResizeView(view, nsRect(0, 0, 0, 0));
      }
    }
    // set here so hide chain can close the menu as well.
    mMenuOpen = PR_FALSE;
  }
  
  return NS_OK;
}  

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1203 of file nsBox.cpp.

{
  AddBorderAndPadding(this, aSize);
}

Here is the caller graph for this function:

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

Definition at line 1215 of file nsBox.cpp.

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

Here is the call graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Definition at line 124 of file nsBox.h.

{ AddInset(this, aSize); }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 131 of file nsBox.h.

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

Definition at line 1209 of file nsBox.cpp.

{
  AddMargin(this, aSize);
}

Here is the caller graph for this function:

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

Definition at line 1223 of file nsBox.cpp.

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

Here is the call graph for this function:

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

Definition at line 1231 of file nsBox.cpp.

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

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

Update the current frame-state value for this frame.

Definition at line 823 of file nsIFrame.h.

{ mState |= aBits; }
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 nsMenuFrame::AppendFrames ( nsIAtom aListName,
nsIFrame aFrameList 
) [virtual]

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

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

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

Reimplemented from nsBoxFrame.

Definition at line 2039 of file nsMenuFrame.cpp.

{
  if (!aFrameList)
    return NS_OK;

  nsresult          rv;

  nsIMenuParent *menuPar;
  if (aFrameList && NS_SUCCEEDED(CallQueryInterface(aFrameList, &menuPar))) {
    NS_ASSERTION(aFrameList->IsBoxFrame(),"Popup is not a box!!!");

    mPopupFrames.AppendFrames(nsnull, aFrameList);
    nsBoxLayoutState state(GetPresContext());
#ifdef DEBUG_LAYOUT
    SetDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG);
#endif
    rv = MarkDirtyChildren(state);
  } else {
    rv = nsBoxFrame::AppendFrames(aListName, aFrameList); 
  }

  return rv;
}

Here is the call graph for this function:

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

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

Definition at line 2546 of file nsFrame.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMenuFrame::AttributeChanged ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [protected, 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 nsBoxFrame.

Definition at line 838 of file nsMenuFrame.cpp.

{
  nsAutoString value;

  if (aAttribute == nsHTMLAtoms::checked) {
    if (mType != eMenuType_Normal)
        UpdateMenuSpecialState(GetPresContext());
  } else if (aAttribute == nsXULAtoms::acceltext) {
    // someone reset the accelText attribute, so clear the bit that says *we* set it
    AddStateBits(NS_STATE_ACCELTEXT_IS_DERIVED);
    BuildAcceleratorText();
  } else if (aAttribute == nsXULAtoms::key) {
    BuildAcceleratorText();
  } else if ( aAttribute == nsHTMLAtoms::type || aAttribute == nsHTMLAtoms::name )
    UpdateMenuType(GetPresContext());

  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:

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

Definition at line 144 of file nsSplittableFrame.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1603 of file nsMenuFrame.cpp.

{
  nsAutoString accelText;

  if ((GetStateBits() & NS_STATE_ACCELTEXT_IS_DERIVED) == 0) {
    mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::acceltext, accelText);
    if (!accelText.IsEmpty())
      return;
  }
  // accelText is definitely empty here.

  // Now we're going to compute the accelerator text, so remember that we did.
  AddStateBits(NS_STATE_ACCELTEXT_IS_DERIVED);

  // If anything below fails, just leave the accelerator text blank.
  nsWeakFrame weakFrame(this);
  mContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::acceltext, PR_FALSE);
  ENSURE_TRUE(weakFrame.IsAlive());

  // See if we have a key node and use that instead.
  nsAutoString keyValue;
  mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::key, keyValue);
  if (keyValue.IsEmpty())
    return;

  // Turn the document into a DOM document so we can use getElementById
  nsCOMPtr<nsIDOMDocument> domDocument(do_QueryInterface(mContent->GetDocument()));
  if (!domDocument)
    return;

  nsCOMPtr<nsIDOMElement> keyDOMElement;
  domDocument->GetElementById(keyValue, getter_AddRefs(keyDOMElement));
  if (!keyDOMElement)
    return;

  nsCOMPtr<nsIContent> keyElement(do_QueryInterface(keyDOMElement));
  if (!keyElement)
    return;

  // get the string to display as accelerator text
  // check the key element's attributes in this order:
  // |keytext|, |key|, |keycode|
  nsAutoString accelString;
  keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::keytext, accelString);

  if (accelString.IsEmpty()) {
    keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::key, accelString);

    if (!accelString.IsEmpty()) {
      ToUpperCase(accelString);
    } else {
      nsAutoString keyCode;
      keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::keycode, keyCode);
      ToUpperCase(keyCode);

      nsresult rv;
      nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));
      if (NS_SUCCEEDED(rv) && bundleService) {
        nsCOMPtr<nsIStringBundle> bundle;
        rv = bundleService->CreateBundle("chrome://global/locale/keys.properties",
                                         getter_AddRefs(bundle));

        if (NS_SUCCEEDED(rv) && bundle) {
          nsXPIDLString keyName;
          rv = bundle->GetStringFromName(keyCode.get(), getter_Copies(keyName));
          if (keyName)
            accelString = keyName;
        }
      }

      // nothing usable found, bail
      if (accelString.IsEmpty())
        return;
    }
  }

  static PRInt32 accelKey = 0;

  if (!accelKey)
  {
    // Compiled-in defaults, in case we can't get LookAndFeel --
    // command for mac, control for all other platforms.
#if defined(XP_MAC) || defined(XP_MACOSX)
    accelKey = nsIDOMKeyEvent::DOM_VK_META;
#else
    accelKey = nsIDOMKeyEvent::DOM_VK_CONTROL;
#endif

    // Get the accelerator key value from prefs, overriding the default:
    accelKey = nsContentUtils::GetIntPref("ui.key.accelKey", accelKey);
  }

  nsAutoString modifiers;
  keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::modifiers, modifiers);
  
  char* str = ToNewCString(modifiers);
  char* newStr;
  char* token = nsCRT::strtok(str, ", ", &newStr);
  while (token) {
      
    if (PL_strcmp(token, "shift") == 0)
      accelText += *gShiftText;
    else if (PL_strcmp(token, "alt") == 0) 
      accelText += *gAltText; 
    else if (PL_strcmp(token, "meta") == 0) 
      accelText += *gMetaText; 
    else if (PL_strcmp(token, "control") == 0) 
      accelText += *gControlText; 
    else if (PL_strcmp(token, "accel") == 0) {
      switch (accelKey)
      {
        case nsIDOMKeyEvent::DOM_VK_META:
          accelText += *gMetaText;
          break;

        case nsIDOMKeyEvent::DOM_VK_ALT:
          accelText += *gAltText;
          break;

        case nsIDOMKeyEvent::DOM_VK_CONTROL:
        default:
          accelText += *gControlText;
          break;
      }
    }
    
    accelText += *gModifierSeparator;

    token = nsCRT::strtok(newStr, ", ", &newStr);
  }

  nsMemory::Free(str);

  accelText += accelString;
  
  mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::acceltext, accelText, PR_FALSE);
}

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 nsBoxFrame::ComputesOwnOverflowArea ( ) [inline, virtual, inherited]

Reimplemented from nsFrame.

Definition at line 120 of file nsBoxFrame.h.

{ return PR_FALSE; }
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 nsMenuFrame::ConvertPosition ( nsIContent aPopupElt,
nsString aAnchor,
nsString aAlign 
) [protected]

Definition at line 1266 of file nsMenuFrame.cpp.

{
  nsAutoString position;
  aPopupElt->GetAttr(kNameSpaceID_None, nsXULAtoms::position, position);
  if (position.IsEmpty())
    return;

  if (position.EqualsLiteral("before_start")) {
    aAnchor.AssignLiteral("topleft");
    aAlign.AssignLiteral("bottomleft");
  }
  else if (position.EqualsLiteral("before_end")) {
    aAnchor.AssignLiteral("topright");
    aAlign.AssignLiteral("bottomright");
  }
  else if (position.EqualsLiteral("after_start")) {
    aAnchor.AssignLiteral("bottomleft");
    aAlign.AssignLiteral("topleft");
  }
  else if (position.EqualsLiteral("after_end")) {
    aAnchor.AssignLiteral("bottomright");
    aAlign.AssignLiteral("topright");
  }
  else if (position.EqualsLiteral("start_before")) {
    aAnchor.AssignLiteral("topleft");
    aAlign.AssignLiteral("topright");
  }
  else if (position.EqualsLiteral("start_after")) {
    aAnchor.AssignLiteral("bottomleft");
    aAlign.AssignLiteral("bottomright");
  }
  else if (position.EqualsLiteral("end_before")) {
    aAnchor.AssignLiteral("topright");
    aAlign.AssignLiteral("topleft");
  }
  else if (position.EqualsLiteral("end_after")) {
    aAnchor.AssignLiteral("bottomright");
    aAlign.AssignLiteral("bottomleft");
  }
  else if (position.EqualsLiteral("overlap")) {
    aAnchor.AssignLiteral("topleft");
    aAlign.AssignLiteral("topleft");
  }
}

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:

nsresult nsBoxFrame::CreateViewForFrame ( nsPresContext aPresContext,
nsIFrame aChild,
nsStyleContext aStyleContext,
PRBool  aForce 
) [static, inherited]

Boxed don't support fixed positionioning of their children.

Definition at line 2403 of file nsBoxFrame.cpp.

{
  // If we don't yet have a view, see if we need a view
  if (!aFrame->HasView()) {
    PRInt32 zIndex = 0;
    PRBool  autoZIndex = PR_FALSE;
    PRBool  fixedBackgroundAttachment = PR_FALSE;

    const nsStyleBackground* bg;
    PRBool isCanvas;
    PRBool hasBG =
        nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
    const nsStyleDisplay* disp = aStyleContext->GetStyleDisplay();

    if (disp->mOpacity != 1.0f) {
      NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
        ("nsBoxFrame::CreateViewForFrame: frame=%p opacity=%g",
         aFrame, disp->mOpacity));
      aForce = PR_TRUE;
    }

    // See if the frame has a fixed background attachment
    if (hasBG && bg->HasFixedBackground()) {
      aForce = PR_TRUE;
      fixedBackgroundAttachment = PR_TRUE;
    }
    
    // See if the frame is a scrolled frame
    if (!aForce) {
      if (aStyleContext->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) {
        NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
          ("nsBoxFrame::CreateViewForFrame: scrolled frame=%p", aFrame));
        aForce = PR_TRUE;
      }
    }

    if (aForce) {
      // Create a view
      nsIFrame* parent = aFrame->GetAncestorWithView();
      NS_ASSERTION(parent, "GetAncestorWithView failed");
      nsIView* parentView = parent->GetView();
      NS_ASSERTION(parentView, "no parent with view");
      nsIViewManager* viewManager = parentView->GetViewManager();
      NS_ASSERTION(nsnull != viewManager, "null view manager");

      // Create a view
      nsIView *view = viewManager->CreateView(aFrame->GetRect(), parentView);
      if (view) {
        // If the frame has a fixed background attachment, then indicate that the
        // view's contents should be repainted and not bitblt'd
        if (fixedBackgroundAttachment) {
          viewManager->SetViewBitBltEnabled(view, PR_FALSE);
        }
        
        // Insert the view into the view hierarchy. If the parent view is a
        // scrolling view we need to do this differently
        nsIScrollableView*  scrollingView = parentView->ToScrollableView();
        if (scrollingView) {
          scrollingView->SetScrolledView(view);
        } else {
          viewManager->SetViewZIndex(view, autoZIndex, zIndex);
          // XXX put view last in document order until we can do better
          viewManager->InsertChild(parentView, view, nsnull, PR_TRUE);
        }

        // See if the view should be hidden
        PRBool  viewIsVisible = PR_TRUE;
        PRBool  viewHasTransparentContent =
            !isCanvas &&
            (!hasBG ||
             (bg->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT));

        const nsStyleVisibility* vis = aStyleContext->GetStyleVisibility();
        if (NS_STYLE_VISIBILITY_COLLAPSE == vis->mVisible) {
          viewIsVisible = PR_FALSE;
        }
        else if (NS_STYLE_VISIBILITY_HIDDEN == vis->mVisible) {
          // If it has a widget, hide the view because the widget can't deal with it
          if (view->HasWidget()) {
            viewIsVisible = PR_FALSE;
          }
          else {
            // If it's a container element, then leave the view visible, but
            // mark it as having transparent content. The reason we need to
            // do this is that child elements can override their parent's
            // hidden visibility and be visible anyway.
            //
            // Because this function is called before processing the content
            // object's child elements, we can't tell if it's a leaf by looking
            // at whether the frame has any child frames
            nsIContent* content = aFrame->GetContent();

            if (content && content->IsContentOfType(nsIContent::eELEMENT)) {
              // The view needs to be visible, but marked as having transparent
              // content
              viewHasTransparentContent = PR_TRUE;
            } else {
              // Go ahead and hide the view
              viewIsVisible = PR_FALSE;
            }
          }
        }

        if (viewIsVisible) {
          if (viewHasTransparentContent) {
            viewManager->SetViewContentTransparency(view, PR_TRUE);
          }

        } else {
          viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
        }

        viewManager->SetViewOpacity(view, disp->mOpacity);
      }

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

      NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
        ("nsBoxFrame::CreateViewForFrame: frame=%p view=%p",
         aFrame));
      if (!view)
        return NS_ERROR_OUT_OF_MEMORY;
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

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

Definition at line 942 of file nsFrame.cpp.

{
  return aView->CreateWidget(kWidgetCID);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Updates the sibling and flow pointers

Definition at line 1036 of file nsContainerFrame.cpp.

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

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

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

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

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

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

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMenuFrame::Destroy ( nsPresContext aPresContext) [virtual]

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

Reimplemented from nsBoxFrame.

Definition at line 374 of file nsMenuFrame.cpp.

{
  // Kill our timer if one is active. This is not strictly necessary as
  // the pointer to this frame will be cleared from the mediator, but
  // this is done for added safety.
  if (mOpenTimer) {
    mOpenTimer->Cancel();
  }

  // Null out the pointer to this frame in the mediator wrapper so that it 
  // doesn't try to interact with a deallocated frame.
  mTimerMediator->ClearFrame();

  nsWeakFrame weakFrame(this);
  // are we our menu parent's current menu item?
  if (mMenuParent) {
    nsIMenuFrame *curItem = mMenuParent->GetCurrentMenuItem();
    if (curItem == this) {
      // yes; tell it that we're going away
      mMenuParent->SetCurrentMenuItem(nsnull);
      NS_ENSURE_TRUE(weakFrame.IsAlive(), NS_OK);
    }
  }

  UngenerateMenu();
  NS_ENSURE_TRUE(weakFrame.IsAlive(), NS_OK);
  DestroyPopupFrames(aPresContext);
  return nsBoxFrame::Destroy(aPresContext);
}

Here is the call graph for this function:

Definition at line 357 of file nsMenuFrame.cpp.

{
  // Remove our frame mappings
  nsCSSFrameConstructor* frameConstructor =
    aPresContext->PresShell()->FrameConstructor();
  nsIFrame* curFrame = mPopupFrames.FirstChild();
  while (curFrame) {
    frameConstructor->RemoveMappingsForFrameSubtree(curFrame, nsnull);
    curFrame = curFrame->GetNextSibling();
  }

   // Cleanup frames in popup child list
  mPopupFrames.DestroyFrames(aPresContext);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsBoxFrame::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?

Reimplemented from nsFrame.

Definition at line 701 of file nsBoxFrame.cpp.

{
  nsFrameState preserveBits =
    mState & (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN);
  nsresult rv = nsFrame::DidReflow(aPresContext, aReflowState, aStatus);
  mState |= preserveBits;
  return rv;
}
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:

If subclassing please subclass this method not layout.

layout will call this method.

Reimplemented from nsBoxFrame.

Definition at line 1135 of file nsMenuFrame.cpp.

{
  nsRect contentRect;
  GetContentRect(contentRect);

  // lay us out
  nsresult rv = nsBoxFrame::DoLayout(aState);

  // layout the popup. First we need to get it.
  nsIFrame* popupChild = mPopupFrames.FirstChild();

  if (popupChild) {
    PRBool sizeToPopup = IsSizedToPopup(mContent, PR_FALSE);
    
    NS_ASSERTION(popupChild->IsBoxFrame(), "popupChild is not box!!");

    // then get its preferred size
    nsSize prefSize(0,0);
    nsSize minSize(0,0);
    nsSize maxSize(0,0);

    popupChild->GetPrefSize(aState, prefSize);
    popupChild->GetMinSize(aState, minSize);
    popupChild->GetMaxSize(aState, maxSize);

    BoundsCheck(minSize, prefSize, maxSize);

    if (sizeToPopup)
        prefSize.width = contentRect.width;

    // if the pref size changed then set bounds to be the pref size
    // and sync the view. And set new pref size.
    if (mLastPref != prefSize) {
      popupChild->SetBounds(aState, nsRect(0,0,prefSize.width, prefSize.height));
      RePositionPopup(aState);
      mLastPref = prefSize;
    }

    // is the new size too small? Make sure we handle scrollbars correctly
    nsIBox* child;
    popupChild->GetChildBox(&child);

    nsRect bounds(popupChild->GetRect());

    nsCOMPtr<nsIScrollableFrame> scrollframe(do_QueryInterface(child));
    if (scrollframe &&
        scrollframe->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_AUTO) {
      if (bounds.height < prefSize.height) {
        // layout the child
        popupChild->Layout(aState);

        nsMargin scrollbars = scrollframe->GetActualScrollbarSizes();
        if (bounds.width < prefSize.width + scrollbars.left + scrollbars.right)
        {
          bounds.width += scrollbars.left + scrollbars.right;
          //printf("Width=%d\n",width);
          popupChild->SetBounds(aState, bounds);
        }
      }
    }
    
    // layout the child
    popupChild->Layout(aState);

    // Only size the popups view if open.
    if (mMenuOpen) {
      nsIView* view = popupChild->GetView();
      nsRect r(0, 0, bounds.width, bounds.height);
      view->GetViewManager()->ResizeView(view, r);
    }

  }

  SyncLayout(aState);

  return rv;
}

Here is the call graph for this function:

Implements nsIMenuFrame.

Definition at line 1398 of file nsMenuFrame.cpp.

{
  if (IsDisabled()) {
#ifdef XP_WIN
    // behavior on Windows - close the popup chain
    if (mMenuParent)
      mMenuParent->DismissChain();
#endif   // #ifdef XP_WIN
    // this menu item was disabled - exit
    return NS_OK;
  }
    
  if (!mMenuOpen) {
    // The enter key press applies to us.
    if (!IsMenu() && mMenuParent)
      Execute(0);          // Execute our event handler
    else {
      OpenMenu(PR_TRUE);
      SelectFirstItem();
    }

    return NS_OK;
  }

  nsIFrame* frame = mPopupFrames.FirstChild();
  if (frame) {
    nsMenuPopupFrame* popup = (nsMenuPopupFrame*)frame;
    popup->Enter();
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsMenuFrame::Escape ( PRBool aHandledFlag) [virtual]

Implements nsIMenuFrame.

Definition at line 1374 of file nsMenuFrame.cpp.

{
  if (mMenuParent) {
    mMenuParent->ClearRecentlyRolledUp();
  }
  nsIFrame* frame = mPopupFrames.FirstChild();
  if (frame) {
    nsMenuPopupFrame* popup = (nsMenuPopupFrame*)frame;
    popup->Escape(aHandledFlag);
  }

  return NS_OK;
}

Here is the call graph for this function:

void nsMenuFrame::Execute ( nsGUIEvent aEvent) [protected]

Definition at line 1742 of file nsMenuFrame.cpp.

{
  nsWeakFrame weakFrame(this);
  // flip "checked" state if we're a checkbox menu, or an un-checked radio menu
  if (mType == eMenuType_Checkbox || (mType == eMenuType_Radio && !mChecked)) {
    nsAutoString value;
    mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::autocheck, value);
    if (!value.EqualsLiteral("false")) {
      if (mChecked) {
        mContent->UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::checked,
                            PR_TRUE);
        ENSURE_TRUE(weakFrame.IsAlive());
      }
      else {
        mContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, NS_LITERAL_STRING("true"),
                          PR_TRUE);
        ENSURE_TRUE(weakFrame.IsAlive());
      }        
      /* the AttributeChanged code will update all the internal state */
    }
  }

  // Temporarily disable rollup events on this menu.  This is
  // to suppress this menu getting removed in the case where
  // the oncommand handler opens a dialog, etc.
  if ( nsMenuFrame::sDismissalListener ) {
    nsMenuFrame::sDismissalListener->EnableListener(PR_FALSE);
  }

  // Get our own content node and hold on to it to keep it from going away.
  nsCOMPtr<nsIContent> content = mContent;

  // Deselect ourselves.
  SelectMenu(PR_FALSE);
  ENSURE_TRUE(weakFrame.IsAlive());

  // Now hide all of the open menus.
  if (mMenuParent) {
    mMenuParent->HideChain();

    // Since menu was not dismissed via click outside menu
    // we don't want to keep track of this rollup.
    // Otherwise, we keep track so that the same click 
    // won't both dismiss and then reopen a menu.
    mMenuParent->ClearRecentlyRolledUp();
  }


  nsEventStatus status = nsEventStatus_eIgnore;
  // Create a trusted event if the triggering event was trusted, or if
  // we're called from chrome code (since at least one of our caller
  // passes in a null event).
  nsXULCommandEvent event(aEvent ? NS_IS_TRUSTED_EVENT(aEvent) :
                          nsContentUtils::IsCallerChrome(), NS_XUL_COMMAND,
                          nsnull);
  if (aEvent && (aEvent->eventStructType == NS_MOUSE_EVENT ||
                 aEvent->eventStructType == NS_KEY_EVENT ||
                 aEvent->eventStructType == NS_ACCESSIBLE_EVENT)) {

    event.isShift = NS_STATIC_CAST(nsInputEvent *, aEvent)->isShift;
    event.isControl = NS_STATIC_CAST(nsInputEvent *, aEvent)->isControl;
    event.isAlt = NS_STATIC_CAST(nsInputEvent *, aEvent)->isAlt;
    event.isMeta = NS_STATIC_CAST(nsInputEvent *, aEvent)->isMeta;
  }

  // The order of the nsIViewManager and nsIPresShell COM pointers is
  // important below.  We want the pres shell to get released before the
  // associated view manager on exit from this function.
  // See bug 54233.
  nsCOMPtr<nsIViewManager> kungFuDeathGrip = mPresContext->GetViewManager();
  nsCOMPtr<nsIPresShell> shell = mPresContext->GetPresShell();
  if (shell) {
    shell->HandleDOMEventWithTarget(mContent, &event, &status);
    ENSURE_TRUE(weakFrame.IsAlive());
  }

  if (mMenuParent) {
    mMenuParent->DismissChain();
  }

  // Re-enable rollup events on this menu.
  if ( nsMenuFrame::sDismissalListener ) {
       nsMenuFrame::sDismissalListener->EnableListener(PR_TRUE);
  }
}

Here is the call graph for this function:

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

nsresult nsContainerFrame::FinishReflowChild ( nsIFrame aKidFrame,
nsPresContext aPresContext,
const nsHTMLReflowState aReflowState,
nsHTMLReflowMetrics aDesiredSize,
nscoord  aX,
nscoord  aY,
PRUint32  aFlags 
) [static, inherited]

The second half of frame reflow.

Does the following:

  • sets the frame's bounds
  • sizes and positions (if requested) the frame's view. If the frame's final position differs from the current position and the frame itself does not have a view, then any child frames with views are positioned so they stay in sync
  • sets the view's visibility, opacity, content transparency, and clip
  • invoked the DidReflow() function

Flags: NS_FRAME_NO_MOVE_FRAME - don't move the frame. aX and aY are ignored in this case. Also implies NS_FRAME_NO_MOVE_VIEW NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you don't want to automatically sync the frame and view NS_FRAME_NO_SIZE_VIEW - don't size the frame's view

Definition at line 990 of file nsContainerFrame.cpp.

{
  nsPoint curOrigin = aKidFrame->GetPosition();
  nsRect  bounds(aX, aY, aDesiredSize.width, aDesiredSize.height);

  aKidFrame->SetRect(bounds);

  if (aKidFrame->HasView()) {
    nsIView* view = aKidFrame->GetView();
    // Make sure the frame's view is properly sized and positioned and has
    // things like opacity correct
    SyncFrameViewAfterReflow(aPresContext, aKidFrame, view,
                             &aDesiredSize.mOverflowArea,
                             aFlags);
  }

  if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) &&
      (curOrigin.x != aX || curOrigin.y != aY)) {
    if (!aKidFrame->HasView()) {
      // If the frame has moved, then we need to make sure any child views are
      // correctly positioned
      PositionChildViews(aKidFrame);
    }

    // We also need to redraw everything associated with the frame
    // because if the frame's Reflow issued any invalidates, then they
    // will be at the wrong offset ... note that this includes
    // invalidates issued against the frame's children, so we need to
    // invalidate the overflow area too.
    aKidFrame->Invalidate(aDesiredSize.mOverflowArea);
  }
  
  return aKidFrame->DidReflow(aPresContext, aReflowState, NS_FRAME_REFLOW_FINISHED);
}

Here is the call graph for this function:

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

void nsBoxFrame::FireDOMEventSynch ( const nsAString &  aDOMEventName,
nsIContent aContent = nsnull 
) [inherited]

Definition at line 2578 of file nsBoxFrame.cpp.

{
  nsIContent *content = aContent ? aContent : mContent;
  if (content && mPresContext) {
    // Fire a DOM event
    nsCOMPtr<nsIDOMEvent> event;
    nsCOMPtr<nsIEventListenerManager> manager;
    content->GetListenerManager(getter_AddRefs(manager));
    if (manager && NS_SUCCEEDED(manager->CreateEvent(mPresContext, nsnull,
                                                     NS_LITERAL_STRING("Events"),
                                                     getter_AddRefs(event)))) {
      event->InitEvent(aDOMEventName, PR_TRUE, PR_TRUE);

      nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
      privateEvent->SetTrusted(PR_TRUE);

      PRBool defaultActionEnabled;
      mPresContext->EventStateManager()->
        DispatchNewEvent(content, event, &defaultActionEnabled);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsContainerFrame::FrameNeedsView ( nsIFrame aFrame) [static, inherited]

Definition at line 816 of file nsContainerFrame.cpp.

{
  if (aFrame->NeedsView()) {
    return PR_TRUE;
  }

  nsStyleContext* sc = aFrame->GetStyleContext();
  const nsStyleDisplay* display = sc->GetStyleDisplay();
  if (display->mOpacity != 1.0f) {
    return PR_TRUE;
  }

  // See if the frame has a fixed background attachment
  const nsStyleBackground *color;
  PRBool isCanvas;
  PRBool hasBackground = 
    nsCSSRendering::FindBackground(aFrame->GetPresContext(),
                                   aFrame, &color, &isCanvas);
  if (hasBackground && color->HasFixedBackground()) {
    return PR_TRUE;
  }
    
  if (NS_STYLE_POSITION_RELATIVE == display->mPosition) {
    return PR_TRUE;
  } else if (display->IsAbsolutelyPositioned()) {
    return PR_TRUE;
  } 

  if (sc->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) {
    return PR_TRUE;
  }

  // See if the frame is block-level and has 'overflow' set to
  // '-moz-hidden-unscrollable'. If so, then we need to give it a view
  // so clipping of any child views works correctly. Note that if it's
  // floated it is also block-level, but we can't trust that the style
  // context 'display' value is set correctly.
  if ((display->IsBlockLevel() || display->IsFloating()) &&
      (display->mOverflowX == NS_STYLE_OVERFLOW_CLIP)) {
    // XXX Check for the frame being a block frame and only force a view
    // in that case, because adding a view for box frames seems to cause
    // problems for XUL...
    nsIAtom* frameType = aFrame->GetType();
    if ((frameType == nsLayoutAtoms::blockFrame) ||
        (frameType == nsLayoutAtoms::areaFrame)) {
      return PR_TRUE;
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsIMenuFrame.

Definition at line 2181 of file nsMenuFrame.cpp.

{
  nsIFrame* frame = mPopupFrames.FirstChild();
  nsMenuPopupFrame* menuPopup = (nsMenuPopupFrame*)frame;
  if (!frame)
    return NS_ERROR_FAILURE;

  nsIMenuFrame* menuFrame = menuPopup->GetCurrentMenuItem();
  
  if (!menuFrame) {
    *aResult = nsnull;
  }
  else {
    nsIFrame* f;
    menuFrame->QueryInterface(NS_GET_IID(nsIFrame), (void**)&f);
    nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(f->GetContent()));
    *aResult = elt;
    NS_IF_ADDREF(*aResult);
  }

  return NS_OK;
}

Here is the call graph for this function:

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.

Reimplemented from nsContainerFrame.

Definition at line 344 of file nsMenuFrame.cpp.

{
  // don't expose the child frame list, it slows things down
#if 0
  if (NS_MENU_POPUP_LIST_INDEX == aIndex) {
    return nsLayoutAtoms::popupList;
  }
#endif

  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 nsBoxFrame::GetAscent ( nsBoxLayoutState aBoxLayoutState,
nscoord aAscent 
) [virtual, inherited]

Reimplemented from nsFrame.

Reimplemented in nsXULScrollFrame, and nsTextControlFrame.

Definition at line 968 of file nsBoxFrame.cpp.

{
  if (!DoesNeedRecalc(mAscent)) {
     aAscent = mAscent;
     return NS_OK;
  }

#ifdef DEBUG_LAYOUT
  PropagateDebug(aBoxLayoutState);
#endif

  nsresult rv = NS_OK;
  aAscent = 0;

  PRBool collapsed = PR_FALSE;
  IsCollapsed(aBoxLayoutState, collapsed);
  if (collapsed)
    return NS_OK;

  if (mLayoutManager)
    rv = mLayoutManager->GetAscent(this, aBoxLayoutState, aAscent);
  else
    rv = nsBox::GetAscent(aBoxLayoutState, aAscent);

  mAscent = aAscent;
 
  return rv;
}

Here is the call graph for this function:

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

nsIBox* nsBoxFrame::GetBoxAt ( PRInt32  aIndex) [inline, inherited]

Definition at line 198 of file nsBoxFrame.h.

{ return mFrames.FrameAt(aIndex); }

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:

PRInt32 nsBoxFrame::GetChildCount ( ) [inline, inherited]

Definition at line 199 of file nsBoxFrame.h.

{ return mFrames.GetLength(); }

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; }
nsresult nsBoxFrame::GetContentOf ( nsIContent **  aContent) [virtual, inherited]

Reimplemented in nsXULScrollFrame.

Definition at line 1948 of file nsBoxFrame.cpp.

{
    // If we don't have a content node find a parent that does.
    nsIFrame *frame = this;
    while (frame) {
      *aContent = frame->GetContent();
      if (*aContent) {
        NS_ADDREF(*aContent);
        return NS_OK;
      }

      frame = frame->GetParent();
    }

    *aContent = nsnull;
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2282 of file nsMenuFrame.cpp.

{
  if (!nsMenuFrame::sDismissalListener)
    return nsnull;

  nsIMenuParent *menuParent = nsMenuFrame::sDismissalListener->GetCurrentMenuParent();
  if (!menuParent)
    return nsnull;

  PRBool isContextMenu;
  menuParent->GetIsContextMenu(isContextMenu);
  if (isContextMenu)
    return menuParent;

  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsBoxFrame::GetCursor ( const nsPoint aPoint,
nsIFrame::Cursor aCursor 
) [virtual, inherited]

Get the cursor for a given frame.

Reimplemented from nsFrame.

Reimplemented in nsSplitterFrame.

Definition at line 1881 of file nsBoxFrame.cpp.

{
  /*
    #ifdef NS_DEBUG
    printf("Get Cursor: ");
                            nsFrame::ListTag(stdout, this);
    printf("\n");
                            
    #endif
 */

#ifdef DEBUG_LAYOUT
    nsPoint newPoint;
    TranslateEventCoords(aPoint, newPoint);
    
    // if we are in debug and we are in the debug area
    // return our own cursor and dump the debug information.
    if (mState & NS_STATE_CURRENTLY_IN_DEBUG) 
    {
          // XXX aCursor is not yet inited??
          nsresult rv = DisplayDebugInfoFor(this, GetPresContext(), newPoint,
              aCursor.mCursor);
          if (rv == NS_OK)
             return rv;
    }
#endif

    nsresult rv = nsContainerFrame::GetCursor(aPoint, aCursor);

    return rv;
}

Here is the call graph for this function:

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

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:

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 * nsMenuFrame::GetFirstChild ( nsIAtom aListName) const [virtual]

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()

Reimplemented from nsContainerFrame.

Definition at line 296 of file nsMenuFrame.cpp.

{
  if (nsLayoutAtoms::popupList == aListName) {
    return mPopupFrames.FirstChild();
  }
  return nsBoxFrame::GetFirstChild(aListName);
}

Here is the call graph for this function:

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

Return the first frame in our current flow.

Reimplemented from nsIFrame.

Definition at line 103 of file nsSplittableFrame.cpp.

{
  nsSplittableFrame* firstInFlow = (nsSplittableFrame*)this;
  while (firstInFlow->mPrevInFlow)  {
    firstInFlow = (nsSplittableFrame*)firstInFlow->mPrevInFlow;
  }
  NS_POSTCONDITION(firstInFlow, "illegal state in flow chain.");
  return firstInFlow;
}

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 nsBoxFrame::GetFlex ( nsBoxLayoutState aBoxLayoutState,
nscoord aFlex 
) [virtual, inherited]

Reimplemented from nsFrame.

Reimplemented in nsGridRowGroupFrame.

Definition at line 1078 of file nsBoxFrame.cpp.

{
  if (!DoesNeedRecalc(mFlex)) {
     aFlex = mFlex;
     return NS_OK;
  }

  nsresult rv = NS_OK;

  mFlex = 0;
  rv = nsBox::GetFlex(aBoxLayoutState, mFlex);
  aFlex = mFlex;

  return rv;
}

Here is the call graph for this function:

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

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.

Reimplemented from nsBoxFrame.

Definition at line 406 of file nsMenuFrame.cpp.

{
  nsresult result = nsBoxFrame::GetFrameForPoint(aPoint, aWhichLayer, aFrame);
  if (NS_FAILED(result) || *aFrame == this) {
    return result;
  }
  nsIContent* content = (*aFrame)->GetContent();
  if (content) {
    // This allows selective overriding for subcontent.
    nsAutoString value;
    content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value);
    if (value.EqualsLiteral("true"))
      return result;
  }
  if (GetStyleVisibility()->IsVisible()) {
    *aFrame = this; // Capture all events so that we can perform selection
    return NS_OK;
  }
  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

nsresult nsBoxFrame::GetFrameForPointChild ( const nsPoint aPoint,
nsFramePaintLayer  aWhichLayer,
nsIFrame aChild,
PRBool  aCheckMouseThrough,
nsIFrame **  aFrame 
) [protected, virtual, inherited]

Reimplemented in nsStackFrame.

Definition at line 1815 of file nsBoxFrame.cpp.

{
  nsIFrame *hit = nsnull;
  nsresult rv =
    aChild->GetFrameForPoint(aPoint, aWhichLayer, &hit);

  if (NS_SUCCEEDED(rv) && hit) {
    rv = NS_ERROR_FAILURE;
    if (!aCheckMouseThrough) {
      *aFrame = hit;
      rv = NS_OK;
    }
    else
    {
      // If we had a lower frame for this point, check whether hit's box has
      // mouse through.  If so, stick with the lower frame that we found.
      PRBool isAdaptor = PR_FALSE;
      nsIBox *box = GetBoxForFrame(hit, isAdaptor);
      if (box) {
        PRBool mouseThrough = PR_FALSE;
        box->GetMouseThrough(mouseThrough);
        // if the child says it can never mouse though ignore it. 
        if (!mouseThrough) {
          *aFrame = hit;
          rv = NS_OK;
        }
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsContainerFrame::GetFrameForPointUsing ( const nsPoint aPoint,
nsIAtom aList,
nsFramePaintLayer  aWhichLayer,
PRBool  aConsiderSelf,
nsIFrame **  aFrame 
) [protected, inherited]

Definition at line 309 of file nsContainerFrame.cpp.

{
  nsIFrame *hit;
  nsPoint tmp;

  PRBool inThisFrame = mRect.Contains(aPoint);

  if (! ((mState & NS_FRAME_OUTSIDE_CHILDREN) || inThisFrame ) ) {
    return NS_ERROR_FAILURE;
  }

  nsIFrame* kid = GetFirstChild(aList);
  *aFrame = nsnull;
  tmp.MoveTo(aPoint.x - mRect.x, aPoint.y - mRect.y);

  nsPoint originOffset;
  nsIView *view = nsnull;
  nsresult rv = GetOriginToViewOffset(originOffset, &view);

  if (NS_SUCCEEDED(rv) && view)
    tmp += originOffset;

  while (kid) {
    if (aWhichLayer == NS_FRAME_PAINT_LAYER_ALL) {
      // Check all layers on this kid before moving on to the next one
      rv = kid->GetFrameForPoint(tmp, NS_FRAME_PAINT_LAYER_FOREGROUND, &hit);
      if (NS_FAILED(rv) || !hit) {
        rv = kid->GetFrameForPoint(tmp, NS_FRAME_PAINT_LAYER_FLOATS, &hit);
        if (NS_FAILED(rv) || !hit) {
          rv = kid->GetFrameForPoint(tmp, NS_FRAME_PAINT_LAYER_BACKGROUND, &hit);
        }
      }
    } else {
      rv = kid->GetFrameForPoint(tmp, aWhichLayer, &hit);
    }

    if (NS_SUCCEEDED(rv) && hit) {
      *aFrame = hit;
    }
    kid = kid->GetNextSibling();
  }

  if (*aFrame) {
    return NS_OK;
  }

  if ( inThisFrame && aConsiderSelf ) {
    if (GetStyleVisibility()->IsVisible()) {
      *aFrame = this;
      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::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 nsBoxFrame::GetHAlign ( Halignment aAlign) [virtual, inherited]

Reimplemented from nsBox.

Definition at line 186 of file nsBoxFrame.cpp.

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

Reimplemented from nsBox.

Definition at line 2756 of file nsBoxFrame.cpp.

{
    nsIBox* child = mFrames.FirstChild();
    PRInt32 count = 0;
    while (child) 
    {       
      if (aBox == child) {
          *aIndex = count;
          return NS_OK;
      }

      child->GetNextBox(&child);
      count++;
    }

    *aIndex = -1;

    return NS_OK;
}

Here is the call graph for this function:

PRBool nsBoxFrame::GetInitialAutoStretch ( PRBool aStretch) [protected, virtual, inherited]

Reimplemented in nsGroupBoxFrame.

Definition at line 652 of file nsBoxFrame.cpp.

{
  nsAutoString value;

  nsCOMPtr<nsIContent> content;
  GetContentOf(getter_AddRefs(content));

  if (!content)
     return PR_FALSE;
  
  // Check the align attribute.
  if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value)) {
    aStretch = value.EqualsLiteral("stretch");
    return PR_TRUE;
  }

  // Check the CSS box-align property.
  const nsStyleXUL* boxInfo = GetStyleXUL();
  aStretch = (boxInfo->mBoxAlign == NS_STYLE_BOX_ALIGN_STRETCH);

  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsBoxFrame::GetInitialDirection ( PRBool aIsNormal) [protected, virtual, inherited]

Definition at line 590 of file nsBoxFrame.cpp.

{
  nsAutoString value;
  nsCOMPtr<nsIContent> content;
  GetContentOf(getter_AddRefs(content));

  if (!content)
    return;

  if (IsHorizontal()) {
    // For horizontal boxes only, we initialize our value based off the CSS 'direction' property.
    // This means that BiDI users will end up with horizontally inverted chrome.
    aIsNormal = (GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_LTR); // If text runs RTL then so do we.
  }
  else
    aIsNormal = PR_TRUE; // Assume a normal direction in the vertical case.

  // Now check the style system to see if we should invert aIsNormal.
  const nsStyleXUL* boxInfo = GetStyleXUL();
  if (boxInfo->mBoxDirection == NS_STYLE_BOX_DIRECTION_REVERSE)
    aIsNormal = !aIsNormal; // Invert our direction.
  
  // Now see if we have an attribute.  The attribute overrides
  // the style system value.
  if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::dir, value)) {
    if (value.EqualsLiteral("reverse"))
      aIsNormal = !aIsNormal; // Invert our direction.
    else if (value.EqualsLiteral("ltr"))
      aIsNormal = PR_TRUE;
    else if (value.EqualsLiteral("rtl"))
      aIsNormal = PR_FALSE;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsBoxFrame::GetInitialEqualSize ( PRBool aEqualSize) [protected, virtual, inherited]

Definition at line 627 of file nsBoxFrame.cpp.

{
 // see if we are a vertical or horizontal box.
  nsAutoString value;

  nsCOMPtr<nsIContent> content;
  GetContentOf(getter_AddRefs(content));

  if (!content)
     return PR_FALSE;

  if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::equalsize, value))
  {
      if (value.EqualsLiteral("always")) {
         aEqualSize = PR_TRUE;
         return PR_TRUE;
      }
  } 

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsBoxFrame::GetInitialHAlignment ( nsBoxFrame::Halignment aHalign) [protected, virtual, inherited]

Reimplemented in nsGroupBoxFrame.

Definition at line 384 of file nsBoxFrame.cpp.

{
  nsAutoString value;

  nsCOMPtr<nsIContent> content;
  GetContentOf(getter_AddRefs(content));
  if (!content)
    return PR_FALSE;

  if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value)) {
    // XXXdwh Everything inside this if statement is deprecated code.
    if (value.EqualsLiteral("left")) {
        aHalign = nsBoxFrame::hAlign_Left;
        return PR_TRUE;
    } else if (value.EqualsLiteral("right")) {
        aHalign = nsBoxFrame::hAlign_Right;
        return PR_TRUE;
    }
  }
      
  // Now that the deprecated stuff is out of the way, we move on to check the appropriate 
  // attribute.  For horizontal boxes, we are checking the PACK attribute.  For vertical boxes
  // we are checking the ALIGN attribute.
  nsresult res;
  if (IsHorizontal())
    res = content->GetAttr(kNameSpaceID_None, nsXULAtoms::pack, value);
  else res = content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value);
  if (res == NS_CONTENT_ATTR_HAS_VALUE) {
    if (value.EqualsLiteral("start")) {
        aHalign = nsBoxFrame::hAlign_Left;
        return PR_TRUE;
    } else if (value.EqualsLiteral("center")) {
        aHalign = nsBoxFrame::hAlign_Center;
        return PR_TRUE;
    } else if (value.EqualsLiteral("end")) {
        aHalign = nsBoxFrame::hAlign_Right;
        return PR_TRUE;
    }

    // The attr was present but had a nonsensical value. Revert to the default.
    return PR_FALSE;
  }

  // Now that we've checked for the attribute it's time to check CSS.  For 
  // horizontal boxes we're checking PACK.  For vertical boxes we are checking
  // ALIGN.
  const nsStyleXUL* boxInfo = GetStyleXUL();
  if (IsHorizontal()) {
    switch (boxInfo->mBoxPack) {
      case NS_STYLE_BOX_PACK_START:
        aHalign = nsBoxFrame::hAlign_Left;
        return PR_TRUE;
      case NS_STYLE_BOX_PACK_CENTER:
        aHalign = nsBoxFrame::hAlign_Center;
        return PR_TRUE;
      case NS_STYLE_BOX_PACK_END:
        aHalign = nsBoxFrame::hAlign_Right;
        return PR_TRUE;
      default: // Nonsensical value. Just bail.
        return PR_FALSE;
    }
  }
  else {
    switch (boxInfo->mBoxAlign) {
      case NS_STYLE_BOX_ALIGN_START:
        aHalign = nsBoxFrame::hAlign_Left;
        return PR_TRUE;
      case NS_STYLE_BOX_ALIGN_CENTER:
        aHalign = nsBoxFrame::hAlign_Center;
        return PR_TRUE;
      case NS_STYLE_BOX_ALIGN_END:
        aHalign = nsBoxFrame::hAlign_Right;
        return PR_TRUE;
      default: // Nonsensical value. Just bail.
        return PR_FALSE;
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsBoxFrame::GetInitialOrientation ( PRBool aIsHorizontal) [protected, virtual, inherited]

Reimplemented in nsSplitterFrame, and nsGroupBoxFrame.

Definition at line 561 of file nsBoxFrame.cpp.

{
 // see if we are a vertical or horizontal box.
  nsAutoString value;

  nsCOMPtr<nsIContent> content;
  GetContentOf(getter_AddRefs(content));

  if (!content)
    return;

  // Check the style system first.
  const nsStyleXUL* boxInfo = GetStyleXUL();
  if (boxInfo->mBoxOrient == NS_STYLE_BOX_ORIENT_HORIZONTAL)
    aIsHorizontal = PR_TRUE;
  else 
    aIsHorizontal = PR_FALSE;

  // Now see if we have an attribute.  The attribute overrides
  // the style system value.
  if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::orient, value)) {
    if (value.EqualsLiteral("vertical"))
      aIsHorizontal = PR_FALSE;
    else if (value.EqualsLiteral("horizontal"))
     aIsHorizontal = PR_TRUE;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsBoxFrame::GetInitialVAlignment ( Valignment aValign) [protected, virtual, inherited]

Definition at line 466 of file nsBoxFrame.cpp.

{

  nsAutoString value;

  nsCOMPtr<nsIContent> content;
  GetContentOf(getter_AddRefs(content));
  if (!content)
    return PR_FALSE;

  if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::valign, value)) {
    if (value.EqualsLiteral("top")) {
        aValign = nsBoxFrame::vAlign_Top;
        return PR_TRUE;
    } else if (value.EqualsLiteral("baseline")) {
        aValign = nsBoxFrame::vAlign_BaseLine;
        return PR_TRUE;
    } else if (value.EqualsLiteral("middle")) {
        aValign = nsBoxFrame::vAlign_Middle;
        return PR_TRUE;
    } else if (value.EqualsLiteral("bottom")) {
        aValign = nsBoxFrame::vAlign_Bottom;
        return PR_TRUE;
    }
  }

  // Now that the deprecated stuff is out of the way, we move on to check the appropriate 
  // attribute.  For horizontal boxes, we are checking the ALIGN attribute.  For vertical boxes
  // we are checking the PACK attribute.
  nsresult res;
  if (IsHorizontal())
    res = content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value);
  else res = content->GetAttr(kNameSpaceID_None, nsXULAtoms::pack, value);
  if (res == NS_CONTENT_ATTR_HAS_VALUE) {
    if (value.EqualsLiteral("start")) {
        aValign = nsBoxFrame::vAlign_Top;
        return PR_TRUE;
    } else if (value.EqualsLiteral("center")) {
        aValign = nsBoxFrame::vAlign_Middle;
        return PR_TRUE;
    } else if (value.EqualsLiteral("baseline")) {
        aValign = nsBoxFrame::vAlign_BaseLine;
        return PR_TRUE;
    } else if (value.EqualsLiteral("end")) {
        aValign = nsBoxFrame::vAlign_Bottom;
        return PR_TRUE;
    }
    // The attr was present but had a nonsensical value. Revert to the default.
    return PR_FALSE;
  }

  // Now that we've checked for the attribute it's time to check CSS.  For 
  // horizontal boxes we're checking ALIGN.  For vertical boxes we are checking
  // PACK.
  const nsStyleXUL* boxInfo = GetStyleXUL();
  if (IsHorizontal()) {
    switch (boxInfo->mBoxAlign) {
      case NS_STYLE_BOX_ALIGN_START:
        aValign = nsBoxFrame::vAlign_Top;
        return PR_TRUE;
      case NS_STYLE_BOX_ALIGN_CENTER:
        aValign = nsBoxFrame::vAlign_Middle;
        return PR_TRUE;
      case NS_STYLE_BOX_ALIGN_BASELINE:
        aValign = nsBoxFrame::vAlign_BaseLine;
        return PR_TRUE;
      case NS_STYLE_BOX_ALIGN_END:
        aValign = nsBoxFrame::vAlign_Bottom;
        return PR_TRUE;
      default: // Nonsensical value. Just bail.
        return PR_FALSE;
    }
  }
  else {
    switch (boxInfo->mBoxPack) {
      case NS_STYLE_BOX_PACK_START:
        aValign = nsBoxFrame::vAlign_Top;
        return PR_TRUE;
      case NS_STYLE_BOX_PACK_CENTER:
        aValign = nsBoxFrame::vAlign_Middle;
        return PR_TRUE;
      case NS_STYLE_BOX_PACK_END:
        aValign = nsBoxFrame::vAlign_Bottom;
        return PR_TRUE;
      default: // Nonsensical value. Just bail.
        return PR_FALSE;
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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

Return the last frame in our current flow.

Reimplemented from nsIFrame.

Definition at line 113 of file nsSplittableFrame.cpp.

{
  nsSplittableFrame* lastInFlow = (nsSplittableFrame*)this;
  while (lastInFlow->mNextInFlow)  {
    lastInFlow = (nsSplittableFrame*)lastInFlow->mNextInFlow;
  }
  NS_POSTCONDITION(lastInFlow, "illegal state in flow chain.");
  return lastInFlow;
}
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 nsBoxFrame::GetLayoutManager ( nsIBoxLayout **  aLayout) [virtual, inherited]

Reimplemented from nsBox.

Definition at line 2670 of file nsBoxFrame.cpp.

{
  *aLayout = mLayoutManager;
  NS_IF_ADDREF(*aLayout);
  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:

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

Reimplemented from nsFrame.

Reimplemented in nsXULScrollFrame, nsSliderFrame, and nsTextControlFrame.

Definition at line 1038 of file nsBoxFrame.cpp.

{
  if (!DoesNeedRecalc(mMaxSize)) {
     aSize = mMaxSize;
     return NS_OK;
  }

#ifdef DEBUG_LAYOUT
  PropagateDebug(aBoxLayoutState);
#endif

  nsresult rv = NS_OK;

  aSize.SizeTo(NS_INTRINSICSIZE, NS_INTRINSICSIZE);

  PRBool collapsed = PR_FALSE;
  IsCollapsed(aBoxLayoutState, collapsed);
  if (collapsed)
    return NS_OK;

  // if the size was not completely redefined in CSS then ask our children
  if (!nsIBox::AddCSSMaxSize(aBoxLayoutState, this, aSize))
  {
    aSize.width = NS_INTRINSICSIZE;
    aSize.height = NS_INTRINSICSIZE;

    if (mLayoutManager) {
      rv = mLayoutManager->GetMaxSize(this, aBoxLayoutState, aSize);
      nsIBox::AddCSSMaxSize(aBoxLayoutState, this, aSize);
    } else {
      rv = nsBox::GetMaxSize(aBoxLayoutState, aSize);
    }
  }

  mMaxSize = aSize;

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual nsIFrame* nsMenuFrame::GetMenuChild ( ) [inline, virtual]

Implements nsIMenuFrame.

Definition at line 182 of file nsMenuFrame.h.

{ return mPopupFrames.FirstChild(); }

Here is the call graph for this function:

Definition at line 1081 of file nsMenuFrame.cpp.

{
  if (!mContent)
  {
    *aResult = nsnull;
    return;
  }
  
  nsresult rv;
  nsCOMPtr<nsIXBLService> xblService = 
           do_GetService("@mozilla.org/xbl;1", &rv);
  PRInt32 dummy;
  PRUint32 count = mContent->GetChildCount();

  for (PRUint32 i = 0; i < count; i++) {
    nsIContent *child = mContent->GetChildAt(i);
    nsCOMPtr<nsIAtom> tag;
    xblService->ResolveTag(child, &dummy, getter_AddRefs(tag));
    if (tag == nsXULAtoms::menupopup) {
      *aResult = child;
      NS_ADDREF(*aResult);
      return;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual nsIMenuParent* nsMenuFrame::GetMenuParent ( ) [inline, virtual]

Implements nsIMenuFrame.

Definition at line 181 of file nsMenuFrame.h.

{ return mMenuParent; };
NS_IMETHOD nsMenuFrame::GetMenuType ( nsMenuType aType) [inline, virtual]

Implements nsIMenuFrame.

Definition at line 184 of file nsMenuFrame.h.

{ aType = mType; return NS_OK; };
NS_IMETHODIMP nsMenuFrame::GetMinSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aSize 
) [virtual]

Reimplemented from nsBoxFrame.

Definition at line 1124 of file nsMenuFrame.cpp.

{
  nsresult rv = nsBoxFrame::GetMinSize(aBoxLayoutState, aSize);

  if (IsSizedToPopup(mContent, PR_TRUE))
    SizeToPopup(aBoxLayoutState, aSize);

  return rv;
}

Here is the call graph for this function:

Here is the caller 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 nsBoxFrame::GetMouseThrough ( PRBool aMouseThrough) [virtual, inherited]

Reimplemented from nsBox.

Reimplemented in nsTitleBarFrame, and nsButtonBoxFrame.

Definition at line 273 of file nsBoxFrame.cpp.

{
  switch(mMouseThrough)
  {
    case always:
      aMouseThrough = PR_TRUE;
      return NS_OK;
    case never:
      aMouseThrough = PR_FALSE;      
      return NS_OK;
    case unset:
    {
      if (mParent && mParent->IsBoxFrame())
        return mParent->GetMouseThrough(aMouseThrough);
      else {
        aMouseThrough = PR_FALSE;      
        return NS_OK;
      }
    }
  }

  return NS_ERROR_FAILURE;
}

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 * nsSplittableFrame::GetNextInFlow ( ) const [virtual, inherited]

Reimplemented from nsFrame.

Definition at line 92 of file nsSplittableFrame.cpp.

{
  return mNextInFlow;
}

Here is the caller graph for this function: