Bug 1015781 - part 3, Fix whitespace and comments, and move some SetInitialChildList/AppendFrames/InsertFrames/RemoveFrame methods so that they are together in the file. r=roc

This commit is contained in:
Mats Palmgren 2014-05-28 19:36:58 +00:00
parent 77c587f250
commit 9ec14c5bc9
29 changed files with 260 additions and 324 deletions

View File

@ -106,7 +106,7 @@ public:
#endif
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual const nsFrameList& GetChildList(ChildListID aListID) const MOZ_OVERRIDE;
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;

View File

@ -46,12 +46,12 @@ public:
nsPoint aPt, const nsRect& aDirtyRect, uint32_t aBGFlags);
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
@ -70,7 +70,7 @@ public:
#ifdef DEBUG
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
#endif
#ifdef DEBUG_FRAME_DUMP

View File

@ -52,14 +52,14 @@ public:
nsStyleContext* aStyleContext) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;

View File

@ -64,7 +64,7 @@ public:
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;

View File

@ -85,10 +85,8 @@ public:
virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
uint32_t aFilter) MOZ_OVERRIDE;
// Utility methods to set current widget state
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

View File

@ -55,15 +55,15 @@ public:
}
void SetInitialChildList(nsIFrame* aDelegatingFrame,
ChildListID aListID,
nsFrameList& aChildList);
ChildListID aListID,
nsFrameList& aChildList);
void AppendFrames(nsIFrame* aDelegatingFrame,
ChildListID aListID,
nsFrameList& aFrameList);
ChildListID aListID,
nsFrameList& aFrameList);
void InsertFrames(nsIFrame* aDelegatingFrame,
ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList);
ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList);
void RemoveFrame(nsIFrame* aDelegatingFrame,
ChildListID aListID,
nsIFrame* aOldFrame);

View File

@ -63,6 +63,62 @@ using namespace mozilla;
using namespace mozilla::css;
using namespace mozilla::layout;
static void MarkAllDescendantLinesDirty(nsBlockFrame* aBlock)
{
nsLineList::iterator line = aBlock->begin_lines();
nsLineList::iterator endLine = aBlock->end_lines();
while (line != endLine) {
if (line->IsBlock()) {
nsIFrame* f = line->mFirstChild;
nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(f);
if (bf) {
MarkAllDescendantLinesDirty(bf);
}
}
line->MarkDirty();
++line;
}
}
static void MarkSameFloatManagerLinesDirty(nsBlockFrame* aBlock)
{
nsBlockFrame* blockWithFloatMgr = aBlock;
while (!(blockWithFloatMgr->GetStateBits() & NS_BLOCK_FLOAT_MGR)) {
nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(blockWithFloatMgr->GetParent());
if (!bf) {
break;
}
blockWithFloatMgr = bf;
}
// Mark every line at and below the line where the float was
// dirty, and mark their lines dirty too. We could probably do
// something more efficient --- e.g., just dirty the lines that intersect
// the float vertically.
MarkAllDescendantLinesDirty(blockWithFloatMgr);
}
/**
* Returns true if aFrame is a block that has one or more float children.
*/
static bool BlockHasAnyFloats(nsIFrame* aFrame)
{
nsBlockFrame* block = nsLayoutUtils::GetAsBlock(aFrame);
if (!block)
return false;
if (block->GetFirstChild(nsIFrame::kFloatList))
return true;
nsLineList::iterator line = block->begin_lines();
nsLineList::iterator endLine = block->end_lines();
while (line != endLine) {
if (line->IsBlock() && BlockHasAnyFloats(line->mFirstChild))
return true;
++line;
}
return false;
}
#ifdef DEBUG
#include "nsBlockDebugFlags.h"
@ -2446,23 +2502,6 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
#endif
}
static void MarkAllDescendantLinesDirty(nsBlockFrame* aBlock)
{
nsLineList::iterator line = aBlock->begin_lines();
nsLineList::iterator endLine = aBlock->end_lines();
while (line != endLine) {
if (line->IsBlock()) {
nsIFrame* f = line->mFirstChild;
nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(f);
if (bf) {
MarkAllDescendantLinesDirty(bf);
}
}
line->MarkDirty();
++line;
}
}
void
nsBlockFrame::MarkLineDirtyForInterrupt(nsLineBox* aLine)
{
@ -4742,6 +4781,55 @@ nsBlockFrame::InsertFrames(ChildListID aListID,
NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
}
void
nsBlockFrame::RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame)
{
#ifdef NOISY_REFLOW_REASON
ListTag(stdout);
printf(": remove ");
nsFrame::ListTag(stdout, aOldFrame);
printf("\n");
#endif
if (aListID == kPrincipalList) {
bool hasFloats = BlockHasAnyFloats(aOldFrame);
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS);
if (hasFloats) {
MarkSameFloatManagerLinesDirty(this);
}
}
else if (kAbsoluteList == aListID) {
nsContainerFrame::RemoveFrame(aListID, aOldFrame);
return;
}
else if (kFloatList == aListID) {
// Make sure to mark affected lines dirty for the float frame
// we are removing; this way is a bit messy, but so is the rest of the code.
// See bug 390762.
NS_ASSERTION(!aOldFrame->GetPrevContinuation(),
"RemoveFrame should not be called on pushed floats.");
for (nsIFrame* f = aOldFrame;
f && !(f->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER);
f = f->GetNextContinuation()) {
MarkSameFloatManagerLinesDirty(static_cast<nsBlockFrame*>(f->GetParent()));
}
DoRemoveOutOfFlowFrame(aOldFrame);
}
else if (kNoReflowPrincipalList == aListID) {
// Skip the call to |FrameNeedsReflow| below by returning now.
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS);
return;
}
else {
MOZ_CRASH("unexpected child list");
}
PresContext()->PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
}
static bool
ShouldPutNextSiblingOnNewLine(nsIFrame* aLastFrame)
{
@ -4942,94 +5030,6 @@ nsBlockFrame::RemoveFloat(nsIFrame* aFloat)
}
}
static void MarkSameFloatManagerLinesDirty(nsBlockFrame* aBlock)
{
nsBlockFrame* blockWithFloatMgr = aBlock;
while (!(blockWithFloatMgr->GetStateBits() & NS_BLOCK_FLOAT_MGR)) {
nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(blockWithFloatMgr->GetParent());
if (!bf) {
break;
}
blockWithFloatMgr = bf;
}
// Mark every line at and below the line where the float was
// dirty, and mark their lines dirty too. We could probably do
// something more efficient --- e.g., just dirty the lines that intersect
// the float vertically.
MarkAllDescendantLinesDirty(blockWithFloatMgr);
}
/**
* Returns true if aFrame is a block that has one or more float children.
*/
static bool BlockHasAnyFloats(nsIFrame* aFrame)
{
nsBlockFrame* block = nsLayoutUtils::GetAsBlock(aFrame);
if (!block)
return false;
if (block->GetFirstChild(nsIFrame::kFloatList))
return true;
nsLineList::iterator line = block->begin_lines();
nsLineList::iterator endLine = block->end_lines();
while (line != endLine) {
if (line->IsBlock() && BlockHasAnyFloats(line->mFirstChild))
return true;
++line;
}
return false;
}
void
nsBlockFrame::RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame)
{
#ifdef NOISY_REFLOW_REASON
ListTag(stdout);
printf(": remove ");
nsFrame::ListTag(stdout, aOldFrame);
printf("\n");
#endif
if (aListID == kPrincipalList) {
bool hasFloats = BlockHasAnyFloats(aOldFrame);
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS);
if (hasFloats) {
MarkSameFloatManagerLinesDirty(this);
}
}
else if (kAbsoluteList == aListID) {
nsContainerFrame::RemoveFrame(aListID, aOldFrame);
return;
}
else if (kFloatList == aListID) {
// Make sure to mark affected lines dirty for the float frame
// we are removing; this way is a bit messy, but so is the rest of the code.
// See bug 390762.
NS_ASSERTION(!aOldFrame->GetPrevContinuation(),
"RemoveFrame should not be called on pushed floats.");
for (nsIFrame* f = aOldFrame;
f && !(f->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER);
f = f->GetNextContinuation()) {
MarkSameFloatManagerLinesDirty(static_cast<nsBlockFrame*>(f->GetParent()));
}
DoRemoveOutOfFlowFrame(aOldFrame);
}
else if (kNoReflowPrincipalList == aListID) {
// Skip the call to |FrameNeedsReflow| below by returning now.
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS);
return;
}
else {
MOZ_CRASH("unexpected child list");
}
PresContext()->PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
}
void
nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame)
{

View File

@ -111,14 +111,14 @@ public:
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual const nsFrameList& GetChildList(ChildListID aListID) const MOZ_OVERRIDE;
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;
virtual nscoord GetBaseline() const MOZ_OVERRIDE;

View File

@ -41,14 +41,14 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;

View File

@ -14,21 +14,20 @@ public:
nsColumnSetFrame(nsStyleContext* aContext);
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;

View File

@ -85,17 +85,10 @@ public:
* NS_FRAME_IS_DIRTY bit set. Must not be empty.
* This method cannot handle the child list returned by
* GetAbsoluteListID().
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified
* name,
* NS_ERROR_UNEXPECTED if the frame is an atomic frame or if the
* initial list of frames has already been set for that child list,
* NS_OK otherwise. In this case, SetInitialChildList empties out
* aChildList in the process of moving the frames over to its own
* child list.
* @see #Init()
*/
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList);
nsFrameList& aChildList);
/**
* This method is responsible for appending frames to the frame
@ -105,12 +98,6 @@ public:
* @param aListID the child list identifier.
* @param aFrameList list of child frames to append. Each of the frames has
* its NS_FRAME_IS_DIRTY bit set. Must not be empty.
* @return 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. In this case, AppendFrames empties out
* aFrameList in the process of moving the frames over to its own
* child list.
*/
virtual void AppendFrames(ChildListID aListID, nsFrameList& aFrameList);
@ -123,16 +110,10 @@ public:
* @param aPrevFrame the frame to insert frames <b>after</b>
* @param aFrameList list of child frames to insert <b>after</b> aPrevFrame.
* Each of the frames has its NS_FRAME_IS_DIRTY bit set
* @return 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. In this case, InsertFrames empties out
* aFrameList in the process of moving the frames over to its own
* child list.
*/
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList);
nsIFrame* aPrevFrame,
nsFrameList& aFrameList);
/**
* This method is responsible for removing a frame in the frame
@ -142,12 +123,6 @@ public:
*
* @param aListID the child list identifier.
* @param aOldFrame the frame to remove
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified
* name,
* NS_ERROR_FAILURE if the child frame is not in the specified
* child list,
* NS_ERROR_UNEXPECTED if the frame is an atomic frame,
* NS_OK otherwise
*/
virtual void RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame);

