зеркало из https://github.com/mozilla/gecko-dev.git
1. Make scroll frames non-splittable.
2. Make a placeholder splittable only if the out-of-flow is. 3. If a float placeholder is not splittable then place it immediately instead of failing to reflow it because it can't be split. b=337419 (Patch B) r+sr=roc
This commit is contained in:
Родитель
e077b93bb1
Коммит
fd99ce03ed
|
@ -10984,6 +10984,13 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
|
|||
nsIAtom* frameType = aFrame->GetType();
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nsSplittableType splitType;
|
||||
aFrame->IsSplittable(splitType);
|
||||
NS_ASSERTION(splitType != NS_FRAME_NOT_SPLITTABLE,
|
||||
"why CreateContinuingFrame for a non-splittable frame?");
|
||||
#endif
|
||||
|
||||
if (nsLayoutAtoms::textFrame == frameType) {
|
||||
newFrame = NS_NewContinuingTextFrame(shell, styleContext);
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
* Steve Clark <buster@netscape.com>
|
||||
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
||||
* L. David Baron <dbaron@dbaron.org>
|
||||
* Mats Palmgren <mats.palmgren@bredband.net>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
|
@ -656,10 +657,20 @@ nsBlockReflowState::AddFloat(nsLineLayout& aLineLayout,
|
|||
// prevent the placeholders being torn down. We will destroy any
|
||||
// placeholders later if PlaceBelowCurrentLineFloats finds the
|
||||
// float is complete.
|
||||
nsSplittableType splitType;
|
||||
aPlaceholder->IsSplittable(splitType);
|
||||
if (splitType == NS_FRAME_NOT_SPLITTABLE) {
|
||||
placed = PR_FALSE;
|
||||
}
|
||||
else {
|
||||
placed = PR_TRUE;
|
||||
aReflowStatus = NS_FRAME_NOT_COMPLETE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
placed = PR_TRUE;
|
||||
}
|
||||
}
|
||||
return placed;
|
||||
}
|
||||
|
||||
|
|
|
@ -213,6 +213,12 @@ nsHTMLScrollFrame::RemoveFrame(nsIAtom* aListName,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
{
|
||||
aIsSplittable = NS_FRAME_NOT_SPLITTABLE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRIntn
|
||||
nsHTMLScrollFrame::GetSkipSides() const
|
||||
|
@ -1047,6 +1053,12 @@ nsXULScrollFrame::RemoveFrame(nsIAtom* aListName,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
{
|
||||
aIsSplittable = NS_FRAME_NOT_SPLITTABLE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::GetPadding(nsMargin& aMargin)
|
||||
|
|
|
@ -277,6 +277,7 @@ public:
|
|||
|
||||
virtual PRBool NeedsView() { return PR_TRUE; }
|
||||
virtual PRBool DoesClipChildren() { return PR_TRUE; }
|
||||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
|
||||
virtual nsPoint GetPositionOfChildIgnoringScrolling(nsIFrame* aChild)
|
||||
{ nsPoint pt = aChild->GetPosition();
|
||||
|
@ -424,6 +425,7 @@ public:
|
|||
|
||||
virtual PRBool NeedsView() { return PR_TRUE; }
|
||||
virtual PRBool DoesClipChildren() { return PR_TRUE; }
|
||||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
|
||||
virtual nsPoint GetPositionOfChildIgnoringScrolling(nsIFrame* aChild)
|
||||
{ nsPoint pt = aChild->GetPosition();
|
||||
|
|
|
@ -92,6 +92,13 @@ nsPlaceholderFrame::Destroy()
|
|||
nsSplittableFrame::Destroy();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
{
|
||||
NS_ASSERTION(mOutOfFlowFrame, "IsSplittable called at the wrong time");
|
||||
return mOutOfFlowFrame->IsSplittable(aIsSplittable);
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
nsPlaceholderFrame::GetType() const
|
||||
{
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
nsReflowStatus& aStatus);
|
||||
|
||||
virtual void Destroy();
|
||||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
|
||||
// nsIFrame overrides
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче