Bug 363729. Don't allow fixed-pos tables to have abs-pos children. r=dholbert,sr=dbaron

This commit is contained in:
roc+@cs.cmu.edu 2007-12-11 17:21:34 -08:00
Родитель 80d2e7edb8
Коммит 0985c3a047
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -10802,8 +10802,12 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame)
}
//XXXbz Should mInitialContainingBlock be docRootFrame? It probably doesn't matter.
// Don't allow abs-pos descendants of the fixed content to escape the content.
// This should not normally be possible (because fixed-pos elements should
// be absolute containers) but fixed-pos tables currently aren't abs-pos
// containers.
nsFrameConstructorState state(mPresShell, aParentFrame,
mInitialContainingBlock,
nsnull,
mInitialContainingBlock);
// Iterate across fixed frames and replicate each whose placeholder is a

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

@ -203,7 +203,10 @@ nsBlockReflowState::ComputeBlockAvailSpace(nsIFrame* aFrame,
aResult.y = mY;
aResult.height = GetFlag(BRS_UNCONSTRAINEDHEIGHT)
? NS_UNCONSTRAINEDSIZE
: mBottomEdge - mY;
: PR_MAX(0, mBottomEdge - mY);
// mY might be greater than mBottomEdge if the block's top margin pushes
// it off the page/column. Negative available height can confuse other code
// and is nonsense in principle.
const nsMargin& borderPadding = BorderPadding();