Bug 261128. Protect scrollframes from dying if the prescontext's container goes away (it's a weak ref). r+sr=dbaron

This commit is contained in:
roc+%cs.cmu.edu 2004-09-29 01:46:55 +00:00
parent a349f887cd
commit 28838b0654
2 changed files with 14 additions and 10 deletions

View File

@ -1185,11 +1185,13 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
result = presContext->GetViewportOverflowOverride();
nsCOMPtr<nsISupports> container = presContext->GetContainer();
if (container) {
nsCOMPtr<nsIScrollable> scrollable = do_QueryInterface(container);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_X,
result.mHorizontal);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_Y,
result.mVertical);
}
} else {
const nsStyleDisplay *disp = mOuter->GetStyleDisplay();
result.mHorizontal = disp->mOverflowX;

View File

@ -1185,11 +1185,13 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
result = presContext->GetViewportOverflowOverride();
nsCOMPtr<nsISupports> container = presContext->GetContainer();
if (container) {
nsCOMPtr<nsIScrollable> scrollable = do_QueryInterface(container);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_X,
result.mHorizontal);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_Y,
result.mVertical);
}
} else {
const nsStyleDisplay *disp = mOuter->GetStyleDisplay();
result.mHorizontal = disp->mOverflowX;