bug 1809, 0 width tables (not trees) become auto, r=dcone, (hyatt)

This commit is contained in:
karnaze%netscape.com 2000-01-28 15:43:25 +00:00
parent eed8bf4e25
commit 8b1ddd5c4d
6 changed files with 47 additions and 22 deletions

View File

@ -137,18 +137,10 @@ nsresult nsTableOuterFrame::QueryInterface(const nsIID& aIID, void** aInstancePt
}
}
// tables change 0 width into auto, trees override this and do nothing
NS_IMETHODIMP
nsTableOuterFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
nsTableOuterFrame::AdjustZeroWidth()
{
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
aContext, aPrevInFlow);
if (NS_FAILED(rv) || !mStyleContext) return rv;
#if 0
// a 0 width table becomes auto
PRBool makeAuto = PR_FALSE;
nsStylePosition* position = (nsStylePosition*)mStyleContext->GetMutableStyleData(eStyleStruct_Position);
@ -166,7 +158,21 @@ nsTableOuterFrame::Init(nsIPresContext* aPresContext,
if (makeAuto) {
position->mWidth = nsStyleCoord(eStyleUnit_Auto);
}
#endif
return NS_OK;
}
NS_IMETHODIMP
nsTableOuterFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
aContext, aPrevInFlow);
if (NS_FAILED(rv) || !mStyleContext) return rv;
AdjustZeroWidth();
return rv;
}

View File

@ -69,6 +69,8 @@ public:
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD AdjustZeroWidth();
/** @see nsIFrame::SetInitialChildList */
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,

View File

@ -137,18 +137,10 @@ nsresult nsTableOuterFrame::QueryInterface(const nsIID& aIID, void** aInstancePt
}
}
// tables change 0 width into auto, trees override this and do nothing
NS_IMETHODIMP
nsTableOuterFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
nsTableOuterFrame::AdjustZeroWidth()
{
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
aContext, aPrevInFlow);
if (NS_FAILED(rv) || !mStyleContext) return rv;
#if 0
// a 0 width table becomes auto
PRBool makeAuto = PR_FALSE;
nsStylePosition* position = (nsStylePosition*)mStyleContext->GetMutableStyleData(eStyleStruct_Position);
@ -166,7 +158,21 @@ nsTableOuterFrame::Init(nsIPresContext* aPresContext,
if (makeAuto) {
position->mWidth = nsStyleCoord(eStyleUnit_Auto);
}
#endif
return NS_OK;
}
NS_IMETHODIMP
nsTableOuterFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
aContext, aPrevInFlow);
if (NS_FAILED(rv) || !mStyleContext) return rv;
AdjustZeroWidth();
return rv;
}

View File

@ -69,6 +69,8 @@ public:
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD AdjustZeroWidth();
/** @see nsIFrame::SetInitialChildList */
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,

View File

@ -80,6 +80,13 @@ nsTreeOuterFrame::Init(nsIPresContext* aPresContext,
return rv;
}
NS_IMETHODIMP
nsTreeOuterFrame::AdjustZeroWidth()
{
// don't do anything, tables change 0 width into auto
return NS_OK;
}
NS_IMETHODIMP
nsTreeOuterFrame::HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* aEvent,

View File

@ -45,6 +45,8 @@ public:
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD AdjustZeroWidth();
NS_DECL_ISUPPORTS
NS_IMETHOD GetBoxInfo(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize);