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
Родитель eed8bf4e25
Коммит 8b1ddd5c4d
6 изменённых файлов: 47 добавлений и 22 удалений

Просмотреть файл

@ -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 NS_IMETHODIMP
nsTableOuterFrame::Init(nsIPresContext* aPresContext, nsTableOuterFrame::AdjustZeroWidth()
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{ {
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
aContext, aPrevInFlow);
if (NS_FAILED(rv) || !mStyleContext) return rv;
#if 0
// a 0 width table becomes auto // a 0 width table becomes auto
PRBool makeAuto = PR_FALSE; PRBool makeAuto = PR_FALSE;
nsStylePosition* position = (nsStylePosition*)mStyleContext->GetMutableStyleData(eStyleStruct_Position); nsStylePosition* position = (nsStylePosition*)mStyleContext->GetMutableStyleData(eStyleStruct_Position);
@ -166,7 +158,21 @@ nsTableOuterFrame::Init(nsIPresContext* aPresContext,
if (makeAuto) { if (makeAuto) {
position->mWidth = nsStyleCoord(eStyleUnit_Auto); 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; return rv;
} }

Просмотреть файл

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

Просмотреть файл

@ -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 NS_IMETHODIMP
nsTableOuterFrame::Init(nsIPresContext* aPresContext, nsTableOuterFrame::AdjustZeroWidth()
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{ {
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
aContext, aPrevInFlow);
if (NS_FAILED(rv) || !mStyleContext) return rv;
#if 0
// a 0 width table becomes auto // a 0 width table becomes auto
PRBool makeAuto = PR_FALSE; PRBool makeAuto = PR_FALSE;
nsStylePosition* position = (nsStylePosition*)mStyleContext->GetMutableStyleData(eStyleStruct_Position); nsStylePosition* position = (nsStylePosition*)mStyleContext->GetMutableStyleData(eStyleStruct_Position);
@ -166,7 +158,21 @@ nsTableOuterFrame::Init(nsIPresContext* aPresContext,
if (makeAuto) { if (makeAuto) {
position->mWidth = nsStyleCoord(eStyleUnit_Auto); 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; return rv;
} }

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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