View File

@ -27,7 +27,7 @@ public:
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
#endif

View File

@ -77,7 +77,7 @@ public:
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
static bool gDragInProgress;

View File

@ -457,11 +457,6 @@ public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) MOZ_OVERRIDE {
@ -503,20 +498,20 @@ public:
return mHelper.UpdateOverflow();
}
// Because there can be only one child frame, these two function return
// NS_ERROR_FAILURE
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsIScrollableFrame* GetScrollTargetFrame() MOZ_OVERRIDE {
return this;
}
@ -769,11 +764,6 @@ public:
bool aIsRoot,
bool aClipAllDescendants);
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) MOZ_OVERRIDE {
@ -789,18 +779,20 @@ public:
return mHelper.UpdateOverflow();
}
// Because there can be only one child frame, these two function return
// NS_ERROR_FAILURE
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsIScrollableFrame* GetScrollTargetFrame() MOZ_OVERRIDE {
return this;

View File

@ -43,16 +43,6 @@ ViewportFrame::Init(nsIContent* aContent,
}
}
void
ViewportFrame::SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList)
{
#ifdef DEBUG
nsFrame::VerifyDirtyBitSet(aChildList);
#endif
nsContainerFrame::SetInitialChildList(aListID, aChildList);
}
void
ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
@ -69,6 +59,16 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
}
void
ViewportFrame::SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList)
{
#ifdef DEBUG
nsFrame::VerifyDirtyBitSet(aChildList);
#endif
nsContainerFrame::SetInitialChildList(aListID, aChildList);
}
void
ViewportFrame::AppendFrames(ChildListID aListID,
nsFrameList& aFrameList)

