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
Родитель a349f887cd
Коммит 28838b0654
2 изменённых файлов: 14 добавлений и 10 удалений

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

@ -1185,11 +1185,13 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
result = presContext->GetViewportOverflowOverride();
nsCOMPtr<nsISupports> container = presContext->GetContainer();
nsCOMPtr<nsIScrollable> scrollable = do_QueryInterface(container);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_X,
result.mHorizontal);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_Y,
result.mVertical);
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;

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

@ -1185,11 +1185,13 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
result = presContext->GetViewportOverflowOverride();
nsCOMPtr<nsISupports> container = presContext->GetContainer();
nsCOMPtr<nsIScrollable> scrollable = do_QueryInterface(container);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_X,
result.mHorizontal);
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_Y,
result.mVertical);
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;