diff --git a/mozilla/layout/base/public/nsIReflowCommand.h b/mozilla/layout/base/public/nsIReflowCommand.h index 99b6c3a707f..538482c7a76 100644 --- a/mozilla/layout/base/public/nsIReflowCommand.h +++ b/mozilla/layout/base/public/nsIReflowCommand.h @@ -20,6 +20,7 @@ #include "nsISupports.h" +class nsIAtom; class nsIFrame; class nsIPresContext; class nsIRenderingContext; @@ -62,14 +63,16 @@ public: * command is the container frame itself. The "child frame" is a linked * list of newly created child frames. * - * The target frame should insert the new frames into its child list, and - * then reflow the child frames using an eReflowReason_Initial reflow reason. + * The target frame should insert the new frames into the specified child + * list, and then reflow the child frames using an eReflowReason_Initial + * reflow reason. * * ContentInserted content notifications also generate a FrameAppended reflow * command if the container frame has no existing child frames. * * @see #GetTarget() * @see #GetChildFrame() + * @see #GetChildListName() */ FrameAppended, @@ -84,7 +87,8 @@ public: * * The target frame should insert the new frames immediately after the previous * sibling frame, and then reflow the new frames using an eReflowReason_Initial - * reflow reason. + * reflow reason. Use GetChildListName() to get the name of the child list to + * which you should insert the new frames. * * The target frame is determined as follows: * - find the previous existing frame and use its content parent @@ -94,6 +98,7 @@ public: * @see #GetTarget() * @see #GetChildFrame() * @see #GetPrevSiblingFrame() + * @see #GetChildListName() */ FrameInserted, @@ -103,8 +108,12 @@ public: * associated with the content that has been removed. The target frame * is the content parent of the "child frame". * + * Use GetChildListName() to get the name of the child list associated with + * the frame to be deleted + * * @see #GetTarget() * @see #GetChildFrame() + * @see #GetChildListName() */ FrameRemoved, @@ -177,6 +186,16 @@ public: */ NS_IMETHOD GetChildFrame(nsIFrame*& aChildFrame) const = 0; + /** + * 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 + */ + NS_IMETHOD GetChildListName(nsIAtom*& aListName) const = 0; + /** * Get the previous sibling frame associated with the reflow command. * This is used for FrameInserted reflow commands. diff --git a/mozilla/layout/generic/nsHTMLReflowCommand.cpp b/mozilla/layout/generic/nsHTMLReflowCommand.cpp index abfbcfc43f6..c811be8e25e 100644 --- a/mozilla/layout/generic/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/generic/nsHTMLReflowCommand.cpp @@ -218,6 +218,12 @@ NS_IMETHODIMP nsHTMLReflowCommand::GetChildFrame(nsIFrame*& aChildFrame) const return NS_OK; } +NS_IMETHODIMP nsHTMLReflowCommand::GetChildListName(nsIAtom*& aListName) const +{ + aListName = nsnull; + return NS_OK; +} + NS_IMETHODIMP nsHTMLReflowCommand::GetPrevSiblingFrame(nsIFrame*& aSiblingFrame) const { aSiblingFrame = mPrevSiblingFrame; diff --git a/mozilla/layout/generic/nsHTMLReflowCommand.h b/mozilla/layout/generic/nsHTMLReflowCommand.h index 24803b051da..b497a20d811 100644 --- a/mozilla/layout/generic/nsHTMLReflowCommand.h +++ b/mozilla/layout/generic/nsHTMLReflowCommand.h @@ -66,6 +66,7 @@ public: NS_IMETHOD GetAttribute(nsIAtom *& aAttribute) const; NS_IMETHOD GetChildFrame(nsIFrame*& aChildFrame) const; + NS_IMETHOD GetChildListName(nsIAtom*& aListName) const; NS_IMETHOD GetPrevSiblingFrame(nsIFrame*& aSiblingFrame) const; protected: diff --git a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp index abfbcfc43f6..c811be8e25e 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp @@ -218,6 +218,12 @@ NS_IMETHODIMP nsHTMLReflowCommand::GetChildFrame(nsIFrame*& aChildFrame) const return NS_OK; } +NS_IMETHODIMP nsHTMLReflowCommand::GetChildListName(nsIAtom*& aListName) const +{ + aListName = nsnull; + return NS_OK; +} + NS_IMETHODIMP nsHTMLReflowCommand::GetPrevSiblingFrame(nsIFrame*& aSiblingFrame) const { aSiblingFrame = mPrevSiblingFrame; diff --git a/mozilla/layout/html/base/src/nsHTMLReflowCommand.h b/mozilla/layout/html/base/src/nsHTMLReflowCommand.h index 24803b051da..b497a20d811 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowCommand.h +++ b/mozilla/layout/html/base/src/nsHTMLReflowCommand.h @@ -66,6 +66,7 @@ public: NS_IMETHOD GetAttribute(nsIAtom *& aAttribute) const; NS_IMETHOD GetChildFrame(nsIFrame*& aChildFrame) const; + NS_IMETHOD GetChildListName(nsIAtom*& aListName) const; NS_IMETHOD GetPrevSiblingFrame(nsIFrame*& aSiblingFrame) const; protected: