diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 71f1ff3ddbc..1eb717e7598 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -6654,11 +6654,18 @@ already_AddRefed 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(); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 1618d3d2d8d..c64e103a44e 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -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; }