Don't allow positioning or floating <mtable>. Bug 355993, r=bernd, sr=rbs

This commit is contained in:
bzbarsky@mit.edu
2006-10-10 14:44:34 +00:00
parent 97d5ab9d86
commit 8d7fa06e4a
2 changed files with 23 additions and 9 deletions

View File

@@ -2835,7 +2835,7 @@ nsCSSFrameConstructor::CreatePseudoTableFrame(nsTableCreator& aTableCre
nsFrameItems items;
rv = ConstructTableFrame(aState, parentContent,
parentFrame, childStyle, aTableCreator,
PR_TRUE, items, pseudoOuter.mFrame,
PR_TRUE, items, PR_TRUE, pseudoOuter.mFrame,
pseudoInner.mFrame);
if (NS_FAILED(rv)) return rv;
@@ -3538,6 +3538,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
nsTableCreator& aTableCreator,
PRBool aIsPseudo,
nsFrameItems& aChildItems,
PRBool aAllowOutOfFlow,
nsIFrame*& aNewOuterFrame,
nsIFrame*& aNewInnerFrame)
{
@@ -3575,7 +3576,12 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
}
const nsStyleDisplay* disp = outerStyleContext->GetStyleDisplay();
nsIFrame* geometricParent = aState.GetGeometricParent(disp, parentFrame);
// We need the aAllowOutOfFlow thing for MathML. See bug 355993.
// Once bug 348577 is fixed, we should remove this code. At that
// point, the aAllowOutOfFlow arg can go away.
nsIFrame* geometricParent =
aAllowOutOfFlow ? aState.GetGeometricParent(disp, parentFrame) :
parentFrame;
// Init the table outer frame and see if we need to create a view, e.g.
// the frame is absolutely positioned
@@ -3592,8 +3598,10 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
if (!aIsPseudo) {
// Put the newly created frames into the right child list
aNewOuterFrame->SetInitialChildList(nsnull, aNewInnerFrame);
rv = aState.AddChild(aNewOuterFrame, *frameItems, disp, aContent,
outerStyleContext, parentFrame);
outerStyleContext, parentFrame, aAllowOutOfFlow,
aAllowOutOfFlow);
if (NS_FAILED(rv)) {
return rv;
}
@@ -4193,7 +4201,7 @@ nsCSSFrameConstructor::TableProcessChild(nsFrameConstructorState& aState,
rv = ConstructTableFrame(aState, aChildContent,
aParentFrame, childStyleContext,
aTableCreator, PR_FALSE, aChildItems,
childFrame, innerTableFrame);
PR_TRUE, childFrame, innerTableFrame);
if (NS_SUCCEEDED(rv) && pageBreakAfter) {
// Construct the page break after
ConstructPageBreakFrame(aState, aChildContent, aParentFrame,
@@ -6860,8 +6868,8 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
nsIFrame* innerTable;
rv = ConstructTableFrame(aState, aContent,
aParentFrame, aStyleContext,
*tableCreator, PR_FALSE, aFrameItems, newFrame,
innerTable);
*tableCreator, PR_FALSE, aFrameItems, PR_TRUE,
newFrame, innerTable);
addedToFrameList = PR_TRUE;
// Note: table construction function takes care of initializing
// the frame, processing children, and setting the initial child
@@ -7164,9 +7172,12 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
nsIFrame* outerTable;
nsIFrame* innerTable;
nsMathMLmtableCreator mathTableCreator(mPresShell);
// Pass PR_FALSE for aAllowOutOfFlow so that the resulting table will be
// guaranteed to be in-flow (and in particular, a descendant of the <math>
// in the _frame_ tree).
rv = ConstructTableFrame(aState, aContent, blockFrame, tableContext,
mathTableCreator, PR_FALSE, tempItems, outerTable,
innerTable);
mathTableCreator, PR_FALSE, tempItems, PR_FALSE,
outerTable, innerTable);
// Note: table construction function takes care of initializing the frame,
// processing children, and setting the initial child list