diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp
index c227a26c4be..df5f7560b5c 100644
--- a/mozilla/layout/generic/nsFrameSetFrame.cpp
+++ b/mozilla/layout/generic/nsFrameSetFrame.cpp
@@ -62,6 +62,45 @@ static NS_DEFINE_IID(kIFramesetFrameIID, NS_IFRAMESETFRAME_IID);
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
+/*******************************************************************************
+ * nsFramesetDrag
+ ******************************************************************************/
+nsFramesetDrag::nsFramesetDrag()
+{
+ UnSet();
+}
+
+nsFramesetDrag::nsFramesetDrag(PRBool aVertical,
+ PRInt32 aIndex,
+ PRInt32 aChange,
+ nsHTMLFramesetFrame* aSource)
+{
+ mVertical = aVertical;
+ mIndex = aIndex;
+ mChange = aChange;
+ mSource = aSource;
+}
+void nsFramesetDrag::Reset(PRBool aVertical,
+ PRInt32 aIndex,
+ PRInt32 aChange,
+ nsHTMLFramesetFrame* aSource)
+{
+ mVertical = aVertical;
+ mIndex = aIndex;
+ mChange = aChange;
+ mSource = aSource;
+ mActive = PR_TRUE;
+}
+
+void nsFramesetDrag::UnSet()
+{
+ mVertical = PR_TRUE;
+ mIndex = -1;
+ mChange = 0;
+ mSource = nsnull;
+ mActive = PR_FALSE;
+}
+
/*******************************************************************************
* nsHTMLFramesetBorderFrame
******************************************************************************/
@@ -120,10 +159,10 @@ class nsHTMLFramesetBlankFrame : public nsLeafFrame {
public:
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
- NS_IMETHOD Paint(nsIPresContext& aPresContext,
+ NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
- const nsRect& aDirtyRect,
- nsFramePaintLayer aWhichLayer);
+ const nsRect& aDirtyRect,
+ nsFramePaintLayer aWhichLayer);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@@ -132,9 +171,9 @@ public:
protected:
virtual ~nsHTMLFramesetBlankFrame();
- virtual void GetDesiredSize(nsIPresContext* aPresContext,
+ virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize);
+ nsHTMLReflowMetrics& aDesiredSize);
friend class nsHTMLFramesetFrame;
friend class nsHTMLFrameset;
};
@@ -148,19 +187,19 @@ PRBool nsHTMLFramesetFrame::gDragInProgress = PR_FALSE;
nsHTMLFramesetFrame::nsHTMLFramesetFrame()
: nsHTMLContainerFrame()
{
- mNumRows = 0;
- mRowSpecs = nsnull;
- mRowSizes = nsnull;
- mNumCols = 0;
- mColSpecs = nsnull;
- mColSizes = nsnull;
- mEdgeVisibility = 0;
- mEdgeColors.Set(NO_COLOR);
+ mNumRows = 0;
+ mRowSpecs = nsnull;
+ mRowSizes = nsnull;
+ mNumCols = 0;
+ mColSpecs = nsnull;
+ mColSizes = nsnull;
+ mEdgeVisibility = 0;
mParentFrameborder = eFrameborder_Yes; // default
mParentBorderWidth = -1; // default not set
mParentBorderColor = NO_COLOR; // default not set
- mLastDragPoint.x = mLastDragPoint.y = 0;
- mMinDrag = 0;
+ mLastDragPoint.x = mLastDragPoint.y = 0;
+ mMinDrag = 0;
+ mEdgeColors.Set(NO_COLOR);
}
nsHTMLFramesetFrame::~nsHTMLFramesetFrame()
@@ -174,7 +213,8 @@ nsHTMLFramesetFrame::~nsHTMLFramesetFrame()
mRowSpecs = mColSpecs = nsnull;
}
-nsresult nsHTMLFramesetFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
+nsresult nsHTMLFramesetFrame::QueryInterface(const nsIID& aIID,
+ void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
@@ -186,9 +226,38 @@ nsresult nsHTMLFramesetFrame::QueryInterface(const nsIID& aIID, void** aInstance
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
+NS_IMETHODIMP
+nsHTMLFramesetFrame::Init(nsIPresContext& aPresContext,
+ nsIContent* aContent,
+ nsIFrame* aParent,
+ nsIStyleContext* aContext,
+ nsIFrame* aPrevInFlow)
+{
+ nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
+ aContext, aPrevInFlow);
+ // find the highest ancestor that is a frameset
+ nsresult rv = NS_OK;
+ nsIFrame* parentFrame = nsnull;
+ GetParent((nsIFrame**)&parentFrame);
+ mTopLevelFrameset = (nsHTMLFramesetFrame*)this;
+ while (parentFrame) {
+ nsHTMLFramesetFrame* frameset;
+ rv = parentFrame->QueryInterface(kIFramesetFrameIID, (void**)&frameset);
+ if (NS_SUCCEEDED(rv)) {
+ mTopLevelFrameset = frameset;
+ parentFrame->GetParent((nsIFrame**)&parentFrame);
+ } else {
+ break;
+ }
+ }
+ return rv;
+}
+
// XXX should this try to allocate twips based on an even pixel boundary?
-void nsHTMLFramesetFrame::Scale(nscoord aDesired, PRInt32 aNumIndicies,
- PRInt32* aIndicies, PRInt32* aItems)
+void nsHTMLFramesetFrame::Scale(nscoord aDesired,
+ PRInt32 aNumIndicies,
+ PRInt32* aIndicies,
+ PRInt32* aItems)
{
PRInt32 actual = 0;
PRInt32 i, j;
@@ -226,9 +295,11 @@ void nsHTMLFramesetFrame::Scale(nscoord aDesired, PRInt32 aNumIndicies,
* specifier - fixed sizes have the highest priority, percentage sizes have the next
* highest priority and relative sizes have the lowest.
*/
-void nsHTMLFramesetFrame::CalculateRowCol(nsIPresContext* aPresContext, nscoord aSize,
- PRInt32 aNumSpecs, nsFramesetSpec* aSpecs,
- nscoord* aValues)
+void nsHTMLFramesetFrame::CalculateRowCol(nsIPresContext* aPresContext,
+ nscoord aSize,
+ PRInt32 aNumSpecs,
+ nsFramesetSpec* aSpecs,
+ nscoord* aValues)
{
PRInt32 fixedTotal = 0;
PRInt32 numFixed = 0;
@@ -346,9 +417,9 @@ nsHTMLFramesetFrame::GetSkipSides() const
}
void
-nsHTMLFramesetFrame::GetDesiredSize(nsIPresContext* aPresContext,
+nsHTMLFramesetFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize)
+ nsHTMLReflowMetrics& aDesiredSize)
{
nsHTMLFramesetFrame* framesetParent = GetFramesetParent(this);
if (nsnull == framesetParent) {
@@ -397,7 +468,9 @@ nsHTMLFramesetFrame* nsHTMLFramesetFrame::GetFramesetParent(nsIFrame* aChild)
}
// only valid for non border children
-void nsHTMLFramesetFrame::GetSizeOfChildAt(PRInt32 aIndexInParent, nsSize& aSize, nsPoint& aCellIndex)
+void nsHTMLFramesetFrame::GetSizeOfChildAt(PRInt32 aIndexInParent,
+ nsSize& aSize,
+ nsPoint& aCellIndex)
{
PRInt32 row = aIndexInParent / mNumCols;
PRInt32 col = aIndexInParent - (row * mNumCols); // remainder from dividing index by mNumCols
@@ -413,7 +486,7 @@ void nsHTMLFramesetFrame::GetSizeOfChildAt(PRInt32 aIndexInParent, nsSize& aSize
// only valid for non border children
void nsHTMLFramesetFrame::GetSizeOfChild(nsIFrame* aChild,
- nsSize& aSize)
+ nsSize& aSize)
{
// Reflow only creates children frames for