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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user