Back to index

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

#include <nsTextControlFrame.h>

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

 nsTextControlFrame (nsIPresShell *aShell)
virtual ~nsTextControlFrame ()
virtual void RemovedAsPrimaryFrame (nsPresContext *aPresContext)
NS_IMETHOD Destroy (nsPresContext *aPresContext)
 Destroys this frame and each of its child frames (recursively calls Destroy() for each child)
NS_IMETHOD Reflow (nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
 The frame is given a maximum size and asked for its desired size.
NS_IMETHOD Paint (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
 Paint is responsible for painting the frame.
NS_IMETHOD GetFrameForPoint (const nsPoint &aPoint, nsFramePaintLayer aWhichLayer, nsIFrame **aFrame)
 Get the frame that should receive events for a given point in the coordinate space of this frame's parent, if the frame is painted in the given paint layer.
NS_IMETHOD HandleEvent (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
 Event handling of GUI events.
NS_IMETHOD GetPrefSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetMinSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetMaxSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aSize)
NS_IMETHOD GetAscent (nsBoxLayoutState &aBoxLayoutState, nscoord &aAscent)
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.
NS_IMETHOD CreateAnonymousContent (nsPresContext *aPresContext, nsISupportsArray &aChildList)
NS_IMETHOD CreateFrameFor (nsPresContext *aPresContext, nsIContent *aContent, nsIFrame **aFrame)
virtual void PostCreateFrames ()
nsresult SetValue (const nsAString &aValue)
NS_IMETHOD SetInitialChildList (nsPresContext *aPresContext, nsIAtom *aListName, nsIFrame *aChildList)
 Called to set the initial list of frames.
 NS_IMETHOD_ (PRInt32) GetFormControlType() const
NS_IMETHOD GetName (nsAString *aName)
virtual void SetFocus (PRBool aOn, PRBool aRepaint)
virtual void ScrollIntoView (nsPresContext *aPresContext)
virtual nscoord GetVerticalInsidePadding (nsPresContext *aPresContext, float aPixToTwip, nscoord aInnerHeight) const
virtual nscoord GetHorizontalInsidePadding (nsPresContext *aPresContext, float aPixToTwip, nscoord aInnerWidth, nscoord aCharWidth) const
NS_IMETHOD SetSuggestedSize (nscoord aWidth, nscoord aHeight)
 Set the suggested size for the form element.
NS_IMETHOD GetFormContent (nsIContent *&aContent) const
 Get the content object associated with this frame.
NS_IMETHOD SetProperty (nsPresContext *aPresContext, nsIAtom *aName, const nsAString &aValue)
 Set a property on the form control frame.
NS_IMETHOD GetProperty (nsIAtom *aName, nsAString &aValue)
 Get a property from the form control frame.
NS_IMETHOD OnContentReset ()
 Notification that the content has been reset.
NS_IMETHOD GetEditor (nsIEditor **aEditor)
NS_IMETHOD OwnsValue (PRBool *aOwnsValue)
 Tell whether the frame currently owns the value or the content does (for edge cases where the frame has just been created or is just going away).
NS_IMETHOD GetValue (nsAString &aValue, PRBool aIgnoreWrap)
 Get the current value, either from the editor or from the textarea.
NS_IMETHOD GetTextLength (PRInt32 *aTextLength)
NS_IMETHOD CheckFireOnChange ()
 Fire onChange if the value has changed since it was focused or since it was last fired.
NS_IMETHOD SetSelectionStart (PRInt32 aSelectionStart)
NS_IMETHOD SetSelectionEnd (PRInt32 aSelectionEnd)
NS_IMETHOD SetSelectionRange (PRInt32 aSelectionStart, PRInt32 aSelectionEnd)
NS_IMETHOD GetSelectionRange (PRInt32 *aSelectionStart, PRInt32 *aSelectionEnd)
NS_IMETHOD GetSelectionContr (nsISelectionController **aSelCon)
virtual NS_DECL_NSIPHONETIC
nsIAtom
GetType () const
 Get the "type" of the frame.
NS_IMETHOD AttributeChanged (nsIContent *aChild, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)
 handler for attribute changes to mContent
NS_IMETHOD GetText (nsString *aText)
void FireOnInput ()
PRBool IsSingleLineTextControl () const
 Find out whether this is a single line text control.
PRBool IsTextArea () const
 Find out whether this control is a textarea.
PRBool IsPlainTextControl () const
 Find out whether this control edits plain text.
PRBool IsPasswordTextControl () const
 Find out whether this is a password control (input type=password)
void SetValueChanged (PRBool aValueChanged)
nsresult InitFocusedValue ()
 Called when the frame is focused, to remember the value for onChange.
nsresult DOMPointToOffset (nsIDOMNode *aNode, PRInt32 aNodeOffset, PRInt32 *aResult)
nsresult OffsetToDOMPoint (PRInt32 aOffset, nsIDOMNode **aResult, PRInt32 *aPosition)
void SetHasFocus (PRBool aHasFocus)
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)
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 GetFlex (nsBoxLayoutState &aBoxLayoutState, nscoord &aFlex)
NS_IMETHOD GetVAlign (Valignment &aAlign)
NS_IMETHOD GetVAlign (Valignment &aAlign)
NS_IMETHOD GetHAlign (Halignment &aAlign)
NS_IMETHOD NeedsRecalc ()
NS_IMETHOD DoLayout (nsBoxLayoutState &aBoxLayoutState)
 If subclassing please subclass this method not layout.
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 Init (nsPresContext *aPresContext, nsIContent *aContent, nsIFrame *aParent, nsStyleContext *aContext, nsIFrame *asPrevInFlow)
 Initialize us.
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 DidReflow (nsPresContext *aPresContext, const nsHTMLReflowState *aReflowState, nsDidReflowStatus aStatus)
 Post-reflow hook.
virtual nsresult GetContentOf (nsIContent **aContent)
nsIBox * GetBoxAt (PRInt32 aIndex)
PRInt32 GetChildCount ()
void FireDOMEventSynch (const nsAString &aDOMEventName, nsIContent *aContent=nsnull)
 NS_HIDDEN_ (nsresult) SyncLayout(nsBoxLayoutState &aBoxLayoutState)
 NS_HIDDEN_ (void *) GetProperty(nsIAtom *aPropertyName
 NS_HIDDEN_ (nsresult) DeleteProperty(nsIAtom *aPropertyName) const
virtual nsIFrameGetFirstChild (nsIAtom *aListName) const
 Get the first child frame from the specified child list.
virtual nsIAtomGetAdditionalChildListName (PRInt32 aIndex) const
 Used to iterate the list of additional child list names.
NS_IMETHOD ReplaceFrame (nsIAtom *aListName, nsIFrame *aOldFrame, nsIFrame *aNewFrame)
 This method is responsible for replacing the old frame with the new frame.
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 SetParent (const nsIFrame *aParent)
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 MarkChildrenStyleChange ()
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
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 NS_HIDDEN_ (void) ShutDown()
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)
readonly attribute DOMString phonetic
 phonetic get the phonetic value of the input text

Protected Types

enum  eMouseThrough { unset, never, always }

Protected Member Functions

PRBool IsScrollable () const
 Find out whether this control is scrollable (i.e.
nsresult InitEditor ()
 Initialize mEditor with the proper flags and the default value.
void RemoveNewlines (nsString &aString)
 Strip all
, and nulls from the given string.
nsresult GetMaxLength (PRInt32 *aMaxLength)
 Get the maxlength attribute.
PRBool AttributeExists (nsIAtom *aAtt) const
 Find out whether an attribute exists on the content or not.
void PreDestroy (nsPresContext *aPresContext)
 We call this when we are being destroyed or removed from the PFM.
nsresult FireOnChange ()
 Fire the onChange event.
nsresult GetSizeFromContent (PRInt32 *aSize) const
PRInt32 GetCols ()
 Get the cols attribute (if textarea) or a default.
PRInt32 GetRows ()
 Get the rows attribute (if textarea) or a default.
nsresult ReflowStandard (nsPresContext *aPresContext, nsSize &aDesiredSize, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
nsresult CalculateSizeStandard (nsPresContext *aPresContext, const nsHTMLReflowState &aReflowState, nsSize &aDesiredSize, nsSize &aMinSize)
PRInt32 GetWidthInCharacters () const
virtual nsIScrollableViewGetScrollableView ()
virtual nsresult GetFrameForPointChild (const nsPoint &aPoint, nsFramePaintLayer aWhichLayer, nsIFrame *aChild, PRBool aCheckMouseThrough, nsIFrame **aFrame)
virtual PRBool HasStyleChange ()
virtual void SetStyleChangeFlag (PRBool aDirty)
virtual PRBool GetWasCollapsed (nsBoxLayoutState &aState)
virtual void SetWasCollapsed (nsBoxLayoutState &aState, PRBool aWas)
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)
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)
virtual PRBool GetDefaultFlex (PRInt32 &aFlex)
virtual void GetLayoutFlags (PRUint32 &aFlags)

Static Protected Member Functions

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

Protected Attributes

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 PRBool gGotTheme = PR_FALSE
static nsIThemegTheme = nsnull

Private Member Functions

nsresult SetSelectionInternal (nsIDOMNode *aStartNode, PRInt32 aStartOffset, nsIDOMNode *aEndNode, PRInt32 aEndOffset)
nsresult SelectAllContents ()
nsresult SetSelectionEndPoints (PRInt32 aSelStart, PRInt32 aSelEnd)

Private Attributes

nsCOMPtr< nsIEditormEditor
nsCOMPtr< nsISelectionControllermSelCon
nscoord mSuggestedWidth
nscoord mSuggestedHeight
nsSize mSize
PRPackedBool mUseEditor
PRPackedBool mIsProcessing
PRPackedBool mNotifyOnInput
PRPackedBool mDidPreDestroy
PRPackedBool mHasFocus
nsTextInputSelectionImplmTextSelImpl
nsTextInputListenermTextListener
nsIScrollableViewmScrollableView
nsString mFocusedValue

Friends

nsresult NS_NewStackFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame, nsIBoxLayout *aLayout=nsnull)
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

Definition at line 67 of file nsTextControlFrame.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

Definition at line 1307 of file nsTextControlFrame.cpp.

{
  //delete mTextListener;
  //delete mTextSelImpl; dont delete this since mSelCon will release it.
}

Member Function Documentation

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

Definition at line 1203 of file nsBox.cpp.

{
  AddBorderAndPadding(this, aSize);
}

Here is the caller graph for this function:

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

Definition at line 1215 of file nsBox.cpp.

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

Here is the call graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Definition at line 124 of file nsBox.h.

{ AddInset(this, aSize); }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 131 of file nsBox.h.

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

Definition at line 1209 of file nsBox.cpp.

{
  AddMargin(this, aSize);
}

Here is the caller graph for this function:

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

Definition at line 1223 of file nsBox.cpp.

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

Here is the call graph for this function:

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

Definition at line 1231 of file nsBox.cpp.

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

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

Update the current frame-state value for this frame.

Definition at line 823 of file nsIFrame.h.

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

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

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

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

Reimplemented from nsFrame.

Reimplemented in nsXULScrollFrame, nsMenuFrame, nsSliderFrame, and nsRootBoxFrame.

Definition at line 1215 of file nsBoxFrame.cpp.

{
   NS_PRECONDITION(!aListName, "We don't support out-of-flow kids");
   nsBoxLayoutState state(GetPresContext());

   // append the new frames
   mFrames.AppendFrames(this, aFrameList);

   // notify the layout manager
   if (mLayoutManager)
     mLayoutManager->ChildrenAppended(this, state, aFrameList);

#ifdef DEBUG_LAYOUT
   // if we are in debug make sure our children are in debug as well.
   if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
       SetDebugOnChildList(state, mFrames.FirstChild(), PR_TRUE);
#endif

   MarkDirtyChildren(state);
   MarkDirty(state);
   return NS_OK;
}

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 nsTextControlFrame::AttributeChanged ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [virtual]

handler for attribute changes to mContent

Reimplemented from nsBoxFrame.

Definition at line 2801 of file nsTextControlFrame.cpp.

{
  if (!mEditor || !mSelCon) {return NS_ERROR_NOT_INITIALIZED;}
  nsresult rv = NS_OK;

  if (nsHTMLAtoms::maxlength == aAttribute) 
  {
    PRInt32 maxLength;
    rv = GetMaxLength(&maxLength);
    
    nsCOMPtr<nsIPlaintextEditor> textEditor = do_QueryInterface(mEditor);
    if (textEditor)
    {
      if (NS_CONTENT_ATTR_NOT_THERE != rv) 
      {  // set the maxLength attribute
          textEditor->SetMaxTextLength(maxLength);
        // if maxLength>docLength, we need to truncate the doc content
      }
      else { // unset the maxLength attribute
          textEditor->SetMaxTextLength(-1);
      }
    }
    rv = NS_OK; // don't propagate the error
  } 
  else if (mEditor && nsHTMLAtoms::readonly == aAttribute) 
  {
    PRUint32 flags;
    mEditor->GetFlags(&flags);
    if (AttributeExists(nsHTMLAtoms::readonly))
    { // set readonly
      flags |= nsIPlaintextEditor::eEditorReadonlyMask;
      if (mSelCon && IsFocusedContent(GetPresContext(), mContent))
        mSelCon->SetCaretEnabled(PR_FALSE);
    }
    else 
    { // unset readonly
      flags &= ~(nsIPlaintextEditor::eEditorReadonlyMask);
      if (mSelCon && !(flags & nsIPlaintextEditor::eEditorDisabledMask) &&
          IsFocusedContent(GetPresContext(), mContent))
        mSelCon->SetCaretEnabled(PR_TRUE);
    }    
    mEditor->SetFlags(flags);
  }
  else if (mEditor && nsHTMLAtoms::disabled == aAttribute) 
  {
    // XXXbryner do we need to check for a null presshell here?
    //           we don't do anything with it.
    nsIPresShell *shell = GetPresContext()->GetPresShell();
    if (!shell)
      return NS_ERROR_FAILURE;

    PRUint32 flags;
    mEditor->GetFlags(&flags);
    if (AttributeExists(nsHTMLAtoms::disabled))
    { // set disabled
      flags |= nsIPlaintextEditor::eEditorDisabledMask;
      if (mSelCon)
      {
        mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_OFF);
        if (IsFocusedContent(GetPresContext(), mContent))
          mSelCon->SetCaretEnabled(PR_FALSE);
      }
    }
    else 
    { // unset disabled
      flags &= ~(nsIPlaintextEditor::eEditorDisabledMask);
      if (mSelCon)
      {
        mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_HIDDEN);
      }
    }    
    mEditor->SetFlags(flags);
  }
  // Allow the base class to handle common attributes supported
  // by all form elements... 
  else {
    rv = nsBoxFrame::AttributeChanged(aChild, aNameSpaceID, aAttribute, aModType);
  }

  return rv;
}

