diff --git a/mozilla/layout/base/src/nsContainerFrame.cpp b/mozilla/layout/base/src/nsContainerFrame.cpp index 6748b30140e..b29da3451b2 100644 --- a/mozilla/layout/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/base/src/nsContainerFrame.cpp @@ -278,27 +278,6 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, return NS_OK; } -///////////////////////////////////////////////////////////////////////////// -// Pseudo frame related - -// Returns true if this frame is being used a pseudo frame -PRBool nsContainerFrame::IsPseudoFrame() const -{ - PRBool result = PR_FALSE; - - if (nsnull != mGeometricParent) { - nsIContent* parentContent; - - mGeometricParent->GetContent(parentContent); - if (parentContent == mContent) { - result = PR_TRUE; - } - NS_RELEASE(parentContent); - } - - return result; -} - ///////////////////////////////////////////////////////////////////////////// // Helper member functions @@ -598,7 +577,7 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil mContent->GetTag(tag); if (tag != nsnull) tag->ToString(tagString); - PRBool outputMe = (PRBool)((nsnull==aFilter) || ((PR_TRUE==aFilter->OutputTag(&tagString)) && (!IsPseudoFrame()))); + PRBool outputMe = (PRBool)((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString))); if (PR_TRUE==outputMe) { // Indent @@ -653,15 +632,6 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil return NS_OK; } -NS_METHOD nsContainerFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fputs("*", out); - } - nsFrame::ListTag(out); - return NS_OK; -} - #define VERIFY_ASSERT(_expr, _msg) \ if (!(_expr)) { \ DumpTree(); \ diff --git a/mozilla/layout/base/src/nsContainerFrame.h b/mozilla/layout/base/src/nsContainerFrame.h index 0c282450601..d2703088fa0 100644 --- a/mozilla/layout/base/src/nsContainerFrame.h +++ b/mozilla/layout/base/src/nsContainerFrame.h @@ -21,86 +21,7 @@ #include "nsSplittableFrame.h" /** - * Implementation of a container frame. Supports being used a pseudo- - * frame (a frame that maps the same content as its parent). - * - * Container frame iterates its child content and for each content object creates - * one or more child frames. There are three member variables (class invariants) - * used to manage this mapping: - *
- *
mFirstContentOffset - *
the content offset of the first piece of content mapped by this container. - *
mLastContentOffset - *
the content offset of the last piece of content mapped by this container - *
mLastContentIsComplete - *
a boolean indicating whether the last piece of content mapped by this - * container is complete, or whether its frame needs to be continued. - *
- * - * Here are the rules governing the state of the class invariants. The debug member - * functions PreReflowCheck() and PostReflowCheck() validate these rules. For the - * purposes of this discussion an empty frame is defined as a container - * frame with a null child-list, i.e. its mFirstChild is nsnull. - * - *

Non-Empty Frames

- * For a container frame that is not an empty frame the following must be true: - * - * - *

Empty Frames

- * For an empty container frame the following must be true: - * - * - * The value of mLastContentOffset and mLastContentIsComplete are undefined - * for an empty frame. - * - *

Next-In-Flow List

- * The rule is that if a container frame is not complete then the mFirstContentOffset, - * mLastContentOffset, and mLastContentIsComplete of its next-in-flow frames must - * always correct. This means that whenever you push/pull child frames from a - * next-in-flow you must update that next-in-flow's state so that it is - * consistent with the aforementioned rules for empty and non-empty frames. - * - *

Pulling-Up Frames

- * In the processing of pulling-up child frames from a next-in-flow it's possible - * to pull-up all the child frames from a next-in-flow thereby leaving the next-in-flow - * empty. There are two cases to consider: - *
    - *
  1. All of the child frames from all of the next-in-flow have been pulled-up. - * This means that all the next-in-flow frames are empty, the container being - * reflowed is complete, and the next-in-flows will be deleted. - * - * In this case the next-in-flows' mFirstContentOffset is also undefined. - *
  2. Not all the child frames from all the next-in-flows have been pulled-up. - * This means the next-in-flow consists of one or more empty frames followed - * by one or more non-empty frames. Note that all the empty frames must be - * consecutive. This means it is illegal to have an empty frame followed by - * a non-empty frame, followed by an empty frame, followed by a non-empty frame. - *
- * - *

Pseudo-Frames

- * As stated above, when pulling/pushing child frames from/to a next-in-flow the - * state of the next-in-flow must be updated. - * - * If the next-in-flow is a pseudo-frame then not only does the next-in-flow's state - * need to be updated, but the state of its geometric parent must be updated as well. - * See member function PropagateContentOffsets() for details. - * - * This rule is applied recursively, so if the next-in-flow's geometric parent is - * also a pseudo-frame then its geometric parent must be updated. + * Implementation of a container frame. */ class nsContainerFrame : public nsSplittableFrame { @@ -138,13 +59,8 @@ public: // IndexOf() returns -1 if the frame is not in the child list. NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; - // Returns true if this frame is being used a pseudo frame - // XXX deprecated - PRBool IsPseudoFrame() const; - // Debugging NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const; - NS_IMETHOD ListTag(FILE* out = stdout) const; NS_IMETHOD VerifyTree() const; /** diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index 3acc977279b..94f74c86e73 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -147,8 +147,6 @@ nsHTMLContainerFrame::ContentDeleted(nsIPresShell* aShell, nsIContent* aChild, PRInt32 aIndexInParent) { - NS_ASSERTION(!IsPseudoFrame(), "pseudos not supported here"); - // Find the frame that precedes the deletion point nsHTMLContainerFrame* flow; nsIFrame* deadFrame; diff --git a/mozilla/layout/html/base/src/nsBodyFrame.cpp b/mozilla/layout/html/base/src/nsBodyFrame.cpp index 5d7260bf727..a98d752ea18 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.cpp +++ b/mozilla/layout/html/base/src/nsBodyFrame.cpp @@ -50,6 +50,25 @@ NS_NewBodyFrame(nsIContent* aContent, nsIFrame* aParent, nsIFrame*& aResult) return NS_OK; } +// XXX FIX ME... +// Returns true if this frame is being used a pseudo frame +PRBool nsBodyFrame::IsPseudoFrame() const +{ + PRBool result = PR_FALSE; + + if (nsnull != mGeometricParent) { + nsIContent* parentContent; + + mGeometricParent->GetContent(parentContent); + if (parentContent == mContent) { + result = PR_TRUE; + } + NS_RELEASE(parentContent); + } + + return result; +} + nsBodyFrame::nsBodyFrame(nsIContent* aContent, nsIFrame* aParentFrame) : nsHTMLContainerFrame(aContent, aParentFrame) { diff --git a/mozilla/layout/html/base/src/nsBodyFrame.h b/mozilla/layout/html/base/src/nsBodyFrame.h index aa5b42b5c4a..298896e4b52 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.h +++ b/mozilla/layout/html/base/src/nsBodyFrame.h @@ -79,14 +79,6 @@ public: NS_IMETHOD VerifyTree() const; -#if 0 - // nsContainerFrame - virtual void PropagateContentOffsets(nsIFrame* aChild, - PRInt32 aFirstContentOffset, - PRInt32 aLastContentOffset, - PRBool aLastContentIsComplete); -#endif - protected: PRBool mIsPseudoFrame; @@ -125,6 +117,9 @@ private: nsSize GetColumnAvailSpace(nsIPresContext* aPresContext, const nsMargin& aBorderPadding, const nsSize& aMaxSize); + + // XXX FIX ME... + PRBool IsPseudoFrame() const; }; #endif /* nsBodyFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index 3acc977279b..94f74c86e73 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -147,8 +147,6 @@ nsHTMLContainerFrame::ContentDeleted(nsIPresShell* aShell, nsIContent* aChild, PRInt32 aIndexInParent) { - NS_ASSERTION(!IsPseudoFrame(), "pseudos not supported here"); - // Find the frame that precedes the deletion point nsHTMLContainerFrame* flow; nsIFrame* deadFrame; diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 5b58f74a329..5746c664db4 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -2915,6 +2915,29 @@ PRBool nsTableFrame::IsNested(const nsReflowState& aReflowState, nsStylePosition return result; } +static PRBool +IsPseudoFrame(nsIFrame* aFrame) +{ + nsIContent* content; + nsIFrame* parentFrame; + PRBool result = PR_FALSE; + + aFrame->GetContent(content); + aFrame->GetGeometricParent(parentFrame); + if (nsnull != parentFrame) { + nsIContent* parentContent; + + parentFrame->GetContent(parentContent); + if (parentContent == content) { + result = PR_TRUE; + } + NS_RELEASE(parentContent); + } + + NS_RELEASE(content); + return result; +} + /* helper method for getting the width of the table's containing block */ nscoord nsTableFrame::GetTableContainerWidth(const nsReflowState& aReflowState) { @@ -2935,7 +2958,8 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsReflowState& aReflowState) if (NS_OK==rv) { // we found a block, see if it's really a table cell (which means we're a nested table) PRBool skipThisBlock=PR_FALSE; - if (PR_TRUE==((nsContainerFrame*)block)->IsPseudoFrame()) + // XXX FIX ME... + if (IsPseudoFrame(block)) { const nsReflowState* parentRS = rs->parentReflowState; if (nsnull!=parentRS) diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 5b58f74a329..5746c664db4 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -2915,6 +2915,29 @@ PRBool nsTableFrame::IsNested(const nsReflowState& aReflowState, nsStylePosition return result; } +static PRBool +IsPseudoFrame(nsIFrame* aFrame) +{ + nsIContent* content; + nsIFrame* parentFrame; + PRBool result = PR_FALSE; + + aFrame->GetContent(content); + aFrame->GetGeometricParent(parentFrame); + if (nsnull != parentFrame) { + nsIContent* parentContent; + + parentFrame->GetContent(parentContent); + if (parentContent == content) { + result = PR_TRUE; + } + NS_RELEASE(parentContent); + } + + NS_RELEASE(content); + return result; +} + /* helper method for getting the width of the table's containing block */ nscoord nsTableFrame::GetTableContainerWidth(const nsReflowState& aReflowState) { @@ -2935,7 +2958,8 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsReflowState& aReflowState) if (NS_OK==rv) { // we found a block, see if it's really a table cell (which means we're a nested table) PRBool skipThisBlock=PR_FALSE; - if (PR_TRUE==((nsContainerFrame*)block)->IsPseudoFrame()) + // XXX FIX ME... + if (IsPseudoFrame(block)) { const nsReflowState* parentRS = rs->parentReflowState; if (nsnull!=parentRS)