Bug 473390 part 3. Move some HTML frame construction assertions out of the frame constructor and into the relevant frame creation methods. r+sr=roc

This commit is contained in:
Boris Zbarsky 2009-01-19 13:31:31 -05:00
Родитель 42028dd8b5
Коммит a71a7fc3a2
4 изменённых файлов: 18 добавлений и 8 удалений

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

@ -5386,9 +5386,6 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
addedToFrameList = PR_TRUE;
}
else if (nsGkAtoms::legend == aTag) {
NS_ASSERTION(!display->IsAbsolutelyPositioned() && !display->IsFloating(),
"Legends should not be positioned and should not float");
if (!aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(aState, aFrameItems);
}
@ -5396,9 +5393,6 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
triedFrame = PR_TRUE;
}
else if (nsGkAtoms::frameset == aTag) {
NS_ASSERTION(!display->IsAbsolutelyPositioned() && !display->IsFloating(),
"Framesets should not be positioned and should not float");
if (!aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(aState, aFrameItems);
}
@ -5415,8 +5409,6 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
triedFrame = PR_TRUE;
}
else if (nsGkAtoms::spacer == aTag) {
NS_ASSERTION(!display->IsAbsolutelyPositioned() && !display->IsFloating(),
"Spacers should not be positioned and should not float");
if (!aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(aState, aFrameItems);
}

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

@ -55,6 +55,12 @@
nsIFrame*
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
#ifdef DEBUG
const nsStyleDisplay* disp = aContext->GetStyleDisplay();
NS_ASSERTION(!disp->IsAbsolutelyPositioned() && !disp->IsFloating(),
"Legends should not be positioned and should not float");
#endif
nsIFrame* f = new (aPresShell) nsLegendFrame(aContext);
if (f) {
f->AddStateBits(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);

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

@ -1604,6 +1604,12 @@ nsHTMLFramesetFrame::EndMouseDrag(nsPresContext* aPresContext)
nsIFrame*
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
#ifdef DEBUG
const nsStyleDisplay* disp = aContext->GetStyleDisplay();
NS_ASSERTION(!disp->IsAbsolutelyPositioned() && !disp->IsFloating(),
"Framesets should not be positioned and should not float");
#endif
return new (aPresShell) nsHTMLFramesetFrame(aContext);
}

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

@ -73,6 +73,12 @@ protected:
nsIFrame*
NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
#ifdef DEBUG
const nsStyleDisplay* disp = aContext->GetStyleDisplay();
NS_ASSERTION(!disp->IsAbsolutelyPositioned() && !disp->IsFloating(),
"Spacers should not be positioned and should not float");
#endif
return new (aPresShell) SpacerFrame(aContext);
}