View File

@ -39,17 +39,14 @@ public:
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

View File

@ -74,12 +74,12 @@ public:
// nsIFrame:
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
{

View File

@ -64,12 +64,12 @@ public:
// so these functions should never be called. They assert and return
// NS_ERROR_NOT_IMPLEMENTED
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsContainerFrame* GetContentInsertionFrame() MOZ_OVERRIDE {
return GetFirstPrincipalChild()->GetContentInsertionFrame();

View File

@ -40,12 +40,6 @@ public:
friend nsTableColGroupFrame* NS_NewTableColGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
/** Initialize the colgroup frame with a set of children.
* @see nsIFrame::SetInitialChildList
*/
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
/**
* ColGroups never paint anything, nor receive events.
*/
@ -81,15 +75,15 @@ public:
/** @see nsIFrame::DidSetStyleContext */
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;
/** @see nsIFrame::AppendFrames, InsertFrames, RemoveFrame
*/
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
/** remove the column aChild from the column group, if requested renumber
* the subsequent columns in this column group and all following column

View File

@ -174,13 +174,15 @@ public:
/** @see nsIFrame::DidSetStyleContext */
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE;
virtual nsMargin GetUsedPadding() const MOZ_OVERRIDE;
@ -234,12 +236,6 @@ public:
*/
bool IsRowGroup(int32_t aDisplayType) const;
/** Initialize the table frame with a set of children.
* @see nsIFrame::SetInitialChildList
*/
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual const nsFrameList& GetChildList(ChildListID aListID) const MOZ_OVERRIDE;
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;

View File

@ -43,12 +43,8 @@ protected:
};
/* TODO
1. decide if we'll allow subclassing. If so, decide which methods really need to be virtual.
*/
/**
* main frame for an nsTable content object,
* Primary frame for a table element,
* the nsTableOuterFrame contains 0 or one caption frame, and a nsTableFrame
* pseudo-frame (referred to as the "inner frame').
*/
@ -72,21 +68,18 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual const nsFrameList& GetChildList(ChildListID aListID) const MOZ_OVERRIDE;
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsContainerFrame* GetContentInsertionFrame() MOZ_OVERRIDE {
return GetFirstPrincipalChild()->GetContentInsertionFrame();

View File

@ -43,12 +43,12 @@ public:
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
/** instantiate a new instance of nsTableRowFrame.
* @param aPresShell the pres shell for this frame

View File

@ -75,14 +75,12 @@ public:
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsMargin GetUsedMargin() const MOZ_OVERRIDE;
virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE;

View File

@ -89,21 +89,18 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsContainerFrame* GetContentInsertionFrame() MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;
virtual nsIAtom* GetType() const MOZ_OVERRIDE;

View File

@ -98,8 +98,6 @@ public:
// actual menu item at all.
virtual const nsFrameList& GetChildList(ChildListID aList) const MOZ_OVERRIDE;
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
// Overridden to prevent events from going to children of the menu.
@ -112,15 +110,15 @@ public:
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual nsIAtom* GetType() const MOZ_OVERRIDE { return nsGkAtoms::menuFrame; }

View File

@ -198,7 +198,7 @@ public:
uint8_t GetShadowStyle();
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual bool IsLeaf() const MOZ_OVERRIDE;

View File

@ -26,15 +26,16 @@ public:
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual const nsFrameList& GetChildList(ChildListID aList) const MOZ_OVERRIDE;
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;

View File

@ -59,12 +59,12 @@ public:
virtual nsresult RemoveTooltipSupport(nsIContent* aNode) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,

View File

@ -58,16 +58,6 @@ public:
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
// nsIFrame overrides
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
virtual void BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
@ -91,11 +81,19 @@ public:
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
// nsContainerFrame overrides
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) MOZ_OVERRIDE;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) MOZ_OVERRIDE;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) MOZ_OVERRIDE;
nsresult StartDrag(nsIDOMEvent* aEvent);
static int32_t GetCurrentPosition(nsIContent* content);