Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt

Differential Revision: https://phabricator.services.mozilla.com/D18734
This commit is contained in:
Emilio Cobos Álvarez 2019-02-05 17:45:54 +01:00
parent 15e84a4c1c
commit 12867b1a3f
242 changed files with 763 additions and 554 deletions

View File

@ -1187,7 +1187,8 @@ void nsFrameConstructorState::ConstructBackdropFrameFor(nsIContent* aContent,
nsContainerFrame* parentFrame =
GetGeometricParent(*style->StyleDisplay(), nullptr);
nsBackdropFrame* backdropFrame = new (mPresShell) nsBackdropFrame(style);
nsBackdropFrame* backdropFrame =
new (mPresShell) nsBackdropFrame(style, mPresShell->GetPresContext());
backdropFrame->Init(aContent, parentFrame, nullptr);
nsFrameState placeholderType;

View File

@ -22,11 +22,13 @@ using mozilla::dom::HTMLInputElement;
nsCheckboxRadioFrame* NS_NewCheckboxRadioFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsCheckboxRadioFrame(aStyle);
return new (aPresShell)
nsCheckboxRadioFrame(aStyle, aPresShell->GetPresContext());
}
nsCheckboxRadioFrame::nsCheckboxRadioFrame(ComputedStyle* aStyle)
: nsAtomicContainerFrame(aStyle, kClassID) {}
nsCheckboxRadioFrame::nsCheckboxRadioFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsAtomicContainerFrame(aStyle, aPresContext, kClassID) {}
nsCheckboxRadioFrame::~nsCheckboxRadioFrame() {}

View File

@ -23,7 +23,8 @@ class nsCheckboxRadioFrame final : public nsAtomicContainerFrame,
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsCheckboxRadioFrame)
explicit nsCheckboxRadioFrame(ComputedStyle* aStyle);
explicit nsCheckboxRadioFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
// nsIFrame replacements
virtual bool IsFrameOfType(uint32_t aFlags) const override {

View File

@ -21,12 +21,14 @@ using mozilla::dom::Document;
using mozilla::dom::Element;
using mozilla::dom::HTMLInputElement;
nsColorControlFrame::nsColorControlFrame(ComputedStyle* aStyle)
: nsHTMLButtonControlFrame(aStyle, kClassID) {}
nsColorControlFrame::nsColorControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsHTMLButtonControlFrame(aStyle, aPresContext, kClassID) {}
nsIFrame* NS_NewColorControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsColorControlFrame(aStyle);
return new (aPresShell)
nsColorControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsColorControlFrame)

View File

@ -51,7 +51,8 @@ class nsColorControlFrame final : public nsHTMLButtonControlFrame,
nsresult UpdateColor();
private:
explicit nsColorControlFrame(ComputedStyle* aStyle);
explicit nsColorControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
nsCOMPtr<Element> mColorContent;
};

View File

@ -59,6 +59,7 @@
using namespace mozilla;
using namespace mozilla::gfx;
using mozilla::dom::Document;
NS_IMETHODIMP
nsComboboxControlFrame::RedisplayTextEvent::Run() {
@ -112,7 +113,8 @@ nsComboboxControlFrame* nsComboboxControlFrame::sFocused = nullptr;
nsComboboxControlFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle,
nsFrameState aStateFlags) {
nsComboboxControlFrame* it = new (aPresShell) nsComboboxControlFrame(aStyle);
nsComboboxControlFrame* it = new (aPresShell)
nsComboboxControlFrame(aStyle, aPresShell->GetPresContext());
if (it) {
// set the state flags (if any are provided)
@ -217,8 +219,9 @@ static int32_t gReflowInx = -1;
//-- Done with macros
//------------------------------------------------------
nsComboboxControlFrame::nsComboboxControlFrame(ComputedStyle* aStyle)
: nsBlockFrame(aStyle, kClassID),
nsComboboxControlFrame::nsComboboxControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsBlockFrame(aStyle, aPresContext, kClassID),
mDisplayFrame(nullptr),
mButtonFrame(nullptr),
mDropdownFrame(nullptr),
@ -1206,7 +1209,8 @@ class nsComboboxDisplayFrame final : public nsBlockFrame {
nsComboboxDisplayFrame(ComputedStyle* aStyle,
nsComboboxControlFrame* aComboBox)
: nsBlockFrame(aStyle, kClassID), mComboBox(aComboBox) {}
: nsBlockFrame(aStyle, aComboBox->PresContext(), kClassID),
mComboBox(aComboBox) {}
#ifdef DEBUG_FRAME_DUMP
nsresult GetFrameName(nsAString& aResult) const override {
@ -1464,8 +1468,7 @@ void nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
// draw a focus indicator only when focus rings should be drawn
Document* doc = mContent->GetComposedDoc();
if (doc) {
if (Document* doc = mContent->GetComposedDoc()) {
nsPIDOMWindowOuter* window = doc->GetWindow();
if (window && window->ShouldShowFocusRing()) {
nsPresContext* presContext = PresContext();

View File

@ -56,7 +56,8 @@ class nsComboboxControlFrame final : public nsBlockFrame,
nsIPresShell* aPresShell, ComputedStyle* aStyle, nsFrameState aFlags);
friend class nsComboboxDisplayFrame;
explicit nsComboboxControlFrame(ComputedStyle* aStyle);
explicit nsComboboxControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
~nsComboboxControlFrame();
NS_DECL_QUERYFRAME

View File

@ -29,7 +29,8 @@ using namespace mozilla::dom;
nsIFrame* NS_NewDateTimeControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsDateTimeControlFrame(aStyle);
return new (aPresShell)
nsDateTimeControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsDateTimeControlFrame)
@ -38,8 +39,9 @@ NS_QUERYFRAME_HEAD(nsDateTimeControlFrame)
NS_QUERYFRAME_ENTRY(nsDateTimeControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
nsDateTimeControlFrame::nsDateTimeControlFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID) {}
nsDateTimeControlFrame::nsDateTimeControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
nscoord nsDateTimeControlFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;

View File

@ -30,7 +30,8 @@ struct DateTimeValue;
class nsDateTimeControlFrame final : public nsContainerFrame {
typedef mozilla::dom::DateTimeValue DateTimeValue;
explicit nsDateTimeControlFrame(ComputedStyle* aStyle);
explicit nsDateTimeControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
public:
friend nsIFrame* NS_NewDateTimeControlFrame(nsIPresShell* aPresShell,

View File

@ -26,13 +26,15 @@ using namespace mozilla::layout;
nsContainerFrame* NS_NewFieldSetFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsFieldSetFrame(aStyle);
return new (aPresShell) nsFieldSetFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsFieldSetFrame)
nsFieldSetFrame::nsFieldSetFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID), mLegendRect(GetWritingMode()) {
nsFieldSetFrame::nsFieldSetFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mLegendRect(GetWritingMode()) {
mLegendSpace = 0;
}

View File

@ -17,7 +17,7 @@ class nsFieldSetFrame final : public nsContainerFrame {
public:
NS_DECL_FRAMEARENA_HELPERS(nsFieldSetFrame)
explicit nsFieldSetFrame(ComputedStyle* aStyle);
explicit nsFieldSetFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
nscoord GetIntrinsicISize(gfxContext* aRenderingContext,
nsLayoutUtils::IntrinsicISizeType);

View File

@ -34,13 +34,15 @@ using namespace mozilla::dom;
nsIFrame* NS_NewFileControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsFileControlFrame(aStyle);
return new (aPresShell)
nsFileControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsFileControlFrame)
nsFileControlFrame::nsFileControlFrame(ComputedStyle* aStyle)
: nsBlockFrame(aStyle, kClassID) {
nsFileControlFrame::nsFileControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsBlockFrame(aStyle, aPresContext, kClassID) {
AddStateBits(NS_BLOCK_FLOAT_MGR);
}

View File

@ -29,7 +29,8 @@ class nsFileControlFrame final : public nsBlockFrame,
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsFileControlFrame)
explicit nsFileControlFrame(ComputedStyle* aStyle);
explicit nsFileControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;

View File

@ -13,12 +13,14 @@
using namespace mozilla;
nsGfxButtonControlFrame::nsGfxButtonControlFrame(ComputedStyle* aStyle)
: nsHTMLButtonControlFrame(aStyle, kClassID) {}
nsGfxButtonControlFrame::nsGfxButtonControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsHTMLButtonControlFrame(aStyle, aPresContext, kClassID) {}
nsContainerFrame* NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsGfxButtonControlFrame(aStyle);
return new (aPresShell)
nsGfxButtonControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsGfxButtonControlFrame)

View File

@ -24,7 +24,8 @@ class nsGfxButtonControlFrame final : public nsHTMLButtonControlFrame,
public:
NS_DECL_FRAMEARENA_HELPERS(nsGfxButtonControlFrame)
explicit nsGfxButtonControlFrame(ComputedStyle* aStyle);
explicit nsGfxButtonControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
virtual void DestroyFrom(nsIFrame* aDestructRoot,
PostDestroyData& aPostDestroyData) override;

View File

@ -22,14 +22,16 @@ using namespace mozilla;
nsContainerFrame* NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsHTMLButtonControlFrame(aStyle);
return new (aPresShell)
nsHTMLButtonControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLButtonControlFrame)
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext,
nsIFrame::ClassID aID)
: nsContainerFrame(aStyle, aID) {}
: nsContainerFrame(aStyle, aPresContext, aID) {}
nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame() {}

View File

@ -18,8 +18,9 @@ class nsPresContext;
class nsHTMLButtonControlFrame : public nsContainerFrame,
public nsIFormControlFrame {
public:
explicit nsHTMLButtonControlFrame(ComputedStyle* aStyle)
: nsHTMLButtonControlFrame(aStyle, kClassID) {}
explicit nsHTMLButtonControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsHTMLButtonControlFrame(aStyle, aPresContext, kClassID) {}
~nsHTMLButtonControlFrame();
@ -97,7 +98,8 @@ class nsHTMLButtonControlFrame : public nsContainerFrame,
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
protected:
nsHTMLButtonControlFrame(ComputedStyle* aStyle, nsIFrame::ClassID aID);
nsHTMLButtonControlFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
nsIFrame::ClassID aID);
virtual bool IsInput() { return false; }

View File

@ -19,7 +19,8 @@ using namespace mozilla;
class nsImageControlFrame final : public nsImageFrame,
public nsIFormControlFrame {
public:
explicit nsImageControlFrame(ComputedStyle* aStyle);
explicit nsImageControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
~nsImageControlFrame();
virtual void DestroyFrom(nsIFrame* aDestructRoot,
@ -56,8 +57,9 @@ class nsImageControlFrame final : public nsImageFrame,
const nsAString& aValue) override;
};
nsImageControlFrame::nsImageControlFrame(ComputedStyle* aStyle)
: nsImageFrame(aStyle, kClassID) {}
nsImageControlFrame::nsImageControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsImageFrame(aStyle, aPresContext, kClassID) {}
nsImageControlFrame::~nsImageControlFrame() {}
@ -71,7 +73,8 @@ void nsImageControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
nsIFrame* NS_NewImageControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsImageControlFrame(aStyle);
return new (aPresShell)
nsImageControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsImageControlFrame)

View File

@ -25,7 +25,8 @@ nsIFrame* NS_NewLegendFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
"Legends should not be positioned and should not float");
#endif
nsIFrame* f = new (aPresShell) nsLegendFrame(aStyle);
nsIFrame* f =
new (aPresShell) nsLegendFrame(aStyle, aPresShell->GetPresContext());
f->AddStateBits(NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS);
return f;
}

View File

@ -15,8 +15,8 @@ class nsLegendFrame final : public nsBlockFrame {
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsLegendFrame)
explicit nsLegendFrame(ComputedStyle* aStyle)
: nsBlockFrame(aStyle, kClassID) {}
explicit nsLegendFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsBlockFrame(aStyle, aPresContext, kClassID) {}
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput,

View File

@ -82,7 +82,8 @@ class nsListEventListener final : public nsIDOMEventListener {
//---------------------------------------------------------
nsContainerFrame* NS_NewListControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
nsListControlFrame* it = new (aPresShell) nsListControlFrame(aStyle);
nsListControlFrame* it =
new (aPresShell) nsListControlFrame(aStyle, aPresShell->GetPresContext());
it->AddStateBits(NS_FRAME_INDEPENDENT_SELECTION);
@ -92,8 +93,9 @@ nsContainerFrame* NS_NewListControlFrame(nsIPresShell* aPresShell,
NS_IMPL_FRAMEARENA_HELPERS(nsListControlFrame)
//---------------------------------------------------------
nsListControlFrame::nsListControlFrame(ComputedStyle* aStyle)
: nsHTMLScrollFrame(aStyle, kClassID, false),
nsListControlFrame::nsListControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsHTMLScrollFrame(aStyle, aPresContext, kClassID, false),
mView(nullptr),
mMightNeedSecondPass(false),
mHasPendingInterruptAtStartOfReflow(false),

View File

@ -323,7 +323,8 @@ class nsListControlFrame final : public nsHTMLScrollFrame,
*/
virtual void ResetList(bool aAllowScrolling);
explicit nsListControlFrame(ComputedStyle* aStyle);
explicit nsListControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
virtual ~nsListControlFrame();
/**

View File

@ -27,13 +27,13 @@ using mozilla::dom::Element;
using mozilla::dom::HTMLMeterElement;
nsIFrame* NS_NewMeterFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsMeterFrame(aStyle);
return new (aPresShell) nsMeterFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsMeterFrame)
nsMeterFrame::nsMeterFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID), mBarDiv(nullptr) {}
nsMeterFrame::nsMeterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID), mBarDiv(nullptr) {}
nsMeterFrame::~nsMeterFrame() {}

View File

@ -23,7 +23,7 @@ class nsMeterFrame final : public nsContainerFrame,
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsMeterFrame)
explicit nsMeterFrame(ComputedStyle* aStyle);
explicit nsMeterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
virtual ~nsMeterFrame();
virtual void DestroyFrom(nsIFrame* aDestructRoot,

View File

@ -34,7 +34,8 @@ using namespace mozilla::dom;
nsIFrame* NS_NewNumberControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsNumberControlFrame(aStyle);
return new (aPresShell)
nsNumberControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsNumberControlFrame)
@ -45,8 +46,10 @@ NS_QUERYFRAME_HEAD(nsNumberControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
nsNumberControlFrame::nsNumberControlFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID), mHandlingInputEvent(false) {}
nsNumberControlFrame::nsNumberControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mHandlingInputEvent(false) {}
void nsNumberControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
PostDestroyData& aPostDestroyData) {

View File

@ -40,7 +40,8 @@ class nsNumberControlFrame final : public nsContainerFrame,
typedef mozilla::WidgetEvent WidgetEvent;
typedef mozilla::WidgetGUIEvent WidgetGUIEvent;
explicit nsNumberControlFrame(ComputedStyle* aStyle);
explicit nsNumberControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
public:
NS_DECL_QUERYFRAME

View File

@ -26,13 +26,14 @@ using namespace mozilla;
using namespace mozilla::dom;
nsIFrame* NS_NewProgressFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsProgressFrame(aStyle);
return new (aPresShell) nsProgressFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsProgressFrame)
nsProgressFrame::nsProgressFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID), mBarDiv(nullptr) {}
nsProgressFrame::nsProgressFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID), mBarDiv(nullptr) {}
nsProgressFrame::~nsProgressFrame() {}

View File

@ -25,7 +25,7 @@ class nsProgressFrame final : public nsContainerFrame,
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsProgressFrame)
explicit nsProgressFrame(ComputedStyle* aStyle);
explicit nsProgressFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
virtual ~nsProgressFrame();
virtual void DestroyFrom(nsIFrame* aDestructRoot,

View File

@ -41,11 +41,11 @@ using namespace mozilla::image;
NS_IMPL_ISUPPORTS(nsRangeFrame::DummyTouchListener, nsIDOMEventListener)
nsIFrame* NS_NewRangeFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsRangeFrame(aStyle);
return new (aPresShell) nsRangeFrame(aStyle, aPresShell->GetPresContext());
}
nsRangeFrame::nsRangeFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID) {}
nsRangeFrame::nsRangeFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
nsRangeFrame::~nsRangeFrame() {}

View File

@ -30,7 +30,7 @@ class nsRangeFrame final : public nsContainerFrame,
friend class nsDisplayRangeFocusRing;
explicit nsRangeFrame(ComputedStyle* aStyle);
explicit nsRangeFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
virtual ~nsRangeFrame();
typedef mozilla::CSSPseudoElementType CSSPseudoElementType;

View File

@ -14,7 +14,8 @@ using namespace mozilla;
nsContainerFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell,
ComputedStyle* aStyle,
nsFrameState aFlags) {
nsSelectsAreaFrame* it = new (aShell) nsSelectsAreaFrame(aStyle);
nsSelectsAreaFrame* it =
new (aShell) nsSelectsAreaFrame(aStyle, aShell->GetPresContext());
// We need NS_BLOCK_FLOAT_MGR to ensure that the options inside the select
// aren't expanded by right floats outside the select.

View File

@ -30,8 +30,9 @@ class nsSelectsAreaFrame final : public nsBlockFrame {
nscoord BSizeOfARow() const { return mBSizeOfARow; }
protected:
explicit nsSelectsAreaFrame(ComputedStyle* aStyle)
: nsBlockFrame(aStyle, kClassID),
explicit nsSelectsAreaFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsBlockFrame(aStyle, aPresContext, kClassID),
// initialize to wacky value so first call of
// nsSelectsAreaFrame::Reflow will always invalidate
mBSizeOfARow(nscoord_MIN) {}

View File

@ -53,7 +53,8 @@ using namespace mozilla::dom;
nsIFrame* NS_NewTextControlFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsTextControlFrame(aStyle);
return new (aPresShell)
nsTextControlFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsTextControlFrame)
@ -109,8 +110,9 @@ class nsTextControlFrame::nsAnonDivObserver final
nsTextControlFrame& mFrame;
};
nsTextControlFrame::nsTextControlFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID),
nsTextControlFrame::nsTextControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mFirstBaseline(NS_INTRINSIC_WIDTH_UNKNOWN),
mEditorHasBeenInitialized(false),
mIsProcessing(false)

View File

@ -36,7 +36,8 @@ class nsTextControlFrame final : public nsContainerFrame,
NS_DECLARE_FRAME_PROPERTY_DELETABLE(ContentScrollPos, nsPoint)
explicit nsTextControlFrame(ComputedStyle* aStyle);
explicit nsTextControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
virtual ~nsTextControlFrame();
virtual void DestroyFrom(nsIFrame* aDestructRoot,

View File

@ -69,8 +69,9 @@ class BRFrame final : public nsFrame {
#endif
protected:
explicit BRFrame(ComputedStyle* aStyle)
: nsFrame(aStyle, kClassID), mAscent(NS_INTRINSIC_WIDTH_UNKNOWN) {}
explicit BRFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsFrame(aStyle, aPresContext, kClassID),
mAscent(NS_INTRINSIC_WIDTH_UNKNOWN) {}
virtual ~BRFrame();
@ -80,7 +81,7 @@ class BRFrame final : public nsFrame {
} // namespace mozilla
nsIFrame* NS_NewBRFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) BRFrame(aStyle);
return new (aPresShell) BRFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(BRFrame)

View File

@ -15,7 +15,8 @@ using namespace mozilla;
nsBlockFrame* NS_NewColumnSetWrapperFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle,
nsFrameState aStateFlags) {
ColumnSetWrapperFrame* frame = new (aPresShell) ColumnSetWrapperFrame(aStyle);
ColumnSetWrapperFrame* frame = new (aPresShell)
ColumnSetWrapperFrame(aStyle, aPresShell->GetPresContext());
// CSS Multi-column level 1 section 2: A multi-column container
// establishes a new block formatting context, as per CSS 2.1 section
@ -30,8 +31,9 @@ NS_QUERYFRAME_HEAD(ColumnSetWrapperFrame)
NS_QUERYFRAME_ENTRY(ColumnSetWrapperFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
ColumnSetWrapperFrame::ColumnSetWrapperFrame(ComputedStyle* aStyle)
: nsBlockFrame(aStyle, kClassID) {}
ColumnSetWrapperFrame::ColumnSetWrapperFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsBlockFrame(aStyle, aPresContext, kClassID) {}
void ColumnSetWrapperFrame::Init(nsIContent* aContent,
nsContainerFrame* aParent,

View File

@ -53,7 +53,8 @@ class ColumnSetWrapperFrame final : public nsBlockFrame {
void MarkIntrinsicISizesDirty() override;
private:
explicit ColumnSetWrapperFrame(ComputedStyle* aStyle);
explicit ColumnSetWrapperFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
~ColumnSetWrapperFrame() override = default;
#ifdef DEBUG

View File

@ -25,13 +25,13 @@ NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
nsBlockFrame* NS_NewDetailsFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) DetailsFrame(aStyle);
return new (aPresShell) DetailsFrame(aStyle, aPresShell->GetPresContext());
}
namespace mozilla {
DetailsFrame::DetailsFrame(ComputedStyle* aStyle)
: nsBlockFrame(aStyle, kClassID) {}
DetailsFrame::DetailsFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsBlockFrame(aStyle, aPresContext, kClassID) {}
DetailsFrame::~DetailsFrame() {}

View File

@ -24,7 +24,7 @@ class DetailsFrame final : public nsBlockFrame,
NS_DECL_FRAMEARENA_HELPERS(DetailsFrame)
NS_DECL_QUERYFRAME
explicit DetailsFrame(ComputedStyle* aStyle);
explicit DetailsFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
virtual ~DetailsFrame();

View File

@ -27,7 +27,7 @@ typedef nsAbsoluteContainingBlock::AbsPosReflowFlags AbsPosReflowFlags;
ViewportFrame* NS_NewViewportFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) ViewportFrame(aStyle);
return new (aPresShell) ViewportFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(ViewportFrame)

View File

@ -31,8 +31,8 @@ class ViewportFrame : public nsContainerFrame {
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(ViewportFrame)
explicit ViewportFrame(ComputedStyle* aStyle)
: ViewportFrame(aStyle, kClassID) {}
explicit ViewportFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: ViewportFrame(aStyle, aPresContext, kClassID) {}
virtual ~ViewportFrame() {} // useful for debugging
@ -85,8 +85,8 @@ class ViewportFrame : public nsContainerFrame {
#endif
protected:
ViewportFrame(ComputedStyle* aStyle, ClassID aID)
: nsContainerFrame(aStyle, aID), mView(nullptr) {}
ViewportFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID)
: nsContainerFrame(aStyle, aPresContext, aID), mView(nullptr) {}
/**
* Calculate how much room is available for fixed frames. That means

View File

@ -36,8 +36,9 @@ class nsAtomicContainerFrame : public nsContainerFrame {
}
protected:
nsAtomicContainerFrame(ComputedStyle* aStyle, ClassID aID)
: nsContainerFrame(aStyle, aID) {}
nsAtomicContainerFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID)
: nsContainerFrame(aStyle, aPresContext, aID) {}
};
#endif // nsAtomicContainerFrame_h___

View File

@ -15,7 +15,8 @@ class nsBackdropFrame final : public nsFrame {
public:
NS_DECL_FRAMEARENA_HELPERS(nsBackdropFrame)
explicit nsBackdropFrame(ComputedStyle* aStyle) : nsFrame(aStyle, kClassID) {}
explicit nsBackdropFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsFrame(aStyle, aPresContext, kClassID) {}
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;

View File

@ -289,7 +289,7 @@ NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(BlockEndEdgeOfChildrenProperty, nscoord)
nsBlockFrame* NS_NewBlockFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsBlockFrame(aStyle);
return new (aPresShell) nsBlockFrame(aStyle, aPresShell->GetPresContext());
}
nsBlockFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
@ -6798,7 +6798,7 @@ void nsBlockFrame::CreateBulletFrameForListItem() {
ResolveBulletStyle(pseudoType, shell->StyleSet());
// Create bullet frame
nsBulletFrame* bullet = new (shell) nsBulletFrame(kidSC);
nsBulletFrame* bullet = new (shell) nsBulletFrame(kidSC, pc);
bullet->Init(mContent, this, nullptr);
// If the list bullet frame should be positioned inside then add

View File

@ -410,8 +410,9 @@ class nsBlockFrame : public nsContainerFrame {
void UpdateFirstLetterStyle(mozilla::ServoRestyleState& aRestyleState);
protected:
explicit nsBlockFrame(ComputedStyle* aStyle, ClassID aID = kClassID)
: nsContainerFrame(aStyle, aID),
explicit nsBlockFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID = kClassID)
: nsContainerFrame(aStyle, aPresContext, aID),
mMinWidth(NS_INTRINSIC_WIDTH_UNKNOWN),
mPrefWidth(NS_INTRINSIC_WIDTH_UNKNOWN) {
#ifdef DEBUG

View File

@ -49,8 +49,8 @@ class nsBulletFrame final : public nsFrame {
NS_DECL_QUERYFRAME
#endif
explicit nsBulletFrame(ComputedStyle* aStyle)
: nsFrame(aStyle, kClassID),
explicit nsBulletFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsFrame(aStyle, aPresContext, kClassID),
mPadding(GetWritingMode()),
mIntrinsicSize(GetWritingMode()),
mOrdinal(0),

View File

@ -45,7 +45,7 @@ using namespace mozilla::layers;
nsCanvasFrame* NS_NewCanvasFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsCanvasFrame(aStyle);
return new (aPresShell) nsCanvasFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsCanvasFrame)

View File

@ -36,8 +36,8 @@ class nsCanvasFrame final : public nsContainerFrame,
public nsIAnonymousContentCreator,
public nsIPopupContainer {
public:
explicit nsCanvasFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID),
explicit nsCanvasFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mDoPaintFocus(false),
mAddedScrollPositionListener(false),
mPopupSetFrame(nullptr) {}

View File

@ -102,15 +102,18 @@ bool nsDisplayColumnRule::CreateWebRenderCommands(
nsContainerFrame* NS_NewColumnSetFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle,
nsFrameState aStateFlags) {
nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame(aStyle);
nsColumnSetFrame* it =
new (aPresShell) nsColumnSetFrame(aStyle, aPresShell->GetPresContext());
it->AddStateBits(aStateFlags);
return it;
}
NS_IMPL_FRAMEARENA_HELPERS(nsColumnSetFrame)
nsColumnSetFrame::nsColumnSetFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID), mLastBalanceBSize(NS_INTRINSICSIZE) {}
nsColumnSetFrame::nsColumnSetFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mLastBalanceBSize(NS_INTRINSICSIZE) {}
void nsColumnSetFrame::ForEachColumnRule(
const std::function<void(const nsRect& lineRect)>& aSetLineRect,

View File

@ -22,7 +22,7 @@ class nsColumnSetFrame final : public nsContainerFrame {
public:
NS_DECL_FRAMEARENA_HELPERS(nsColumnSetFrame)
explicit nsColumnSetFrame(ComputedStyle* aStyle);
explicit nsColumnSetFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput,

View File

@ -508,8 +508,9 @@ class nsContainerFrame : public nsSplittableFrame {
#endif
protected:
nsContainerFrame(ComputedStyle* aStyle, ClassID aID)
: nsSplittableFrame(aStyle, aID) {}
nsContainerFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID)
: nsSplittableFrame(aStyle, aPresContext, aID) {}
~nsContainerFrame();

View File

@ -23,7 +23,8 @@ using namespace mozilla::layout;
nsFirstLetterFrame* NS_NewFirstLetterFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsFirstLetterFrame(aStyle);
return new (aPresShell)
nsFirstLetterFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsFirstLetterFrame)

View File

@ -17,8 +17,9 @@ class nsFirstLetterFrame final : public nsContainerFrame {
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsFirstLetterFrame)
explicit nsFirstLetterFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID) {}
explicit nsFirstLetterFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) override;

View File

@ -2325,7 +2325,8 @@ NS_IMPL_FRAMEARENA_HELPERS(nsFlexContainerFrame)
nsContainerFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsFlexContainerFrame(aStyle);
return new (aPresShell)
nsFlexContainerFrame(aStyle, aPresShell->GetPresContext());
}
//----------------------------------------------------------------------

View File

@ -232,8 +232,9 @@ class nsFlexContainerFrame final : public nsContainerFrame {
protected:
// Protected constructor & destructor
explicit nsFlexContainerFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID),
explicit nsFlexContainerFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mCachedMinISize(NS_INTRINSIC_WIDTH_UNKNOWN),
mCachedPrefISize(NS_INTRINSIC_WIDTH_UNKNOWN),
mBaselineFromLastReflow(NS_INTRINSIC_WIDTH_UNKNOWN),

View File

@ -467,14 +467,13 @@ void WeakFrame::Init(nsIFrame* aFrame) {
}
nsIFrame* NS_NewEmptyFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsFrame(aStyle);
return new (aPresShell) nsFrame(aStyle, aPresShell->GetPresContext());
}
nsFrame::nsFrame(ComputedStyle* aStyle, ClassID aID) : nsBox(aID) {
nsFrame::nsFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID)
: nsBox(aStyle, aPresContext, aID) {
MOZ_COUNT_CTOR(nsFrame);
mComputedStyle = aStyle;
mWritingMode = WritingMode(mComputedStyle);
}
nsFrame::~nsFrame() {
@ -1201,8 +1200,6 @@ void nsIFrame::MarkNeedsDisplayItemRebuild() {
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
void nsIFrame::AssertNewStyleIsSane(ComputedStyle& aNewStyle) {
MOZ_DIAGNOSTIC_ASSERT(PresShell() ==
aNewStyle.PresContextForFrame()->PresShell());
MOZ_DIAGNOSTIC_ASSERT(
aNewStyle.GetPseudo() == mComputedStyle->GetPseudo() ||
// ::first-line continuations are weird, this should probably be fixed via

View File

@ -541,9 +541,9 @@ class nsFrame : public nsBox {
protected:
// Protected constructor and destructor
nsFrame(ComputedStyle* aStyle, ClassID aID);
explicit nsFrame(ComputedStyle* aStyle)
: nsFrame(aStyle, ClassID::nsFrame_id) {}
nsFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID);
explicit nsFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsFrame(aStyle, aPresContext, ClassID::nsFrame_id) {}
virtual ~nsFrame();
/**

View File

@ -104,7 +104,7 @@ class nsHTMLFramesetBorderFrame final : public nsLeafFrame {
void PaintBorder(DrawTarget* aDrawTarget, nsPoint aPt);
protected:
nsHTMLFramesetBorderFrame(ComputedStyle* aStyle, int32_t aWidth,
nsHTMLFramesetBorderFrame(ComputedStyle*, nsPresContext*, int32_t aWidth,
bool aVertical, bool aVisible);
virtual ~nsHTMLFramesetBorderFrame();
virtual nscoord GetIntrinsicISize() override;
@ -144,8 +144,9 @@ class nsHTMLFramesetBlankFrame final : public nsLeafFrame {
nsReflowStatus& aStatus) override;
protected:
explicit nsHTMLFramesetBlankFrame(ComputedStyle* aStyle)
: nsLeafFrame(aStyle, kClassID) {}
explicit nsHTMLFramesetBlankFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsLeafFrame(aStyle, aPresContext, kClassID) {}
virtual ~nsHTMLFramesetBlankFrame();
virtual nscoord GetIntrinsicISize() override;
@ -161,8 +162,9 @@ class nsHTMLFramesetBlankFrame final : public nsLeafFrame {
bool nsHTMLFramesetFrame::gDragInProgress = false;
#define DEFAULT_BORDER_WIDTH_PX 6
nsHTMLFramesetFrame::nsHTMLFramesetFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID) {
nsHTMLFramesetFrame::nsHTMLFramesetFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID) {
mNumRows = 0;
mNumCols = 0;
mEdgeVisibility = 0;
@ -319,8 +321,8 @@ void nsHTMLFramesetFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
// XXX the blank frame is using the content of its parent - at some point it
// should just have null content, if we support that
nsHTMLFramesetBlankFrame* blankFrame =
new (shell) nsHTMLFramesetBlankFrame(pseudoComputedStyle);
nsHTMLFramesetBlankFrame* blankFrame = new (shell)
nsHTMLFramesetBlankFrame(pseudoComputedStyle, PresContext());
blankFrame->Init(mContent, this, nullptr);
@ -876,7 +878,7 @@ void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
nsCSSAnonBoxes::horizontalFramesetBorder());
borderFrame = new (shell) nsHTMLFramesetBorderFrame(
pseudoComputedStyle, borderWidth, false, false);
pseudoComputedStyle, PresContext(), borderWidth, false, false);
borderFrame->Init(mContent, this, nullptr);
mChildCount++;
mFrames.AppendFrame(nullptr, borderFrame);
@ -905,7 +907,7 @@ void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
nsCSSAnonBoxes::verticalFramesetBorder());
borderFrame = new (shell) nsHTMLFramesetBorderFrame(
pseudoComputedStyle, borderWidth, true, false);
pseudoComputedStyle, PresContext(), borderWidth, true, false);
borderFrame->Init(mContent, this, nullptr);
mChildCount++;
mFrames.AppendFrame(nullptr, borderFrame);
@ -1268,7 +1270,8 @@ nsIFrame* NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell,
"Framesets should not be positioned and should not float");
#endif
return new (aPresShell) nsHTMLFramesetFrame(aStyle);
return new (aPresShell)
nsHTMLFramesetFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLFramesetFrame)
@ -1276,11 +1279,10 @@ NS_IMPL_FRAMEARENA_HELPERS(nsHTMLFramesetFrame)
/*******************************************************************************
* nsHTMLFramesetBorderFrame
******************************************************************************/
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(ComputedStyle* aStyle,
int32_t aWidth,
bool aVertical,
bool aVisibility)
: nsLeafFrame(aStyle, kClassID),
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(
ComputedStyle* aStyle, nsPresContext* aPresContext, int32_t aWidth,
bool aVertical, bool aVisibility)
: nsLeafFrame(aStyle, aPresContext, kClassID),
mWidth(aWidth),
mVertical(aVertical),
mVisibility(aVisibility) {

View File

@ -65,7 +65,8 @@ class nsHTMLFramesetFrame final : public nsContainerFrame {
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsHTMLFramesetFrame)
explicit nsHTMLFramesetFrame(ComputedStyle* aStyle);
explicit nsHTMLFramesetFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
virtual ~nsHTMLFramesetFrame();

View File

@ -109,14 +109,16 @@ static uint32_t GetOverflowChange(const nsRect& aCurScrolledRect,
nsHTMLScrollFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle, bool aIsRoot) {
return new (aPresShell) nsHTMLScrollFrame(aStyle, aIsRoot);
return new (aPresShell)
nsHTMLScrollFrame(aStyle, aPresShell->GetPresContext(), aIsRoot);
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLScrollFrame)
nsHTMLScrollFrame::nsHTMLScrollFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext,
nsIFrame::ClassID aID, bool aIsRoot)
: nsContainerFrame(aStyle, aID),
: nsContainerFrame(aStyle, aPresContext, aID),
mHelper(ALLOW_THIS_IN_INITIALIZER_LIST(this), aIsRoot) {}
void nsHTMLScrollFrame::ScrollbarActivityStarted() const {
@ -1198,15 +1200,16 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
nsXULScrollFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle, bool aIsRoot,
bool aClipAllDescendants) {
return new (aPresShell)
nsXULScrollFrame(aStyle, aIsRoot, aClipAllDescendants);
return new (aPresShell) nsXULScrollFrame(aStyle, aPresShell->GetPresContext(),
aIsRoot, aClipAllDescendants);
}
NS_IMPL_FRAMEARENA_HELPERS(nsXULScrollFrame)
nsXULScrollFrame::nsXULScrollFrame(ComputedStyle* aStyle, bool aIsRoot,
nsXULScrollFrame::nsXULScrollFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext, bool aIsRoot,
bool aClipAllDescendants)
: nsBoxFrame(aStyle, kClassID, aIsRoot),
: nsBoxFrame(aStyle, aPresContext, kClassID, aIsRoot),
mHelper(ALLOW_THIS_IN_INITIALIZER_LIST(this), aIsRoot) {
SetXULLayoutManager(nullptr);
mHelper.mClipAllDescendants = aClipAllDescendants;

View File

@ -1187,10 +1187,12 @@ class nsHTMLScrollFrame : public nsContainerFrame,
#endif
protected:
nsHTMLScrollFrame(ComputedStyle* aStyle, bool aIsRoot)
: nsHTMLScrollFrame(aStyle, kClassID, aIsRoot) {}
nsHTMLScrollFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
bool aIsRoot)
: nsHTMLScrollFrame(aStyle, aPresContext, kClassID, aIsRoot) {}
nsHTMLScrollFrame(ComputedStyle* aStyle, nsIFrame::ClassID aID, bool aIsRoot);
nsHTMLScrollFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
nsIFrame::ClassID aID, bool aIsRoot);
void SetSuppressScrollbarUpdate(bool aSuppress) {
mHelper.mSuppressScrollbarUpdate = aSuppress;
}
@ -1658,7 +1660,7 @@ class nsXULScrollFrame final : public nsBoxFrame,
#endif
protected:
nsXULScrollFrame(ComputedStyle* aStyle, bool aIsRoot,
nsXULScrollFrame(ComputedStyle*, nsPresContext*, bool aIsRoot,
bool aClipAllDescendants);
void ClampAndSetBounds(nsBoxLayoutState& aState, nsRect& aRect,

View File

@ -2491,7 +2491,8 @@ NS_IMPL_FRAMEARENA_HELPERS(nsGridContainerFrame)
nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsGridContainerFrame(aStyle);
return new (aPresShell)
nsGridContainerFrame(aStyle, aPresShell->GetPresContext());
}
//----------------------------------------------------------------------

View File

@ -276,8 +276,9 @@ class nsGridContainerFrame final : public nsContainerFrame {
struct TranslatedLineRange;
friend nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle);
explicit nsGridContainerFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID),
explicit nsGridContainerFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mCachedMinISize(NS_INTRINSIC_WIDTH_UNKNOWN),
mCachedPrefISize(NS_INTRINSIC_WIDTH_UNKNOWN) {
mBaseline[0][0] = NS_INTRINSIC_WIDTH_UNKNOWN;

View File

@ -227,7 +227,8 @@ class nsDisplayCanvas final : public nsDisplayItem {
nsIFrame* NS_NewHTMLCanvasFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsHTMLCanvasFrame(aStyle);
return new (aPresShell)
nsHTMLCanvasFrame(aStyle, aPresShell->GetPresContext());
}
NS_QUERYFRAME_HEAD(nsHTMLCanvasFrame)

View File

@ -39,8 +39,9 @@ class nsHTMLCanvasFrame final : public nsContainerFrame {
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsHTMLCanvasFrame)
explicit nsHTMLCanvasFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID), mBorderPadding(GetWritingMode()) {}
explicit nsHTMLCanvasFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mBorderPadding(GetWritingMode()) {}
virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;

View File

@ -573,14 +573,17 @@ class nsIFrame : public nsQueryFrame {
NS_DECL_QUERYFRAME_TARGET(nsIFrame)
explicit nsIFrame(ClassID aID)
explicit nsIFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID)
: mRect(),
mContent(nullptr),
mComputedStyle(nullptr),
mComputedStyle(aStyle),
mPresContext(aPresContext),
mParent(nullptr),
mNextSibling(nullptr),
mPrevSibling(nullptr),
mState(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY),
mWritingMode(aStyle),
mClass(aID),
mMayHaveRoundedCorners(false),
mHasImageRequest(false),
@ -598,10 +601,12 @@ class nsIFrame : public nsQueryFrame {
mMayHaveOpacityAnimation(false),
mAllDescendantsAreInvisible(false),
mInScrollAnchorChain(false) {
MOZ_ASSERT(mComputedStyle);
MOZ_ASSERT(mPresContext);
mozilla::PodZero(&mOverflow);
}
nsPresContext* PresContext() const { return Style()->PresContextForFrame(); }
nsPresContext* PresContext() const { return mPresContext; }
nsIPresShell* PresShell() const { return PresContext()->PresShell(); }
@ -777,8 +782,6 @@ class nsIFrame : public nsQueryFrame {
*/
void SetComputedStyleWithoutNotification(ComputedStyle* aStyle) {
if (aStyle != mComputedStyle) {
MOZ_DIAGNOSTIC_ASSERT(PresShell() ==
aStyle->PresContextForFrame()->PresShell());
mComputedStyle = aStyle;
}
}
@ -4162,6 +4165,7 @@ class nsIFrame : public nsQueryFrame {
RefPtr<ComputedStyle> mComputedStyle;
private:
nsPresContext* const mPresContext;
nsContainerFrame* mParent;
nsIFrame* mNextSibling; // doubly-linked list of frames
nsIFrame* mPrevSibling; // Do not touch outside SetNextSibling!

View File

@ -92,6 +92,8 @@ using namespace mozilla::gfx;
using namespace mozilla::image;
using namespace mozilla::layers;
using mozilla::layout::TextDrawTarget;
// sizes (pixels) for image icon, padding and border frame
#define ICON_SIZE (16)
#define ICON_PADDING (3)
@ -130,20 +132,21 @@ static bool HaveFixedSize(const ReflowInput& aReflowInput) {
}
nsIFrame* NS_NewImageFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell)
nsImageFrame(aStyle, nsImageFrame::Kind::ImageElement);
return new (aPresShell) nsImageFrame(aStyle, aPresShell->GetPresContext(),
nsImageFrame::Kind::ImageElement);
}
nsIFrame* NS_NewImageFrameForContentProperty(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell)
nsImageFrame(aStyle, nsImageFrame::Kind::ContentProperty);
return new (aPresShell) nsImageFrame(aStyle, aPresShell->GetPresContext(),
nsImageFrame::Kind::ContentProperty);
}
nsIFrame* NS_NewImageFrameForGeneratedContentIndex(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell)
nsImageFrame(aStyle, nsImageFrame::Kind::ContentPropertyAtIndex);
nsImageFrame(aStyle, aPresShell->GetPresContext(),
nsImageFrame::Kind::ContentPropertyAtIndex);
}
bool nsImageFrame::ShouldShowBrokenImageIcon() const {
@ -169,13 +172,15 @@ bool nsImageFrame::ShouldShowBrokenImageIcon() const {
nsImageFrame* nsImageFrame::CreateContinuingFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) const {
return new (aPresShell) nsImageFrame(aStyle, mKind);
return new (aPresShell)
nsImageFrame(aStyle, aPresShell->GetPresContext(), mKind);
}
NS_IMPL_FRAMEARENA_HELPERS(nsImageFrame)
nsImageFrame::nsImageFrame(ComputedStyle* aStyle, ClassID aID, Kind aKind)
: nsAtomicContainerFrame(aStyle, aID),
nsImageFrame::nsImageFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID, Kind aKind)
: nsAtomicContainerFrame(aStyle, aPresContext, aID),
mComputedSize(0, 0),
mIntrinsicRatio(0, 0),
mKind(aKind),

