Resolve the right (parentless) style context for a table as a document root,

and fix the assertion when adjusting parent style context frames to not trigger
in non-scrollable documents.  Bug 378693, r+sr=roc


git-svn-id: svn://10.0.0.236/trunk@225066 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-04-26 02:26:25 +00:00
parent 520b6e4542
commit 7c49bd8a89
2 changed files with 16 additions and 5 deletions

View File

@@ -6654,11 +6654,18 @@ already_AddRefed<nsStyleContext>
nsCSSFrameConstructor::ResolveStyleContext(nsIFrame* aParentFrame,
nsIContent* aContent)
{
aParentFrame = nsFrame::CorrectStyleParentFrame(aParentFrame, nsnull);
nsStyleContext* parentStyleContext;
if (aContent->GetParent()) {
aParentFrame = nsFrame::CorrectStyleParentFrame(aParentFrame, nsnull);
// Resolve the style context based on the content object and the parent
// style context
nsStyleContext* parentStyleContext = aParentFrame->GetStyleContext();
// Resolve the style context based on the content object and the parent
// style context
parentStyleContext = aParentFrame->GetStyleContext();
} else {
// This has got to be a call from ConstructDocElementTableFrame.
// Not sure how best to asserrt that here.
parentStyleContext = nsnull;
}
nsStyleSet *styleSet = mPresShell->StyleSet();

View File

@@ -5527,7 +5527,11 @@ nsFrame::CorrectStyleParentFrame(nsIFrame* aProspectiveParent,
// We can get here if aProspectiveParent is the scrollframe for a viewport
// and the kids are the anonymous scrollbars.
NS_ASSERTION(aProspectiveParent->GetStyleContext()->GetPseudoType() ==
nsCSSAnonBoxes::viewportScroll,
nsCSSAnonBoxes::viewportScroll ||
aProspectiveParent->GetStyleContext()->GetPseudoType() ==
nsCSSAnonBoxes::canvas ||
aProspectiveParent->GetStyleContext()->GetPseudoType() ==
nsCSSAnonBoxes::pageSequence,
"Should have found a parent before this");
return aProspectiveParent;
}