Avoid ignorable whitespace in tables by setting the frame state-bit to this effect - bug 68411 r=karnaze sr=waterson

git-svn-id: svn://10.0.0.236/trunk@87804 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rbs%maths.uq.edu.au 2001-02-23 12:35:34 +00:00
parent a87f5009f0
commit 1a3029c4da
18 changed files with 168 additions and 0 deletions

View File

@ -252,6 +252,25 @@ NS_NewTableColFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
NS_IMETHODIMP
nsTableColFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
// Let the the base class do its initialization
rv = nsFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}
NS_IMETHODIMP
nsTableColFrame::GetFrameType(nsIAtom** aType) const
{

View File

@ -88,6 +88,12 @@ public:
void SetColIndex (PRInt32 aColIndex);
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,

View File

@ -764,6 +764,25 @@ NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
NS_IMETHODIMP
nsTableColGroupFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
// Let the base class do its processing
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}
NS_IMETHODIMP
nsTableColGroupFrame::GetFrameType(nsIAtom** aType) const
{

View File

@ -56,6 +56,12 @@ public:
friend nsresult
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);

View File

@ -215,6 +215,9 @@ nsTableFrame::Init(nsIPresContext* aPresContext,
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
if (aPrevInFlow) {
// set my width, because all frames in a table flow are the same width and
// code in nsTableOuterFrame depends on this being set

View File

@ -179,6 +179,9 @@ nsTableOuterFrame::Init(nsIPresContext* aPresContext,
if (NS_FAILED(rv) || !mStyleContext) return rv;
AdjustZeroWidth();
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}

View File

@ -140,6 +140,9 @@ nsTableRowFrame::Init(nsIPresContext* aPresContext,
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
if (aPrevInFlow) {
// Set the row index
nsTableRowFrame* rowFrame = (nsTableRowFrame*)aPrevInFlow;

View File

@ -1713,6 +1713,25 @@ NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
NS_IMETHODIMP
nsTableRowGroupFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
// Let the base class do its processing
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableRowGroupFrame::GetFrameName(nsString& aResult) const

View File

@ -108,6 +108,12 @@ public:
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
virtual ~nsTableRowGroupFrame();
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,

View File

@ -252,6 +252,25 @@ NS_NewTableColFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
NS_IMETHODIMP
nsTableColFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
// Let the the base class do its initialization
rv = nsFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}
NS_IMETHODIMP
nsTableColFrame::GetFrameType(nsIAtom** aType) const
{

View File

@ -88,6 +88,12 @@ public:
void SetColIndex (PRInt32 aColIndex);
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,

View File

@ -764,6 +764,25 @@ NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
NS_IMETHODIMP
nsTableColGroupFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
// Let the base class do its processing
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}
NS_IMETHODIMP
nsTableColGroupFrame::GetFrameType(nsIAtom** aType) const
{

View File

@ -56,6 +56,12 @@ public:
friend nsresult
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);

View File

@ -215,6 +215,9 @@ nsTableFrame::Init(nsIPresContext* aPresContext,
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
if (aPrevInFlow) {
// set my width, because all frames in a table flow are the same width and
// code in nsTableOuterFrame depends on this being set

View File

@ -179,6 +179,9 @@ nsTableOuterFrame::Init(nsIPresContext* aPresContext,
if (NS_FAILED(rv) || !mStyleContext) return rv;
AdjustZeroWidth();
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}

View File

@ -140,6 +140,9 @@ nsTableRowFrame::Init(nsIPresContext* aPresContext,
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
if (aPrevInFlow) {
// Set the row index
nsTableRowFrame* rowFrame = (nsTableRowFrame*)aPrevInFlow;

View File

@ -1713,6 +1713,25 @@ NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
NS_IMETHODIMP
nsTableRowGroupFrame::Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
// Let the base class do its processing
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// record that children that are ignorable whitespace should be excluded
mState |= NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE;
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableRowGroupFrame::GetFrameName(nsString& aResult) const

View File

@ -108,6 +108,12 @@ public:
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
virtual ~nsTableRowGroupFrame();
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,