View File

@ -202,14 +202,14 @@ class nsImageFrame : public nsAtomicContainerFrame, public nsIReflowCallback {
friend nsIFrame* NS_NewImageFrameForGeneratedContentIndex(nsIPresShell*,
ComputedStyle*);
nsImageFrame(ComputedStyle* aStyle, Kind aKind)
: nsImageFrame(aStyle, kClassID, aKind) {}
nsImageFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, Kind aKind)
: nsImageFrame(aStyle, aPresContext, kClassID, aKind) {}
nsImageFrame(ComputedStyle*, ClassID, Kind);
nsImageFrame(ComputedStyle*, nsPresContext* aPresContext, ClassID, Kind);
protected:
nsImageFrame(ComputedStyle* aStyle, ClassID aID)
: nsImageFrame(aStyle, aID, Kind::ImageElement) {}
nsImageFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID)
: nsImageFrame(aStyle, aPresContext, aID, Kind::ImageElement) {}
virtual ~nsImageFrame();

View File

@ -36,7 +36,7 @@ using namespace mozilla::layout;
nsInlineFrame* NS_NewInlineFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsInlineFrame(aStyle);
return new (aPresShell) nsInlineFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsInlineFrame)
@ -931,7 +931,8 @@ void nsInlineFrame::UpdateStyleOfOwnedAnonBoxesForIBSplit(
nsFirstLineFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsFirstLineFrame(aStyle);
return new (aPresShell)
nsFirstLineFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsFirstLineFrame)

View File

@ -138,8 +138,9 @@ class nsInlineFrame : public nsContainerFrame {
}
};
nsInlineFrame(ComputedStyle* aStyle, ClassID aID)
: nsContainerFrame(aStyle, aID), mBaseline(NS_INTRINSIC_WIDTH_UNKNOWN) {}
nsInlineFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID)
: nsContainerFrame(aStyle, aPresContext, aID),
mBaseline(NS_INTRINSIC_WIDTH_UNKNOWN) {}
virtual LogicalSides GetLogicalSkipSides(
const ReflowInput* aReflowInput = nullptr) const override;
@ -162,8 +163,8 @@ class nsInlineFrame : public nsContainerFrame {
nsIFrame* aPrevSibling, InlineReflowInput& aState);
private:
explicit nsInlineFrame(ComputedStyle* aStyle)
: nsInlineFrame(aStyle, kClassID) {}
explicit nsInlineFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsInlineFrame(aStyle, aPresContext, kClassID) {}
/**
* Move any frames on our overflow list to the end of our principal list.
@ -202,8 +203,8 @@ class nsFirstLineFrame final : public nsInlineFrame {
virtual bool DrainSelfOverflowList() override;
protected:
explicit nsFirstLineFrame(ComputedStyle* aStyle)
: nsInlineFrame(aStyle, kClassID) {}
explicit nsFirstLineFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsInlineFrame(aStyle, aPresContext, kClassID) {}
nsIFrame* PullOneFrame(nsPresContext*, InlineReflowInput&) override;
};

View File

@ -60,7 +60,8 @@ class nsLeafFrame : public nsFrame {
}
protected:
nsLeafFrame(ComputedStyle* aStyle, ClassID aID) : nsFrame(aStyle, aID) {}
nsLeafFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID)
: nsFrame(aStyle, aPresContext, aID) {}
virtual ~nsLeafFrame();

View File

@ -14,7 +14,8 @@ using namespace mozilla;
nsPageContentFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsPageContentFrame(aStyle);
return new (aPresShell)
nsPageContentFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsPageContentFrame)

View File

@ -46,8 +46,9 @@ class nsPageContentFrame final : public mozilla::ViewportFrame {
#endif
protected:
explicit nsPageContentFrame(ComputedStyle* aStyle)
: ViewportFrame(aStyle, kClassID) {}
explicit nsPageContentFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: ViewportFrame(aStyle, aPresContext, kClassID) {}
nsSharedPageData* mPD;
};

View File

@ -29,7 +29,7 @@ using namespace mozilla;
using namespace mozilla::gfx;
nsPageFrame* NS_NewPageFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsPageFrame(aStyle);
return new (aPresShell) nsPageFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsPageFrame)
@ -38,8 +38,8 @@ NS_QUERYFRAME_HEAD(nsPageFrame)
NS_QUERYFRAME_ENTRY(nsPageFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
nsPageFrame::nsPageFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID) {}
nsPageFrame::nsPageFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
nsPageFrame::~nsPageFrame() {}
@ -637,13 +637,15 @@ nsIFrame* NS_NewPageBreakFrame(nsIPresShell* aPresShell,
NS_ASSERTION(aPresShell->GetPresContext()->IsPaginated(),
"created a page break frame while not printing");
return new (aPresShell) nsPageBreakFrame(aStyle);
return new (aPresShell)
nsPageBreakFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsPageBreakFrame)
nsPageBreakFrame::nsPageBreakFrame(ComputedStyle* aStyle)
: nsLeafFrame(aStyle, kClassID), mHaveReflowed(false) {}
nsPageBreakFrame::nsPageBreakFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsLeafFrame(aStyle, aPresContext, kClassID), mHaveReflowed(false) {}
nsPageBreakFrame::~nsPageBreakFrame() {}

View File

@ -55,7 +55,7 @@ class nsPageFrame final : public nsContainerFrame {
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
protected:
explicit nsPageFrame(ComputedStyle* aStyle);
explicit nsPageFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
virtual ~nsPageFrame();
typedef enum { eHeader, eFooter } nsHeaderFooterEnum;
@ -89,7 +89,7 @@ class nsPageFrame final : public nsContainerFrame {
class nsPageBreakFrame final : public nsLeafFrame {
NS_DECL_FRAMEARENA_HELPERS(nsPageBreakFrame)
explicit nsPageBreakFrame(ComputedStyle* aStyle);
explicit nsPageBreakFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
~nsPageBreakFrame();
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,

View File

@ -29,7 +29,8 @@ using namespace mozilla::gfx;
nsPlaceholderFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle,
nsFrameState aTypeBits) {
return new (aPresShell) nsPlaceholderFrame(aStyle, aTypeBits);
return new (aPresShell)
nsPlaceholderFrame(aStyle, aPresShell->GetPresContext(), aTypeBits);
}
NS_IMPL_FRAMEARENA_HELPERS(nsPlaceholderFrame)

View File

@ -67,8 +67,9 @@ class nsPlaceholderFrame final : public nsFrame {
ComputedStyle* aStyle,
nsFrameState aTypeBits);
nsPlaceholderFrame(ComputedStyle* aStyle, nsFrameState aTypeBits)
: nsFrame(aStyle, kClassID), mOutOfFlowFrame(nullptr) {
nsPlaceholderFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
nsFrameState aTypeBits)
: nsFrame(aStyle, aPresContext, kClassID), mOutOfFlowFrame(nullptr) {
MOZ_ASSERT(
aTypeBits == PLACEHOLDER_FOR_FLOAT ||
aTypeBits == PLACEHOLDER_FOR_ABSPOS ||

View File

@ -133,8 +133,8 @@ class PluginBackgroundSink : public ReadbackSink {
nsPluginFrame* mFrame;
};
nsPluginFrame::nsPluginFrame(ComputedStyle* aStyle)
: nsFrame(aStyle, kClassID),
nsPluginFrame::nsPluginFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsFrame(aStyle, aPresContext, kClassID),
mInstanceOwner(nullptr),
mOuterView(nullptr),
mInnerView(nullptr),
@ -1685,7 +1685,7 @@ nsIObjectFrame* nsPluginFrame::GetNextObjectFrame(nsPresContext* aPresContext,
}
nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsPluginFrame(aStyle);
return new (aPresShell) nsPluginFrame(aStyle, aPresShell->GetPresContext());
}
bool nsPluginFrame::IsPaintedByGecko() const {

View File

@ -231,7 +231,7 @@ class nsPluginFrame final : public nsFrame,
nsDisplayListBuilder* aDisplayListBuilder);
protected:
explicit nsPluginFrame(ComputedStyle* aStyle);
explicit nsPluginFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
virtual ~nsPluginFrame();
// NOTE: This frame class does not inherit from |nsLeafFrame|, so

View File

@ -37,7 +37,8 @@ NS_IMPL_FRAMEARENA_HELPERS(nsRubyBaseContainerFrame)
nsContainerFrame* NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsRubyBaseContainerFrame(aStyle);
return new (aPresShell)
nsRubyBaseContainerFrame(aStyle, aPresShell->GetPresContext());
}
//----------------------------------------------------------------------

View File

@ -58,8 +58,9 @@ class nsRubyBaseContainerFrame final : public nsContainerFrame {
friend nsContainerFrame* NS_NewRubyBaseContainerFrame(
nsIPresShell* aPresShell, ComputedStyle* aStyle);
explicit nsRubyBaseContainerFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID) {}
explicit nsRubyBaseContainerFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
struct RubyReflowInput;
nscoord ReflowColumns(const RubyReflowInput& aReflowInput,

View File

@ -28,7 +28,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsRubyBaseFrame)
nsContainerFrame* NS_NewRubyBaseFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsRubyBaseFrame(aStyle);
return new (aPresShell) nsRubyBaseFrame(aStyle, aPresShell->GetPresContext());
}
//----------------------------------------------------------------------

View File

@ -30,8 +30,8 @@ class nsRubyBaseFrame final : public nsRubyContentFrame {
protected:
friend nsContainerFrame* NS_NewRubyBaseFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle);
explicit nsRubyBaseFrame(ComputedStyle* aStyle)
: nsRubyContentFrame(aStyle, kClassID) {}
explicit nsRubyBaseFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsRubyContentFrame(aStyle, aPresContext, kClassID) {}
};
#endif /* nsRubyBaseFrame_h___ */

