Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsHTMLReflowCommand Class Reference

A reflow command is an object that is generated in response to a content model change notification. More...

#include <nsHTMLReflowCommand.h>

Collaboration diagram for nsHTMLReflowCommand:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsHTMLReflowCommand (nsIFrame *aTargetFrame, nsReflowType aReflowType, nsIAtom *aChildListName)
 Construct an HTML reflow command of type aReflowType and with target frame aTargetFrame.
 ~nsHTMLReflowCommand ()
nsIFrameGetTarget () const
 Get the target of the reflow command.
nsReflowType Type () const
 Get the type of reflow command.
nsIAtomGetChildListName () const
 Returns the name of the child list to which the child frame belongs.
nsresult List (FILE *out) const
 Dump out the reflow-command to out.
PRInt32 GetFlagBits ()
 Get/set reflow command flags.
void AddFlagBits (PRInt32 aBits)
void RemoveFlagBits (PRInt32 aBits)
nsresult GetTarget (nsIFrame *&aTargetFrame) const
 DEPRECATED compatibility methods.
nsresult GetType (nsReflowType &aReflowType) const
nsresult GetChildListName (nsIAtom *&aListName) const

Private Attributes

nsReflowType mType
nsIFramemTargetFrame
nsCOMPtr< nsIAtommListName
PRInt32 mFlags

Detailed Description

A reflow command is an object that is generated in response to a content model change notification.

The reflow command is given to a presentation shell where it is queued and then dispatched by invoking the reflow commands's Dispatch() member function.

Reflow command processing follows a path from the root frame down to the target frame (the frame for which the reflow command is destined). Reflow commands are processed by invoking the frame's Reflow() member function.

The typical flow of control for a given reflow command starts with a content change notification. The content notifications are sent to document observers. The presentation shell forwards the notifications to the style set. The style system responds to the notifications by creating new frame (or destroying existing frames) as appropriate, and then generating a reflow command.

See also:
nsIDocumentObserver
nsIStyleSet
nsIFrameReflow::Reflow()
nsIPresShell::AppendReflowCommand()
nsIPresShell::ProcessReflowCommands()

Definition at line 76 of file nsHTMLReflowCommand.h.


Constructor & Destructor Documentation

nsHTMLReflowCommand::nsHTMLReflowCommand ( nsIFrame aTargetFrame,
nsReflowType  aReflowType,
nsIAtom aChildListName 
)

Construct an HTML reflow command of type aReflowType and with target frame aTargetFrame.

You can also specify an optional child frame, e.g. to indicate the inserted child frame

Definition at line 87 of file nsHTMLReflowCommand.cpp.

  : mType(aReflowType), mTargetFrame(aTargetFrame), mListName(aChildListName),
    mFlags(0)
{
  MOZ_COUNT_CTOR(nsHTMLReflowCommand);
  NS_PRECONDITION(mTargetFrame != nsnull, "null target frame");
#ifdef DEBUG_jesup
  gReflows++;
  gReflowsInUse++;
  if (gReflowsInUse > gReflowsInUseMax)
    gReflowsInUseMax = gReflowsInUse;
#endif
}

Definition at line 103 of file nsHTMLReflowCommand.cpp.

{
  MOZ_COUNT_DTOR(nsHTMLReflowCommand);
#ifdef DEBUG_jesup
  if (mPath.GetArraySize() == 0)
    gReflowsMaxZero++;
  else if (mPath.GetArraySize() <= 8)
    gReflowsMaxAuto++;
  else
    gReflowsMaxLarger++;
  gReflowsInUse--;
#endif
}

Member Function Documentation

Definition at line 118 of file nsHTMLReflowCommand.h.

{ mFlags |= aBits; }

Here is the caller graph for this function:

Returns the name of the child list to which the child frame belongs.

Only used for reflow command types FrameAppended, FrameInserted, and FrameRemoved

Returns nsnull if the child frame is associated with the unnamed principal child list

Definition at line 107 of file nsHTMLReflowCommand.h.

{ return mListName; }

Here is the caller graph for this function:

nsresult nsHTMLReflowCommand::GetChildListName ( nsIAtom *&  aListName) const [inline]

Definition at line 134 of file nsHTMLReflowCommand.h.

                                                       {
    aListName = mListName;
    NS_IF_ADDREF(aListName);
    return NS_OK;
  }

Get/set reflow command flags.

Definition at line 117 of file nsHTMLReflowCommand.h.

{ return mFlags; }

Here is the caller graph for this function:

Get the target of the reflow command.

Definition at line 92 of file nsHTMLReflowCommand.h.

{ return mTargetFrame; }

Here is the caller graph for this function:

nsresult nsHTMLReflowCommand::GetTarget ( nsIFrame *&  aTargetFrame) const [inline]

DEPRECATED compatibility methods.

Definition at line 124 of file nsHTMLReflowCommand.h.

                                                    {
    aTargetFrame = mTargetFrame;
    return NS_OK;
  }
nsresult nsHTMLReflowCommand::GetType ( nsReflowType aReflowType) const [inline]

Definition at line 129 of file nsHTMLReflowCommand.h.

                                                    {
    aReflowType = mType;
    return NS_OK;
  }

Here is the caller graph for this function:

Dump out the reflow-command to out.

Definition at line 118 of file nsHTMLReflowCommand.cpp.

{
#ifdef DEBUG
  static const char* kReflowCommandType[] = {
    "ContentChanged",
    "StyleChanged",
    "ReflowDirty",
    "UserDefined",
  };

  fprintf(out, "ReflowCommand@%p[%s]:",
          this, kReflowCommandType[mType]);
  if (mTargetFrame) {
    fprintf(out, " target=");
    nsFrame::ListTag(out, mTargetFrame);
  }
  if (mListName) {
    fprintf(out, " list=");
    nsAutoString attr;
    mListName->ToString(attr);
    fputs(NS_LossyConvertUCS2toASCII(attr).get(), out);
  }
  fprintf(out, "\n");

  // Show the path, but without using mPath which is in an undefined
  // state at this point.
  if (mTargetFrame) {
    PRBool didOne = PR_FALSE;
    for (nsIFrame* f = mTargetFrame; f; f = f->GetParent()) {
      if (f != mTargetFrame) {
        fprintf(out, " ");
        nsFrame::ListTag(out, f);
        didOne = PR_TRUE;
      }
    }
    if (didOne) {
      fprintf(out, "\n");
    }
  }
#endif
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 119 of file nsHTMLReflowCommand.h.

{ mFlags &= ~aBits; }

Get the type of reflow command.

Definition at line 97 of file nsHTMLReflowCommand.h.

{ return mType; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 145 of file nsHTMLReflowCommand.h.

Definition at line 143 of file nsHTMLReflowCommand.h.

Definition at line 142 of file nsHTMLReflowCommand.h.

Definition at line 141 of file nsHTMLReflowCommand.h.


The documentation for this class was generated from the following files: