Bug 1359341 part 1 - Make PresShell::GetPlaceholderFrameFor return a nsPlaceholderFrame. r=jfkthame

MozReview-Commit-ID: AvfQcCtVMta
This commit is contained in:
Mats Palmgren 2017-05-23 19:09:26 +02:00
parent efde6a4d01
commit 5f995975b4
5 changed files with 13 additions and 11 deletions

View File

@ -4674,7 +4674,7 @@ PresShell::StyleRuleRemoved(StyleSheet* aStyleSheet)
RecordStyleSheetChange(aStyleSheet);
}
nsIFrame*
nsPlaceholderFrame*
PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame) const
{
return mFrameConstructor->GetPlaceholderFrameFor(aFrame);

View File

@ -122,7 +122,7 @@ public:
virtual nsIPageSequenceFrame* GetPageSequenceFrame() const override;
virtual nsCanvasFrame* GetCanvasFrame() const override;
virtual nsIFrame* GetPlaceholderFrameFor(nsIFrame* aFrame) const override;
virtual nsPlaceholderFrame* GetPlaceholderFrameFor(nsIFrame* aFrame) const override;
virtual void FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
nsFrameState aBitToAdd,
ReflowRootHandling aRootHandling =

View File

@ -77,6 +77,7 @@ template<class E> class nsCOMArray;
class AutoWeakFrame;
class WeakFrame;
class nsIScrollableFrame;
class nsPlaceholderFrame;
class gfxContext;
class nsIDOMEvent;
class nsDisplayList;
@ -478,7 +479,7 @@ public:
* Gets the placeholder frame associated with the specified frame. This is
* a helper frame that forwards the request to the frame manager.
*/
virtual nsIFrame* GetPlaceholderFrameFor(nsIFrame* aFrame) const = 0;
virtual nsPlaceholderFrame* GetPlaceholderFrameFor(nsIFrame* aFrame) const = 0;
/**
* Tell the pres shell that a frame needs to be marked dirty and needs

View File

@ -1256,7 +1256,7 @@ static bool AreAllEarlierInFlowFramesEmpty(nsIFrame* aFrame,
void
ReflowInput::CalculateHypotheticalPosition(
nsPresContext* aPresContext,
nsIFrame* aPlaceholderFrame,
nsPlaceholderFrame* aPlaceholderFrame,
const ReflowInput* cbrs,
nsHypotheticalPosition& aHypotheticalPos,
LayoutFrameType aFrameType) const
@ -1581,9 +1581,9 @@ ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
// have been if it had been in the flow
nsHypotheticalPosition hypotheticalPos;
if ((iStartIsAuto && iEndIsAuto) || (bStartIsAuto && bEndIsAuto)) {
nsIFrame* placeholderFrame =
nsPlaceholderFrame* placeholderFrame =
aPresContext->PresShell()->GetPlaceholderFrameFor(mFrame);
NS_ASSERTION(placeholderFrame, "no placeholder frame");
MOZ_ASSERT(placeholderFrame, "no placeholder frame");
if (placeholderFrame->HasAnyStateBits(
PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN)) {

View File

@ -14,12 +14,13 @@
#include "mozilla/Assertions.h"
#include <algorithm>
class nsFloatManager;
struct nsHypotheticalPosition;
class nsIPercentBSizeObserver;
class nsLineLayout;
class nsPlaceholderFrame;
class nsPresContext;
class nsRenderingContext;
class nsFloatManager;
class nsLineLayout;
class nsIPercentBSizeObserver;
struct nsHypotheticalPosition;
/**
* @return aValue clamped to [aMinValue, aMaxValue].
@ -992,7 +993,7 @@ protected:
// mode with the same block direction as the absolute containing block
// (cbrs->frame), though it may differ in inline direction.
void CalculateHypotheticalPosition(nsPresContext* aPresContext,
nsIFrame* aPlaceholderFrame,
nsPlaceholderFrame* aPlaceholderFrame,
const ReflowInput* cbrs,
nsHypotheticalPosition& aHypotheticalPos,
mozilla::LayoutFrameType aFrameType) const;