View File

@ -26,8 +26,9 @@ class nsRubyContentFrame : public nsInlineFrame {
bool IsIntraLevelWhitespace() const;
protected:
nsRubyContentFrame(ComputedStyle* aStyle, ClassID aID)
: nsInlineFrame(aStyle, aID) {}
nsRubyContentFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID)
: nsInlineFrame(aStyle, aPresContext, aID) {}
};
#endif /* nsRubyContentFrame_h___ */

View File

@ -32,7 +32,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsRubyFrame)
nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsRubyFrame(aStyle);
return new (aPresShell) nsRubyFrame(aStyle, aPresShell->GetPresContext());
}
//----------------------------------------------------------------------

View File

@ -43,8 +43,8 @@ class nsRubyFrame final : public nsInlineFrame {
protected:
friend nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle);
explicit nsRubyFrame(ComputedStyle* aStyle)
: nsInlineFrame(aStyle, kClassID) {}
explicit nsRubyFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsInlineFrame(aStyle, aPresContext, kClassID) {}
void ReflowSegment(nsPresContext* aPresContext,
const ReflowInput& aReflowInput,

View File

@ -29,7 +29,8 @@ NS_IMPL_FRAMEARENA_HELPERS(nsRubyTextContainerFrame)
nsContainerFrame* NS_NewRubyTextContainerFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsRubyTextContainerFrame(aStyle);
return new (aPresShell)
nsRubyTextContainerFrame(aStyle, aPresShell->GetPresContext());
}
//----------------------------------------------------------------------

