mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-09 22:48:27 +00:00
Bug 296337. Always correct the overflow area even if NS_FRAME_OUTSIDE_CHILDREN is set. r+sr=bzbarsky,a=shaver
This commit is contained in:
parent
4593df2a57
commit
30e764d94c
@ -510,10 +510,11 @@ nsHTMLScrollFrame::ReflowScrolledFrame(const ScrollReflowState& aState,
|
||||
// setting their mOverflowArea. This is wrong because every frame should
|
||||
// always set mOverflowArea. In fact nsObjectFrame and nsFrameFrame don't
|
||||
// support the 'outline' property because of this. Rather than fix the world
|
||||
// right now, just fix up the overflow area if necessary.
|
||||
if (!(mInner.mScrolledFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN)) {
|
||||
aMetrics->mOverflowArea.SetRect(0, 0, aMetrics->width, aMetrics->height);
|
||||
}
|
||||
// right now, just fix up the overflow area if necessary. Note that we don't
|
||||
// check NS_FRAME_OUTSIDE_CHILDREN because it could be set even though the
|
||||
// overflow area doesn't include the frame bounds.
|
||||
aMetrics->mOverflowArea.UnionRect(aMetrics->mOverflowArea,
|
||||
nsRect(0, 0, aMetrics->width, aMetrics->height));
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -1564,7 +1565,7 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsISupportsArray& aAnonymousChildr
|
||||
if (presContext->IsPaginated()) {
|
||||
// allow scrollbars if this is the child of the viewport, because
|
||||
// we must be the scrollbars for the print preview window
|
||||
if (!OuterIsRootScrollframe()) {
|
||||
if (!mIsRoot) {
|
||||
mNeverHasVerticalScrollbar = mNeverHasHorizontalScrollbar = PR_TRUE;
|
||||
return;
|
||||
}
|
||||
@ -2360,7 +2361,7 @@ nsGfxScrollFrameInner::LayoutScrollbars(nsBoxLayoutState& aState,
|
||||
// be re-laid out anyway)
|
||||
if (aOldScrollArea.Size() != aScrollArea.Size()
|
||||
&& nsBoxLayoutState::Dirty == aState.LayoutReason() &&
|
||||
OuterIsRootScrollframe()) {
|
||||
mIsRoot) {
|
||||
// Usually there are no fixed children, so don't do anything unless there's
|
||||
// at least one fixed child
|
||||
nsIFrame* parentFrame = mOuter->GetParent();
|
||||
@ -2452,14 +2453,6 @@ nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisibl
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGfxScrollFrameInner::OuterIsRootScrollframe()
|
||||
{
|
||||
nsIFrame* parent = mOuter->GetParent();
|
||||
return parent && parent->GetType() == nsLayoutAtoms::viewportFrame &&
|
||||
parent->GetFirstChild(nsnull) == mOuter;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsGfxScrollFrameInner::GetIntegerAttribute(nsIBox* aBox, nsIAtom* atom, PRInt32 defaultValue)
|
||||
{
|
||||
|
@ -120,10 +120,6 @@ public:
|
||||
|
||||
static void SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisible);
|
||||
|
||||
// Return true if mOuter is the root scrollframe (that is, the
|
||||
// unique in-flow child of the viewport).
|
||||
PRBool OuterIsRootScrollframe();
|
||||
|
||||
nsSize GetScrolledSize() const;
|
||||
nsMargin GetActualScrollbarSizes() const;
|
||||
nsMargin GetDesiredScrollbarSizes(nsBoxLayoutState* aState);
|
||||
|
Loading…
Reference in New Issue
Block a user