Bug 914891 - Bail gracefully on sticky positioning with no scroll container. r=dholbert
This commit is contained in:
@@ -41,13 +41,17 @@ StickyScrollContainer::~StickyScrollContainer()
|
||||
|
||||
// static
|
||||
StickyScrollContainer*
|
||||
StickyScrollContainer::StickyScrollContainerForFrame(nsIFrame* aFrame)
|
||||
StickyScrollContainer::GetStickyScrollContainerForFrame(nsIFrame* aFrame)
|
||||
{
|
||||
nsIScrollableFrame* scrollFrame =
|
||||
nsLayoutUtils::GetNearestScrollableFrame(aFrame->GetParent(),
|
||||
nsLayoutUtils::SCROLLABLE_SAME_DOC |
|
||||
nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
|
||||
NS_ASSERTION(scrollFrame, "Need a scrolling container");
|
||||
if (!scrollFrame) {
|
||||
// We might not find any, for instance in the case of
|
||||
// <html style="position: fixed">
|
||||
return nullptr;
|
||||
}
|
||||
FrameProperties props = static_cast<nsIFrame*>(do_QueryFrame(scrollFrame))->
|
||||
Properties();
|
||||
StickyScrollContainer* s = static_cast<StickyScrollContainer*>
|
||||
@@ -90,8 +94,7 @@ StickyScrollContainer::ComputeStickyOffsets(nsIFrame* aFrame)
|
||||
nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
|
||||
|
||||
if (!scrollableFrame) {
|
||||
// Not sure how this would happen, but bail if it does.
|
||||
NS_ERROR("Couldn't find a scrollable frame");
|
||||
// Bail.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user