View File

@ -50,8 +50,9 @@ class nsRubyTextContainerFrame final : public nsContainerFrame {
friend nsContainerFrame* NS_NewRubyTextContainerFrame(
nsIPresShell* aPresShell, ComputedStyle* aStyle);
explicit nsRubyTextContainerFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID), mISize(0) {}
explicit nsRubyTextContainerFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID), mISize(0) {}
void UpdateSpanFlag();

View File

@ -28,7 +28,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsRubyTextFrame)
nsContainerFrame* NS_NewRubyTextFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsRubyTextFrame(aStyle);
return new (aPresShell) nsRubyTextFrame(aStyle, aPresShell->GetPresContext());
}
//----------------------------------------------------------------------

View File

@ -44,8 +44,8 @@ class nsRubyTextFrame final : public nsRubyContentFrame {
protected:
friend nsContainerFrame* NS_NewRubyTextFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle);
explicit nsRubyTextFrame(ComputedStyle* aStyle)
: nsRubyContentFrame(aStyle, kClassID) {}
explicit nsRubyTextFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsRubyContentFrame(aStyle, aPresContext, kClassID) {}
};
#endif /* nsRubyTextFrame_h___ */

View File

@ -38,13 +38,15 @@ mozilla::LazyLogModule gLayoutPrintingLog("printing-layout");
nsSimplePageSequenceFrame* NS_NewSimplePageSequenceFrame(
nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsSimplePageSequenceFrame(aStyle);
return new (aPresShell)
nsSimplePageSequenceFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsSimplePageSequenceFrame)
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID),
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(
ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID),
mTotalPages(-1),
mCalledBeginPage(false),
mCurrentCanvasListSetup(false) {

View File

@ -103,7 +103,7 @@ class nsSimplePageSequenceFrame final : public nsContainerFrame,
#endif
protected:
explicit nsSimplePageSequenceFrame(ComputedStyle* aStyle);
nsSimplePageSequenceFrame(ComputedStyle*, nsPresContext*);
virtual ~nsSimplePageSequenceFrame();
void SetPageNumberFormat(const char* aPropName, const char* aDefPropVal,

View File

@ -74,8 +74,9 @@ class nsSplittableFrame : public nsFrame {
static void RemoveFromFlow(nsIFrame* aFrame);
protected:
nsSplittableFrame(ComputedStyle* aStyle, ClassID aID)
: nsFrame(aStyle, aID),
nsSplittableFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID)
: nsFrame(aStyle, aPresContext, aID),
mPrevContinuation(nullptr),
mNextContinuation(nullptr) {}

View File

@ -59,8 +59,9 @@ static Document* GetDocumentFromView(nsView* aView) {
return ps ? ps->GetDocument() : nullptr;
}
nsSubDocumentFrame::nsSubDocumentFrame(ComputedStyle* aStyle)
: nsAtomicContainerFrame(aStyle, kClassID),
nsSubDocumentFrame::nsSubDocumentFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsAtomicContainerFrame(aStyle, aPresContext, kClassID),
mOuterView(nullptr),
mInnerView(nullptr),
mIsInline(false),
@ -876,7 +877,8 @@ nsresult nsSubDocumentFrame::AttributeChanged(int32_t aNameSpaceID,
nsIFrame* NS_NewSubDocumentFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsSubDocumentFrame(aStyle);
return new (aPresShell)
nsSubDocumentFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsSubDocumentFrame)

View File

@ -27,7 +27,8 @@ class nsSubDocumentFrame final : public nsAtomicContainerFrame,
public:
NS_DECL_FRAMEARENA_HELPERS(nsSubDocumentFrame)
explicit nsSubDocumentFrame(ComputedStyle* aStyle);
explicit nsSubDocumentFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
#ifdef DEBUG_FRAME_DUMP
void List(FILE* out = stderr, const char* aPrefix = "",

View File

@ -4408,8 +4408,9 @@ class nsContinuingTextFrame final : public nsTextFrame {
InlinePrefISizeData* aData) final;
protected:
explicit nsContinuingTextFrame(ComputedStyle* aStyle)
: nsTextFrame(aStyle, kClassID) {}
explicit nsContinuingTextFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsTextFrame(aStyle, aPresContext, kClassID) {}
nsTextFrame* mPrevContinuation;
};
@ -4573,14 +4574,15 @@ static void VerifyNotDirty(nsFrameState state) {
#endif
nsIFrame* NS_NewTextFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsTextFrame(aStyle);
return new (aPresShell) nsTextFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsTextFrame)
nsIFrame* NS_NewContinuingTextFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsContinuingTextFrame(aStyle);
return new (aPresShell)
nsContinuingTextFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsContinuingTextFrame)

View File

@ -52,8 +52,9 @@ class nsTextFrame : public nsFrame {
typedef gfxTextRun::Range Range;
public:
explicit nsTextFrame(ComputedStyle* aStyle, ClassID aID = kClassID)
: nsFrame(aStyle, aID),
explicit nsTextFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
ClassID aID = kClassID)
: nsFrame(aStyle, aPresContext, aID),
mNextContinuation(nullptr),
mContentOffset(0),
mContentLengthHint(0),

View File

@ -36,7 +36,7 @@ using namespace mozilla::gfx;
nsIFrame* NS_NewHTMLVideoFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsVideoFrame(aStyle);
return new (aPresShell) nsVideoFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsVideoFrame)
@ -71,8 +71,8 @@ static void SwapScaleWidthHeightForRotation(IntSize& aSize,
}
}
nsVideoFrame::nsVideoFrame(ComputedStyle* aStyle)
: nsContainerFrame(aStyle, kClassID) {
nsVideoFrame::nsVideoFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsContainerFrame(aStyle, aPresContext, kClassID) {
EnableVisibilityTracking();
}

View File

@ -38,7 +38,7 @@ class nsVideoFrame final : public nsContainerFrame,
typedef mozilla::layers::LayerManager LayerManager;
typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
explicit nsVideoFrame(ComputedStyle* aStyle);
explicit nsVideoFrame(ComputedStyle*, nsPresContext*);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsVideoFrame)

View File

@ -1451,7 +1451,8 @@ nsresult nsMathMLContainerFrame::ReportInvalidChildError(nsAtom* aChildTag) {
nsContainerFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
auto newFrame = new (aPresShell) nsMathMLmathBlockFrame(aStyle);
auto newFrame = new (aPresShell)
nsMathMLmathBlockFrame(aStyle, aPresShell->GetPresContext());
newFrame->AddStateBits(NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS);
return newFrame;
}
@ -1464,7 +1465,8 @@ NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
nsContainerFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle) {
return new (aPresShell) nsMathMLmathInlineFrame(aStyle);
return new (aPresShell)
nsMathMLmathInlineFrame(aStyle, aPresShell->GetPresContext());
}
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmathInlineFrame)

Some files were not shown because too many files have changed in this diff Show More