Bug 509839. r=fantasai
authorMats Palmgren <matspal@gmail.com>
Mon, 12 Apr 2010 20:36:58 +0200
changeset 40719 5df7dac32b28777c4010bb1df5cb9c8dd6ad819f
parent 40718 5072befe7d607c57c936591d8ba70b38df85b565
child 40720 8526e9e6c9ed384faf97de19a218a5f5c5d4e10b
push idunknown
push userunknown
push dateunknown
reviewersfantasai
bugs509839
milestone1.9.3a5pre
Bug 509839. r=fantasai
layout/generic/nsContainerFrame.cpp
layout/generic/nsPageContentFrame.h
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -1200,16 +1200,21 @@ nsContainerFrame::RemovePropTableFrame(n
 }
 
 nsresult
 nsContainerFrame::SetPropTableFrames(nsPresContext*                 aPresContext,
                                      nsFrameList*                   aFrameList,
                                      const FramePropertyDescriptor* aProperty)
 {
   NS_PRECONDITION(aPresContext && aProperty && aFrameList, "null ptr");
+  NS_PRECONDITION(
+    (aProperty != nsContainerFrame::OverflowContainersProperty() &&
+     aProperty != nsContainerFrame::ExcessOverflowContainersProperty()) ||
+    IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
+    "this type of frame can't have overflow containers");
   aPresContext->PropertyTable()->Set(this, aProperty, aFrameList);
   return NS_OK;
 }
 
 /**
  * Push aFromChild and its next siblings to the next-in-flow. Change the
  * geometric parent of each frame that's pushed. If there is no next-in-flow
  * the frames are placed on the overflow list (and the geometric parent is
--- a/layout/generic/nsPageContentFrame.h
+++ b/layout/generic/nsPageContentFrame.h
@@ -52,16 +52,21 @@ public:
 
   // nsIFrame
   NS_IMETHOD  Reflow(nsPresContext*      aPresContext,
                      nsHTMLReflowMetrics& aDesiredSize,
                      const nsHTMLReflowState& aMaxSize,
                      nsReflowStatus&      aStatus);
 
   virtual PRBool IsContainingBlock() const;
+  virtual PRBool IsFrameOfType(PRUint32 aFlags) const
+  {
+    return ViewportFrame::IsFrameOfType(aFlags &
+             ~(nsIFrame::eCanContainOverflowContainers));
+  }
 
   virtual void SetSharedPageData(nsSharedPageData* aPD) { mPD = aPD; }
 
   /**
    *  Computes page size based on shared page data; SetSharedPageData must be
    *  given valid data first.
    */
   virtual nsSize ComputeSize(nsIRenderingContext *aRenderingContext,