Here is the call graph for this function:

PRBool nsTextControlFrame::AttributeExists ( nsIAtom aAtt) const [inline, protected]

Find out whether an attribute exists on the content or not.

Parameters:
aAttthe attribute to determine the existence of
Returns:
PR_FALSE if it does not exist

Definition at line 256 of file nsTextControlFrame.h.

  { return mContent && mContent->HasAttr(kNameSpaceID_None, aAtt); }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1275 of file nsBox.cpp.

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

Here is the caller graph for this function:

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

Definition at line 1251 of file nsBox.cpp.

{
   if (aMax < aMin)
       aMax = aMin;

   if (aPref > aMax)
       aPref = aMax;

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

Definition at line 1264 of file nsBox.cpp.

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

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

Here is the caller graph for this function:

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

Definition at line 5770 of file nsFrame.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 144 of file nsSplittableFrame.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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:

nsresult nsTextControlFrame::CalculateSizeStandard ( nsPresContext aPresContext,
const nsHTMLReflowState aReflowState,
nsSize aDesiredSize,
nsSize aMinSize 
) [protected]

Definition at line 1592 of file nsTextControlFrame.cpp.

{
  aDesiredSize.width  = CSS_NOTSET;
  aDesiredSize.height = CSS_NOTSET;

  // Get leading and the Average/MaxAdvance char width 
  nscoord lineHeight  = 0;
  nscoord charWidth   = 0;
  nscoord charMaxAdvance  = 0;

  nsCOMPtr<nsIFontMetrics> fontMet;
  nsresult rv = nsFormControlHelper::GetFrameFontFM(this, getter_AddRefs(fontMet));
  NS_ENSURE_SUCCESS(rv, rv);
  nsIRenderingContext* rendContext = aReflowState.rendContext;
  rendContext->SetFont(fontMet);
  lineHeight = aReflowState.CalcLineHeight(aPresContext, rendContext, this);
  fontMet->GetAveCharWidth(charWidth);
  fontMet->GetMaxAdvance(charMaxAdvance);

  // Set the width equal to the width in characters
  PRInt32 cols = GetCols();
  aDesiredSize.width = cols * charWidth;

  // To better match IE, take the maximum character width(in twips) and remove
  // 4 pixels add this on as additional padding(internalPadding). But only do
  // this if charMaxAdvance != charWidth; if they are equal, this is almost
  // certainly a fixed-width font.
  if (charWidth != charMaxAdvance) {
    float p2t;
    p2t = aPresContext->PixelsToTwips();
    nscoord internalPadding = PR_MAX(charMaxAdvance - NSToCoordRound(4 * p2t), 0);
    // round to a multiple of p2t
    nscoord t = NSToCoordRound(p2t); 
    nscoord rest = internalPadding % t; 
    if (rest < t - rest) {
      internalPadding -= rest;
    } else {
      internalPadding += t - rest;
    }
    // Now add the extra padding on (so that small input sizes work well)
    aDesiredSize.width += internalPadding;
  } else {
    // This is to account for the anonymous <br> having a 1 twip width
    // in Full Standards mode, see BRFrame::Reflow and bug 228752.
    if (aPresContext->CompatibilityMode() == eCompatibility_FullStandards) {
      aDesiredSize.width += 1;
    }
  }

  // Increment width with cols * letter-spacing.
  {
    const nsStyleCoord& lsCoord = GetStyleText()->mLetterSpacing;
    if (eStyleUnit_Coord == lsCoord.GetUnit()) {
      nscoord letterSpacing = lsCoord.GetCoordValue();
      if (letterSpacing != 0) {
        aDesiredSize.width += cols * letterSpacing;
      }
    }
  }

  // Set the height equal to total number of rows (times the height of each
  // line, of course)
  aDesiredSize.height = lineHeight * GetRows();

  // Set minimum size equal to desired size.  We are form controls.  We are Gods
  // among elements.  We do not yield for anybody, not even a table cell.  None
  // shall pass.
  aMinSize.width  = aDesiredSize.width;
  aMinSize.height = aDesiredSize.height;

  return NS_OK;
}

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

Fire onChange if the value has changed since it was focused or since it was last fired.

Implements nsITextControlFrame.

Definition at line 2987 of file nsTextControlFrame.cpp.

{
  nsString value;
  GetText(&value);
  if (!mFocusedValue.Equals(value))//different fire onchange
  {
    mFocusedValue = value;
    FireOnChange();
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements nsIAnonymousContentCreator.

Definition at line 1778 of file nsTextControlFrame.cpp.

{
  // Get the PresShell

  mState |= NS_FRAME_INDEPENDENT_SELECTION;

  nsIPresShell *shell = aPresContext->GetPresShell();

  if (!shell)
    return NS_ERROR_FAILURE;

  // Get the DOM document

  nsIDocument *doc = shell->GetDocument();
  if (!doc)
    return NS_ERROR_FAILURE;

  nsresult rv;
  nsCOMPtr<nsIDOMDocument> domdoc = do_QueryInterface(doc, &rv);
  if (NS_FAILED(rv))
    return rv;
  if (!domdoc)
    return NS_ERROR_FAILURE;
  
  // Now create a DIV and add it to the anonymous content child list.
  nsCOMPtr<nsINodeInfo> nodeInfo;
  rv = doc->NodeInfoManager()->GetNodeInfo(nsHTMLAtoms::div, nsnull,
                                           kNameSpaceID_XHTML,
                                           getter_AddRefs(nodeInfo));

  if (NS_FAILED(rv))
    return rv;

  if (!nodeInfo)
    return NS_ERROR_FAILURE;

  nsCOMPtr<nsIContent> divContent;
  rv = NS_NewHTMLElement(getter_AddRefs(divContent), nodeInfo);

  if (NS_FAILED(rv))
    return rv;

  if (!divContent)
    return NS_ERROR_FAILURE;

  // Set the div native anonymous, so CSS will be its style language
  // no matter what.
  divContent->SetNativeAnonymous(PR_TRUE);

  // Set the necessary style attributes on the text control.

  rv = divContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::kClass,
                           NS_LITERAL_STRING("anonymous-div"), PR_FALSE);

  if (!IsSingleLineTextControl()) {
    // We can't just inherit the overflow because setting visible overflow will
    // crash when the number of lines exceeds the height of the textarea and
    // setting -moz-hidden-unscrollable overflow (NS_STYLE_OVERFLOW_CLIP)
    // doesn't paint the caret for some reason.
    const nsStyleDisplay* disp = GetStyleDisplay();
    if (disp->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE &&
        disp->mOverflowX != NS_STYLE_OVERFLOW_CLIP) {
      rv = divContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::style,
                               NS_LITERAL_STRING("overflow: inherit;"),
                               PR_FALSE);
    }
  }

  if (NS_FAILED(rv))
    return rv;

  // rv = divContent->SetAttr(kNameSpaceID_None,nsXULAtoms::debug, NS_LITERAL_STRING("true"), PR_FALSE);
  rv = aChildList.AppendElement(divContent);

  if (NS_FAILED(rv))
    return rv;

  // Create an editor

  mEditor = do_CreateInstance(kTextEditorCID, &rv);
  if (NS_FAILED(rv))
    return rv;
  if (!mEditor) 
    return NS_ERROR_OUT_OF_MEMORY;

  // Create selection

  nsCOMPtr<nsIFrameSelection> frameSel = do_CreateInstance(kFrameSelectionCID, &rv);

  // Create a SelectionController

  mTextSelImpl = new nsTextInputSelectionImpl(frameSel,shell,divContent);
  if (!mTextSelImpl)
    return NS_ERROR_OUT_OF_MEMORY;
  mTextListener = new nsTextInputListener();
  if (!mTextListener)
    return NS_ERROR_OUT_OF_MEMORY;
  mTextListener->SetFrame(this);
  mSelCon =  do_QueryInterface((nsISupports *)(nsISelectionController *)mTextSelImpl);//this will addref it once
  if (!mSelCon)
    return NS_ERROR_NO_INTERFACE;
  mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);

  // Setup the editor flags

  PRUint32 editorFlags = 0;
  if (IsPlainTextControl())
    editorFlags |= nsIPlaintextEditor::eEditorPlaintextMask;
  if (IsSingleLineTextControl())
    editorFlags |= nsIPlaintextEditor::eEditorSingleLineMask;
  if (IsPasswordTextControl())
    editorFlags |= nsIPlaintextEditor::eEditorPasswordMask;

  // All gfxtextcontrolframe2's are widgets
  editorFlags |= nsIPlaintextEditor::eEditorWidgetMask;

  // Use async reflow and painting for text widgets to improve
  // performance.

  // XXX: Using editor async updates exposes bugs 158782, 151882,
  //      and 165130, so we're disabling it for now, until they
  //      can be addressed.
  // editorFlags |= nsIPlaintextEditor::eEditorUseAsyncUpdatesMask;

  // Now initialize the editor.
  //
  // NOTE: Conversion of '\n' to <BR> happens inside the
  //       editor's Init() call.

  rv = mEditor->Init(domdoc, shell, divContent, mSelCon, editorFlags);

  if (NS_FAILED(rv))
    return rv;

  // Initialize the controller for the editor

  if (!SuppressEventHandlers(aPresContext))
  {
    nsCOMPtr<nsIControllers> controllers;
    nsCOMPtr<nsIDOMNSHTMLInputElement> inputElement = do_QueryInterface(mContent);
    if (inputElement)
      rv = inputElement->GetControllers(getter_AddRefs(controllers));
    else
    {
      nsCOMPtr<nsIDOMNSHTMLTextAreaElement> textAreaElement = do_QueryInterface(mContent);

      if (!textAreaElement)
        return NS_ERROR_FAILURE;

      rv = textAreaElement->GetControllers(getter_AddRefs(controllers));
    }

    if (NS_FAILED(rv))
      return rv;

    if (controllers)
    {
      PRUint32 numControllers;
      PRBool found = PR_FALSE;
      rv = controllers->GetControllerCount(&numControllers);
      for (PRUint32 i = 0; i < numControllers; i ++)
      {
        nsCOMPtr<nsIController> controller;
        rv = controllers->GetControllerAt(i, getter_AddRefs(controller));
        if (NS_SUCCEEDED(rv) && controller)
        {
          nsCOMPtr<nsIControllerContext> editController = do_QueryInterface(controller);
          if (editController)
          {
            editController->SetCommandContext(mEditor);
            found = PR_TRUE;
          }
        }
      }
      if (!found)
        rv = NS_ERROR_FAILURE;
    }
  }

  // Initialize the plaintext editor
  nsCOMPtr<nsIPlaintextEditor> textEditor(do_QueryInterface(mEditor));
  if (textEditor) {
    // Set up wrapping
    if (IsTextArea()) {
      // wrap=off means -1 for wrap width no matter what cols is
      nsFormControlHelper::nsHTMLTextWrap wrapProp;
      nsFormControlHelper::GetWrapPropertyEnum(mContent, wrapProp);
      if (wrapProp == nsFormControlHelper::eHTMLTextWrap_Off) {
        // do not wrap when wrap=off
        textEditor->SetWrapWidth(-1);
      } else {
        // Set wrapping normally otherwise
        textEditor->SetWrapWidth(GetCols());
      }
    } else {
      // Never wrap non-textareas
      textEditor->SetWrapWidth(-1);
    }


    // Set max text field length
    PRInt32 maxLength;
    rv = GetMaxLength(&maxLength);
    if (NS_CONTENT_ATTR_NOT_THERE != rv)
    { 
      textEditor->SetMaxTextLength(maxLength);
    }
  }
    
  // Get the caret and make it a selection listener.

  nsCOMPtr<nsISelection> domSelection;
  if (NS_SUCCEEDED(mSelCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSelection))) && domSelection)
  {
    nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(domSelection));
    nsCOMPtr<nsICaret> caret;
    nsCOMPtr<nsISelectionListener> listener;
    if (NS_SUCCEEDED(shell->GetCaret(getter_AddRefs(caret))) && caret)
    {
      listener = do_QueryInterface(caret);
      if (listener)
      {
        selPriv->AddSelectionListener(listener);
      }
    }

    selPriv->AddSelectionListener(NS_STATIC_CAST(nsISelectionListener *, mTextListener));
  }
  
  if (mContent)
  {
    rv = mEditor->GetFlags(&editorFlags);

    if (NS_FAILED(rv))
      return rv;

    nsAutoString resultValue;

    // Check if the readonly attribute is set.

    rv = mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::readonly, resultValue);

    if (NS_FAILED(rv))
      return rv;

    if (NS_CONTENT_ATTR_NOT_THERE != rv)
      editorFlags |= nsIPlaintextEditor::eEditorReadonlyMask;

    // Check if the disabled attribute is set.

    rv = mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, resultValue);

    if (NS_FAILED(rv))
      return rv;

    if (NS_CONTENT_ATTR_NOT_THERE != rv) 
      editorFlags |= nsIPlaintextEditor::eEditorDisabledMask;

    // Disable the caret and selection if necessary.

    if (editorFlags & nsIPlaintextEditor::eEditorReadonlyMask ||
        editorFlags & nsIPlaintextEditor::eEditorDisabledMask)
    {
      if (mSelCon)
      {
         //do not turn caret enabled off at this time.  the caret will behave 
         //dependant on the focused frame it is in.  disabling it here has
         //an adverse affect on the browser in caret display mode or the editor
         //when a readonly/disabled text form is in the page. bug 141888
         //mSelCon->SetCaretEnabled(PR_FALSE);

        if (editorFlags & nsIPlaintextEditor::eEditorDisabledMask)
          mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_OFF);
      }

      mEditor->SetFlags(editorFlags);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsTextControlFrame::CreateFrameFor ( nsPresContext aPresContext,
nsIContent aContent,
nsIFrame **  aFrame 
) [virtual]

Implements nsIAnonymousContentCreator.

Definition at line 1673 of file nsTextControlFrame.cpp.

{
  *aFrame = nsnull;
  return NS_ERROR_FAILURE;
}
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:

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

Reimplemented from nsBoxFrame.

Definition at line 1449 of file nsTextControlFrame.cpp.

{
  if (!mDidPreDestroy) {
    PreDestroy(aPresContext);
  }
  return nsBoxFrame::Destroy(aPresContext);
}

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

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

Definition at line 1099 of file nsBoxFrame.cpp.

{
  PRUint32 oldFlags = aState.LayoutFlags();
  aState.SetLayoutFlags(0);

  nsresult rv = NS_OK;
  if (mLayoutManager)
    rv = mLayoutManager->Layout(this, aState);

  aState.SetLayoutFlags(oldFlags);

  return rv;
}

Here is the call graph for this function:

nsresult nsTextControlFrame::DOMPointToOffset ( nsIDOMNode aNode,
PRInt32  aNodeOffset,
PRInt32 aResult 
)

Definition at line 2560 of file nsTextControlFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(aNode && aResult);

  *aResult = 0;

  nsCOMPtr<nsIDOMElement> rootElement;
  mEditor->GetRootElement(getter_AddRefs(rootElement));
  nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(rootElement));

  NS_ENSURE_TRUE(rootNode, NS_ERROR_FAILURE);

  nsCOMPtr<nsIDOMNodeList> nodeList;

  nsresult rv = rootNode->GetChildNodes(getter_AddRefs(nodeList));
  NS_ENSURE_SUCCESS(rv, rv);
  NS_ENSURE_TRUE(nodeList, NS_ERROR_FAILURE);

  PRUint32 length = 0;
  rv = nodeList->GetLength(&length);
  NS_ENSURE_SUCCESS(rv, rv);

  if (!length || aNodeOffset < 0)
    return NS_OK;

  PRInt32 i, textOffset = 0;
  PRInt32 lastIndex = (PRInt32)length - 1;

  for (i = 0; i < (PRInt32)length; i++) {
    if (rootNode == aNode && i == aNodeOffset) {
      *aResult = textOffset;
      return NS_OK;
    }

    nsCOMPtr<nsIDOMNode> item;
    rv = nodeList->Item(i, getter_AddRefs(item));
    NS_ENSURE_SUCCESS(rv, rv);
    NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);

    nsCOMPtr<nsIDOMText> domText(do_QueryInterface(item));

    if (domText) {
      PRUint32 textLength = 0;

      rv = domText->GetLength(&textLength);
      NS_ENSURE_SUCCESS(rv, rv);

      if (item == aNode) {
        NS_ASSERTION((aNodeOffset >= 0 && aNodeOffset <= (PRInt32)textLength),
                     "Invalid aNodeOffset!");
        *aResult = textOffset + aNodeOffset;
        return NS_OK;
      }

      textOffset += textLength;
    }
    else {
      // Must be a BR node. If it's not the last BR node
      // under the root, count it as a newline.

      if (i != lastIndex)
        ++textOffset;
    }
  }

  NS_ASSERTION((aNode == rootNode && aNodeOffset == (PRInt32)length),
               "Invalide node offset!");

  *aResult = textOffset;
  
  return NS_OK;
}

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:

Fire the onChange event.

Definition at line 3000 of file nsTextControlFrame.cpp.

{
  // Dispatch th1e change event
  nsCOMPtr<nsIContent> content;
  if (NS_SUCCEEDED(GetFormContent(*getter_AddRefs(content))))
  {
    nsEventStatus status = nsEventStatus_eIgnore;
    nsInputEvent event(PR_TRUE, NS_FORM_CHANGE, nsnull);

    // Have the content handle the event.
    nsWeakPtr &shell = mTextSelImpl->GetPresShell();
    nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(shell);
    NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
    return presShell->HandleEventWithTarget(&event, nsnull, mContent, NS_EVENT_FLAG_INIT, &status); 
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2955 of file nsTextControlFrame.cpp.

{
  NS_ASSERTION(mContent, "illegal to call unless we map to a content node");

  if (!mNotifyOnInput) { 
    return; // if notification is turned off, do nothing
  } 
  
  // Dispatch the "input" event
  nsEventStatus status = nsEventStatus_eIgnore;
  nsUIEvent event(PR_TRUE, NS_FORM_INPUT, 0);

  // Have the content handle the event, propagating it according to normal
  // DOM rules.
  nsWeakPtr &shell = mTextSelImpl->GetPresShell();
  nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(shell);
  NS_ASSERTION(presShell, "No pres shell");
  if (!presShell) {
    return;
  }

  presShell->HandleEventWithTarget(&event, nsnull, mContent,
                                   NS_EVENT_FLAG_INIT, &status); 
}

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

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

Used to iterate the list of additional child list names.

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

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

Reimplemented from nsFrame.

Reimplemented in nsTableFrame, nsMenuFrame, nsTableOuterFrame, and ViewportFrame.

Definition at line 193 of file nsContainerFrame.cpp.

{
  if (aIndex == 0) {
    return nsLayoutAtoms::overflowList;
  } else {
    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 nsTextControlFrame::GetAscent ( nsBoxLayoutState aBoxLayoutState,
nscoord aAscent 
) [virtual]

Reimplemented from nsBoxFrame.

Definition at line 2207 of file nsTextControlFrame.cpp.

{
  // First calculate the ascent of the text inside
  nsresult rv = nsStackFrame::GetAscent(aState, aAscent);
  NS_ENSURE_SUCCESS(rv, rv);
    
  // Now adjust the ascent for our borders and padding
  aAscent += aState.GetReflowState()->mComputedBorderPadding.top;
  
  return NS_OK;
}

Here is the call graph for this function:

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

Implements nsIFrame.

Definition at line 553 of file nsBox.cpp.

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

  aMargin = GetStyleBorder()->GetBorder();

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in nsGridRowLeafFrame, and nsGroupBoxFrame.

Definition at line 535 of file nsBox.cpp.

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

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

  aBorderAndPadding += padding;

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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:

Get the cols attribute (if textarea) or a default.

Returns:
the number of columns to use

Definition at line 1498 of file nsTextControlFrame.cpp.

{
  nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
  NS_ASSERTION(content, "Content is not HTML content!");

  if (IsTextArea()) {
    const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::cols);
    if (attr) {
      PRInt32 cols = attr->Type() == nsAttrValue::eInteger ?
                     attr->GetIntegerValue() : 0;
      // XXX why a default of 1 char, why hide it
      return (cols <= 0) ? 1 : cols;
    }
  } else {
    // Else we know (assume) it is an input with size attr
    const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::size);
    if (attr && attr->Type() == nsAttrValue::eInteger) {
      PRInt32 cols = attr->GetIntegerValue();
      if (cols > 0) {
        return cols;
      }
    }
  }

  return DEFAULT_COLS;
}

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:

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:

Implements nsITextControlFrame.

Definition at line 2382 of file nsTextControlFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(aEditor);
  *aEditor = mEditor;
  NS_IF_ADDREF(*aEditor);
  return NS_OK;
}

Here is the caller graph for this function:

gets the first or last possible caret position within the frame

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

Definition at line 3478 of file nsFrame.cpp.

{
  nsPeekOffsetStruct result;

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

  nsIFrame *resultFrame = this;

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

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

  if (!resultFrame)
    return result;

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

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

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

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

  result.mResultContent = content;

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

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Get the first child frame from the specified child list.

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

Reimplemented from nsFrame.

Reimplemented in nsTableFrame, nsMenuFrame, nsTableOuterFrame, and ViewportFrame.

Definition at line 179 of file nsContainerFrame.cpp.

{
  // We only know about the unnamed principal child list and the overflow
  // list
  if (nsnull == aListName) {
    return mFrames.FirstChild();
  } else if (nsLayoutAtoms::overflowList == aListName) {
    return GetOverflowFrames(GetPresContext(), PR_FALSE);
  } else {
    return nsnull;
  }
}

Here is the call graph for this function:

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

Get the content object associated with this frame.

Adds a reference to the content object so the caller must do a release.

See also:
nsISupports::Release()

Implements nsIFormControlFrame.

Definition at line 2327 of file nsTextControlFrame.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsTextControlFrame::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 nsStackFrame.

Definition at line 2114 of file nsTextControlFrame.cpp.

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

Reimplemented from nsBoxFrame.

Definition at line 103 of file nsStackFrame.cpp.

{
  if (aWhichLayer != NS_FRAME_PAINT_LAYER_BACKGROUND)
    return NS_ERROR_FAILURE;

  nsresult rv = nsBoxFrame::GetFrameForPointChild(aPoint,
                                           NS_FRAME_PAINT_LAYER_FOREGROUND,
                                           aChild, aCheckMouseThrough, aFrame);
  if (NS_SUCCEEDED(rv))
    return rv;
  return nsBoxFrame::GetFrameForPointChild(aPoint,
                                           NS_FRAME_PAINT_LAYER_BACKGROUND,
                                           aChild, aCheckMouseThrough, aFrame);
}
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;
}
nscoord nsTextControlFrame::GetHorizontalInsidePadding ( nsPresContext aPresContext,
float  aPixToTwip,
nscoord  aInnerWidth,
nscoord  aCharWidth 
) const [virtual]

Definition at line 2309 of file nsTextControlFrame.cpp.

{
  return GetVerticalInsidePadding(aPresContext, aPixToTwip, aInnerWidth);
}

Here is the call graph for this function:

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:

nsresult nsTextControlFrame::GetMaxLength ( PRInt32 aMaxLength) [protected]

Get the maxlength attribute.

Parameters:
aMaxLengththe value of the max length attr
Exceptions:
NS_CONTENT_ATTR_NOT_THEREif attr not defined

Definition at line 2937 of file nsTextControlFrame.cpp.

{
  *aSize = -1;

  nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
  if (content) {
    const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::maxlength);
    if (attr && attr->Type() == nsAttrValue::eInteger) {
      *aSize = attr->GetIntegerValue();

      return NS_CONTENT_ATTR_HAS_VALUE;
    }
  }
  return NS_CONTENT_ATTR_NOT_THERE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from nsBoxFrame.

Definition at line 2201 of file nsTextControlFrame.cpp.

{
  return nsBox::GetMaxSize(aState, aSize);
}
NS_IMETHODIMP nsTextControlFrame::GetMinSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aSize 
) [virtual]

Reimplemented from nsBoxFrame.

Definition at line 2189 of file nsTextControlFrame.cpp.

{
#define FIX_FOR_BUG_40596
#ifdef FIX_FOR_BUG_40596
  aSize = mMinSize;
  return NS_OK;
#else
  return nsBox::GetMinSize(aState, aSize);
#endif
}
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