diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index 5192fbdd55bb..ba813c13c213 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -190,7 +190,6 @@ void nsColumnSetFrame::CreateBorderRenderers( else ruleStyle = colStyle->mColumnRuleStyle; - nsPresContext* presContext = PresContext(); nscoord ruleWidth = colStyle->GetComputedColumnRuleWidth(); if (!ruleWidth) return; @@ -198,12 +197,13 @@ void nsColumnSetFrame::CreateBorderRenderers( nscolor ruleColor = GetVisitedDependentColor(&nsStyleColumn::mColumnRuleColor); + nsPresContext* presContext = PresContext(); // In order to re-use a large amount of code, we treat the column rule as a // border. We create a new border style object and fill in all the details of // the column rule as the left border. PaintBorder() does all the rendering // for us, so we not only save an enormous amount of code but we'll support // all the line styles that we support on borders! - nsStyleBorder border(presContext); + nsStyleBorder border(*presContext->Document()); Sides skipSides; if (isVertical) { border.SetBorderWidth(eSideTop, ruleWidth); diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 8dbaac9f8e0b..229d46a726c6 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1262,7 +1262,7 @@ void nsImageFrame::DisplayAltText(nsPresContext* aPresContext, struct nsRecessedBorder : public nsStyleBorder { nsRecessedBorder(nscoord aBorderWidth, nsPresContext* aPresContext) - : nsStyleBorder(aPresContext) { + : nsStyleBorder(*aPresContext->Document()) { NS_FOR_CSS_SIDES(side) { BorderColorFor(side) = StyleComplexColor::Black(); mBorder.Side(side) = aBorderWidth; diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index da2fbf378ed2..6b094ac61089 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -5738,7 +5738,7 @@ gfxFloat nsTextFrame::ComputeSelectionUnderlineHeight( ->GetDefaultFont(kPresContext_DefaultVariableFont_ID) ->size; int32_t zoomedFontSize = aPresContext->AppUnitsToDevPixels( - nsStyleFont::ZoomText(aPresContext, defaultFontSize)); + nsStyleFont::ZoomText(*aPresContext->Document(), defaultFontSize)); gfxFloat fontSize = std::min(gfxFloat(zoomedFontSize), aFontMetrics.emHeight); fontSize = std::max(fontSize, 1.0); diff --git a/layout/style/GeckoBindings.cpp b/layout/style/GeckoBindings.cpp index 13cb9878b37f..6eb080925f39 100644 --- a/layout/style/GeckoBindings.cpp +++ b/layout/style/GeckoBindings.cpp @@ -2206,7 +2206,7 @@ NS_IMPL_THREADSAFE_FFI_REFCOUNTING(nsCSSValueSharedList, CSSValueSharedList); \ void Gecko_Construct_Default_nsStyle##name( \ nsStyle##name* ptr, const nsPresContext* pres_context) { \ - new (ptr) nsStyle##name(pres_context); \ + new (ptr) nsStyle##name(*pres_context->Document()); \ } \ \ void Gecko_CopyConstruct_nsStyle##name(nsStyle##name* ptr, \ diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index b345237ba1cb..3732dc75e7ab 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -109,10 +109,10 @@ nsStyleFont::nsStyleFont(const nsStyleFont& aSrc) MOZ_COUNT_CTOR(nsStyleFont); } -nsStyleFont::nsStyleFont(const nsPresContext* aContext) - : mFont(*aContext->Document()->GetFontPrefsForLang(nullptr)->GetDefaultFont( +nsStyleFont::nsStyleFont(const Document& aDocument) + : mFont(*aDocument.GetFontPrefsForLang(nullptr)->GetDefaultFont( kPresContext_DefaultVariableFont_ID)), - mSize(ZoomText(aContext, mFont.size)), + mSize(ZoomText(aDocument, mFont.size)), mFontSizeFactor(1.0), mFontSizeOffset(0), mFontSizeKeyword(NS_STYLE_FONT_SIZE_MEDIUM), @@ -127,13 +127,13 @@ nsStyleFont::nsStyleFont(const nsPresContext* aContext) mScriptMinSize(nsPresContext::CSSTwipsToAppUnits( NS_POINTS_TO_TWIPS(NS_MATHML_DEFAULT_SCRIPT_MIN_SIZE_PT))), mScriptSizeMultiplier(NS_MATHML_DEFAULT_SCRIPT_SIZE_MULTIPLIER), - mLanguage(aContext->Document()->GetLanguageForStyle()) { + mLanguage(aDocument.GetLanguageForStyle()) { MOZ_COUNT_CTOR(nsStyleFont); MOZ_ASSERT(NS_IsMainThread()); mFont.size = mSize; - if (!aContext->IsChrome()) { + if (!nsContentUtils::IsChromeDoc(&aDocument)) { nscoord minimumFontSize = - aContext->Document()->GetFontPrefsForLang(mLanguage)->mMinimumFontSize; + aDocument.GetFontPrefsForLang(mLanguage)->mMinimumFontSize; mFont.size = std::max(mSize, minimumFontSize); } } @@ -172,15 +172,17 @@ nsChangeHint nsStyleFont::CalcDifference(const nsStyleFont& aNewData) const { return nsChangeHint(0); } -/* static */ nscoord nsStyleFont::ZoomText(const nsPresContext* aPresContext, - nscoord aSize) { +nscoord nsStyleFont::ZoomText(const Document& aDocument, nscoord aSize) { + float textZoom = 1.0; + if (auto* pc = aDocument.GetPresContext()) { + textZoom = pc->EffectiveTextZoom(); + } // aSize can be negative (e.g.: calc(-1px)) so we can't assert that here. // The caller is expected deal with that. - return NSToCoordTruncClamped(float(aSize) * - aPresContext->EffectiveTextZoom()); + return NSToCoordTruncClamped(float(aSize) * textZoom); } -nsStyleMargin::nsStyleMargin(const nsPresContext* aContext) { +nsStyleMargin::nsStyleMargin(const Document& aDocument) { MOZ_COUNT_CTOR(nsStyleMargin); nsStyleCoord zero(0, nsStyleCoord::CoordConstructor); NS_FOR_CSS_SIDES(side) { mMargin.Set(side, zero); } @@ -202,7 +204,7 @@ nsChangeHint nsStyleMargin::CalcDifference( nsChangeHint_ClearAncestorIntrinsics; } -nsStylePadding::nsStylePadding(const nsPresContext* aContext) { +nsStylePadding::nsStylePadding(const Document& aDocument) { MOZ_COUNT_CTOR(nsStylePadding); nsStyleCoord zero(0, nsStyleCoord::CoordConstructor); NS_FOR_CSS_SIDES(side) { mPadding.Set(side, zero); } @@ -229,7 +231,12 @@ nsChangeHint nsStylePadding::CalcDifference( return NS_STYLE_HINT_REFLOW & ~nsChangeHint_ClearDescendantIntrinsics; } -nsStyleBorder::nsStyleBorder(const nsPresContext* aContext) +static nscoord TwipsPerPixel(const Document& aDocument) { + auto* pc = aDocument.GetPresContext(); + return pc ? pc->AppUnitsPerDevPixel() : mozilla::AppUnitsPerCSSPixel(); +} + +nsStyleBorder::nsStyleBorder(const Document& aDocument) : mBorderImageFill(NS_STYLE_BORDER_IMAGE_SLICE_NOFILL), mBorderImageRepeatH(StyleBorderImageRepeat::Stretch), mBorderImageRepeatV(StyleBorderImageRepeat::Stretch), @@ -239,7 +246,8 @@ nsStyleBorder::nsStyleBorder(const nsPresContext* aContext) mBorderRightColor(StyleComplexColor::CurrentColor()), mBorderBottomColor(StyleComplexColor::CurrentColor()), mBorderLeftColor(StyleComplexColor::CurrentColor()), - mComputedBorder(0, 0, 0, 0) { + mComputedBorder(0, 0, 0, 0), + mTwipsPerPixel(TwipsPerPixel(aDocument)) { MOZ_COUNT_CTOR(nsStyleBorder); NS_FOR_CSS_HALF_CORNERS(corner) { @@ -255,8 +263,6 @@ nsStyleBorder::nsStyleBorder(const nsPresContext* aContext) mBorder.Side(side) = medium; mBorderStyle[side] = StyleBorderStyle::None; } - - mTwipsPerPixel = aContext->DevPixelsToAppUnits(1); } nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc) @@ -395,13 +401,13 @@ nsChangeHint nsStyleBorder::CalcDifference( return nsChangeHint(0); } -nsStyleOutline::nsStyleOutline(const nsPresContext* aContext) +nsStyleOutline::nsStyleOutline(const Document& aDocument) : mOutlineWidth(kMediumBorderWidth), mOutlineOffset(0), mOutlineColor(StyleComplexColor::CurrentColor()), mOutlineStyle(StyleOutlineStyle::BorderStyle(StyleBorderStyle::None)), mActualOutlineWidth(0), - mTwipsPerPixel(aContext->DevPixelsToAppUnits(1)) { + mTwipsPerPixel(TwipsPerPixel(aDocument)) { MOZ_COUNT_CTOR(nsStyleOutline); // spacing values not inherited nsStyleCoord zero(0, nsStyleCoord::CoordConstructor); @@ -448,7 +454,7 @@ nsChangeHint nsStyleOutline::CalcDifference( // -------------------- // nsStyleList // -nsStyleList::nsStyleList(const nsPresContext* aContext) +nsStyleList::nsStyleList(const Document& aDocument) : mListStylePosition(NS_STYLE_LIST_STYLE_POSITION_OUTSIDE) { MOZ_COUNT_CTOR(nsStyleList); MOZ_ASSERT(NS_IsMainThread()); @@ -532,7 +538,7 @@ already_AddRefed nsStyleList::GetListStyleImageURI() const { // -------------------- // nsStyleXUL // -nsStyleXUL::nsStyleXUL(const nsPresContext* aContext) +nsStyleXUL::nsStyleXUL(const Document& aDocument) : mBoxFlex(0.0f), mBoxOrdinal(1), mBoxAlign(StyleBoxAlign::Stretch), @@ -576,12 +582,12 @@ nsChangeHint nsStyleXUL::CalcDifference(const nsStyleXUL& aNewData) const { /* static */ const uint32_t nsStyleColumn::kMaxColumnCount; /* static */ const uint32_t nsStyleColumn::kColumnCountAuto; -nsStyleColumn::nsStyleColumn(const nsPresContext* aContext) +nsStyleColumn::nsStyleColumn(const Document& aDocument) : mColumnWidth(eStyleUnit_Auto), mColumnRuleColor(StyleComplexColor::CurrentColor()), mColumnRuleStyle(StyleBorderStyle::None), mColumnRuleWidth(kMediumBorderWidth), - mTwipsPerPixel(aContext->AppUnitsPerDevPixel()) { + mTwipsPerPixel(TwipsPerPixel(aDocument)) { MOZ_COUNT_CTOR(nsStyleColumn); } @@ -636,7 +642,7 @@ nsChangeHint nsStyleColumn::CalcDifference( // -------------------- // nsStyleSVG // -nsStyleSVG::nsStyleSVG(const nsPresContext* aContext) +nsStyleSVG::nsStyleSVG(const Document& aDocument) : mFill(eStyleSVGPaintType_Color), // Will be initialized to NS_RGB(0,0,0) mStroke(eStyleSVGPaintType_None), mStrokeDashoffset(0, nsStyleCoord::CoordConstructor), @@ -1049,7 +1055,7 @@ void nsStyleFilter::SetDropShadow(nsCSSShadowArray* aDropShadow) { // -------------------- // nsStyleSVGReset // -nsStyleSVGReset::nsStyleSVGReset(const nsPresContext* aContext) +nsStyleSVGReset::nsStyleSVGReset(const Document& aDocument) : mMask(nsStyleImageLayers::LayerType::Mask), mStopColor(StyleComplexColor::Black()), mFloodColor(StyleComplexColor::Black()), @@ -1285,7 +1291,7 @@ bool nsStyleSVGPaint::operator==(const nsStyleSVGPaint& aOther) const { // -------------------- // nsStylePosition // -nsStylePosition::nsStylePosition(const nsPresContext* aContext) +nsStylePosition::nsStylePosition(const Document& aDocument) : mWidth(eStyleUnit_Auto), mMinWidth(eStyleUnit_Auto), mMaxWidth(eStyleUnit_None), @@ -1603,7 +1609,7 @@ const nsStyleGridTemplate& nsStylePosition::GridTemplateRows() const { // nsStyleTable // -nsStyleTable::nsStyleTable(const nsPresContext* aContext) +nsStyleTable::nsStyleTable(const Document& aDocument) : mLayoutStrategy(NS_STYLE_TABLE_LAYOUT_AUTO), mSpan(1) { MOZ_COUNT_CTOR(nsStyleTable); } @@ -1625,7 +1631,7 @@ nsChangeHint nsStyleTable::CalcDifference(const nsStyleTable& aNewData) const { // ----------------------- // nsStyleTableBorder -nsStyleTableBorder::nsStyleTableBorder(const nsPresContext* aContext) +nsStyleTableBorder::nsStyleTableBorder(const Document& aDocument) : mBorderSpacingCol(0), mBorderSpacingRow(0), mBorderCollapse(NS_STYLE_BORDER_SEPARATE), @@ -1673,8 +1679,13 @@ nsChangeHint nsStyleTableBorder::CalcDifference( // nsStyleColor // -nsStyleColor::nsStyleColor(const nsPresContext* aContext) - : mColor(aContext->DefaultColor()) { +static nscolor DefaultColor(const Document& aDocument) { + auto* pc = aDocument.GetPresContext(); + return pc ? pc->DefaultColor() : NS_RGB(0, 0, 0); +} + +nsStyleColor::nsStyleColor(const Document& aDocument) + : mColor(DefaultColor(aDocument)) { MOZ_COUNT_CTOR(nsStyleColor); } @@ -2835,7 +2846,7 @@ nsChangeHint nsStyleImageLayers::Layer::CalcDifference( // nsStyleBackground // -nsStyleBackground::nsStyleBackground(const nsPresContext* aContext) +nsStyleBackground::nsStyleBackground(const Document& aDocument) : mImage(nsStyleImageLayers::LayerType::Background), mBackgroundColor(StyleComplexColor::Transparent()) { MOZ_COUNT_CTOR(nsStyleBackground); @@ -2951,7 +2962,7 @@ bool StyleAnimation::operator==(const StyleAnimation& aOther) const { // -------------------- // nsStyleDisplay // -nsStyleDisplay::nsStyleDisplay(const nsPresContext* aContext) +nsStyleDisplay::nsStyleDisplay(const Document& aDocument) : mDisplay(StyleDisplay::Inline), mOriginalDisplay(StyleDisplay::Inline), mContain(NS_STYLE_CONTAIN_NONE), @@ -3476,8 +3487,8 @@ void nsStyleDisplay::GenerateCombinedIndividualTransform() { // nsStyleVisibility // -nsStyleVisibility::nsStyleVisibility(const nsPresContext* aContext) - : mDirection(aContext->GetBidi() == IBMBIDI_TEXTDIRECTION_RTL +nsStyleVisibility::nsStyleVisibility(const Document& aDocument) + : mDirection(aDocument.GetBidiOptions() == IBMBIDI_TEXTDIRECTION_RTL ? NS_STYLE_DIRECTION_RTL : NS_STYLE_DIRECTION_LTR), mVisible(NS_STYLE_VISIBILITY_VISIBLE), @@ -3651,7 +3662,7 @@ void nsStyleContentData::Resolve(nsPresContext* aPresContext, // nsStyleContent // -nsStyleContent::nsStyleContent(const nsPresContext* aContext) { +nsStyleContent::nsStyleContent(const Document& aDocument) { MOZ_COUNT_CTOR(nsStyleContent); } @@ -3708,7 +3719,7 @@ nsChangeHint nsStyleContent::CalcDifference( // nsStyleTextReset // -nsStyleTextReset::nsStyleTextReset(const nsPresContext* aContext) +nsStyleTextReset::nsStyleTextReset(const Document& aDocument) : mTextOverflow(), mTextDecorationLine(NS_STYLE_TEXT_DECORATION_LINE_NONE), mTextDecorationStyle(NS_STYLE_TEXT_DECORATION_STYLE_SOLID), @@ -3783,7 +3794,7 @@ static bool AreShadowArraysEqual(nsCSSShadowArray* lhs, nsCSSShadowArray* rhs) { // nsStyleText // -nsStyleText::nsStyleText(const nsPresContext* aContext) +nsStyleText::nsStyleText(const Document& aDocument) : mTextAlign(NS_STYLE_TEXT_ALIGN_START), mTextAlignLast(NS_STYLE_TEXT_ALIGN_AUTO), mTextJustify(StyleTextJustify::Auto), @@ -3811,8 +3822,7 @@ nsStyleText::nsStyleText(const nsPresContext* aContext) mWebkitTextStrokeWidth(0), mTextShadow(nullptr) { MOZ_COUNT_CTOR(nsStyleText); - RefPtr language = - aContext->Document()->GetContentLanguageAsAtomForStyle(); + RefPtr language = aDocument.GetContentLanguageAsAtomForStyle(); mTextEmphasisPosition = language && nsStyleUtil::MatchesLanguagePrefix(language, u"zh") ? NS_STYLE_TEXT_EMPHASIS_POSITION_DEFAULT_ZH @@ -3981,7 +3991,7 @@ bool nsCursorImage::operator==(const nsCursorImage& aOther) const { DefinitelyEqualImages(mImage, aOther.mImage); } -nsStyleUI::nsStyleUI(const nsPresContext* aContext) +nsStyleUI::nsStyleUI(const Document& aDocument) : mUserInput(StyleUserInput::Auto), mUserModify(StyleUserModify::ReadOnly), mUserFocus(StyleUserFocus::None), @@ -4076,7 +4086,7 @@ nsChangeHint nsStyleUI::CalcDifference(const nsStyleUI& aNewData) const { // nsStyleUIReset // -nsStyleUIReset::nsStyleUIReset(const nsPresContext* aContext) +nsStyleUIReset::nsStyleUIReset(const Document& aDocument) : mUserSelect(StyleUserSelect::Auto), mScrollbarWidth(StyleScrollbarWidth::Auto), mForceBrokenImageIcon(0), @@ -4165,7 +4175,7 @@ nsChangeHint nsStyleUIReset::CalcDifference( // nsStyleEffects // -nsStyleEffects::nsStyleEffects(const nsPresContext* aContext) +nsStyleEffects::nsStyleEffects(const Document&) : mBoxShadow(nullptr), mClip(0, 0, 0, 0), mOpacity(1.0f), diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index b6f77b36b8b9..5ac9ba714b51 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -86,7 +86,7 @@ struct Position { struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleFont { nsStyleFont(const nsStyleFont& aStyleFont); - explicit nsStyleFont(const nsPresContext* aContext); + explicit nsStyleFont(const mozilla::dom::Document&); ~nsStyleFont() { MOZ_COUNT_DTOR(nsStyleFont); } void FinishStyle(nsPresContext*, const nsStyleFont*) {} const static bool kHasFinishStyle = false; @@ -98,7 +98,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleFont { * aSize is allowed to be negative, but the caller is expected to deal with * negative results. The result is clamped to nscoord_MIN .. nscoord_MAX. */ - static nscoord ZoomText(const nsPresContext* aPresContext, nscoord aSize); + static nscoord ZoomText(const mozilla::dom::Document&, nscoord aSize); nsFont mFont; nscoord mSize; // Our "computed size". Can be different @@ -466,7 +466,7 @@ struct nsStyleImage { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColor { - explicit nsStyleColor(const nsPresContext* aContext); + explicit nsStyleColor(const mozilla::dom::Document&); nsStyleColor(const nsStyleColor& aOther); ~nsStyleColor() { MOZ_COUNT_DTOR(nsStyleColor); } void FinishStyle(nsPresContext*, const nsStyleColor*) {} @@ -721,7 +721,7 @@ struct nsStyleImageLayers { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBackground { - explicit nsStyleBackground(const nsPresContext* aContext); + explicit nsStyleBackground(const mozilla::dom::Document&); nsStyleBackground(const nsStyleBackground& aOther); ~nsStyleBackground(); @@ -760,7 +760,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBackground { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleMargin { - explicit nsStyleMargin(const nsPresContext* aContext); + explicit nsStyleMargin(const mozilla::dom::Document&); nsStyleMargin(const nsStyleMargin& aMargin); ~nsStyleMargin() { MOZ_COUNT_DTOR(nsStyleMargin); } void FinishStyle(nsPresContext*, const nsStyleMargin*) {} @@ -786,7 +786,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleMargin { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePadding { - explicit nsStylePadding(const nsPresContext* aContext); + explicit nsStylePadding(const mozilla::dom::Document&); nsStylePadding(const nsStylePadding& aPadding); ~nsStylePadding() { MOZ_COUNT_DTOR(nsStylePadding); } void FinishStyle(nsPresContext*, const nsStylePadding*) {} @@ -927,7 +927,7 @@ static bool IsVisibleBorderStyle(mozilla::StyleBorderStyle aStyle) { } struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder { - explicit nsStyleBorder(const nsPresContext* aContext); + explicit nsStyleBorder(const mozilla::dom::Document&); nsStyleBorder(const nsStyleBorder& aBorder); ~nsStyleBorder(); @@ -1100,7 +1100,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleOutline { - explicit nsStyleOutline(const nsPresContext* aContext); + explicit nsStyleOutline(const mozilla::dom::Document&); nsStyleOutline(const nsStyleOutline& aOutline); ~nsStyleOutline() { MOZ_COUNT_DTOR(nsStyleOutline); } void FinishStyle(nsPresContext*, const nsStyleOutline*) {} @@ -1144,7 +1144,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleOutline { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleList { - explicit nsStyleList(const nsPresContext* aContext); + explicit nsStyleList(const mozilla::dom::Document&); nsStyleList(const nsStyleList& aStyleList); ~nsStyleList(); @@ -1288,7 +1288,7 @@ struct nsStyleGridTemplate { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition { - explicit nsStylePosition(const nsPresContext* aContext); + explicit nsStylePosition(const mozilla::dom::Document&); nsStylePosition(const nsStylePosition& aOther); ~nsStylePosition(); void FinishStyle(nsPresContext*, const nsStylePosition*) {} @@ -1463,7 +1463,7 @@ struct nsStyleTextOverflow { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTextReset { - explicit nsStyleTextReset(const nsPresContext* aContext); + explicit nsStyleTextReset(const mozilla::dom::Document&); nsStyleTextReset(const nsStyleTextReset& aOther); ~nsStyleTextReset(); void FinishStyle(nsPresContext*, const nsStyleTextReset*) {} @@ -1489,7 +1489,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTextReset { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText { - explicit nsStyleText(const nsPresContext* aContext); + explicit nsStyleText(const mozilla::dom::Document&); nsStyleText(const nsStyleText& aOther); ~nsStyleText(); void FinishStyle(nsPresContext*, const nsStyleText*) {} @@ -1587,7 +1587,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleVisibility { - explicit nsStyleVisibility(const nsPresContext* aContext); + explicit nsStyleVisibility(const mozilla::dom::Document&); nsStyleVisibility(const nsStyleVisibility& aVisibility); ~nsStyleVisibility() { MOZ_COUNT_DTOR(nsStyleVisibility); } void FinishStyle(nsPresContext*, const nsStyleVisibility*) {} @@ -1870,7 +1870,7 @@ struct StyleMotion final { struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay { typedef mozilla::StyleGeometryBox StyleGeometryBox; - explicit nsStyleDisplay(const nsPresContext* aContext); + explicit nsStyleDisplay(const mozilla::dom::Document&); nsStyleDisplay(const nsStyleDisplay& aOther); ~nsStyleDisplay(); @@ -2309,7 +2309,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTable { - explicit nsStyleTable(const nsPresContext* aContext); + explicit nsStyleTable(const mozilla::dom::Document&); nsStyleTable(const nsStyleTable& aOther); ~nsStyleTable(); void FinishStyle(nsPresContext*, const nsStyleTable*) {} @@ -2322,7 +2322,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTable { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTableBorder { - explicit nsStyleTableBorder(const nsPresContext* aContext); + explicit nsStyleTableBorder(const mozilla::dom::Document&); nsStyleTableBorder(const nsStyleTableBorder& aOther); ~nsStyleTableBorder(); void FinishStyle(nsPresContext*, const nsStyleTableBorder*) {} @@ -2455,7 +2455,7 @@ struct nsStyleCounterData { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent { - explicit nsStyleContent(const nsPresContext* aContext); + explicit nsStyleContent(const mozilla::dom::Document&); nsStyleContent(const nsStyleContent& aContent); ~nsStyleContent(); void FinishStyle(nsPresContext*, const nsStyleContent*); @@ -2520,7 +2520,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset { - explicit nsStyleUIReset(const nsPresContext* aContext); + explicit nsStyleUIReset(const mozilla::dom::Document&); nsStyleUIReset(const nsStyleUIReset& aOther); ~nsStyleUIReset(); void FinishStyle(nsPresContext*, const nsStyleUIReset*) {} @@ -2558,7 +2558,7 @@ struct nsCursorImage { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI { - explicit nsStyleUI(const nsPresContext* aContext); + explicit nsStyleUI(const mozilla::dom::Document&); nsStyleUI(const nsStyleUI& aOther); ~nsStyleUI(); @@ -2587,7 +2587,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleXUL { - explicit nsStyleXUL(const nsPresContext* aContext); + explicit nsStyleXUL(const mozilla::dom::Document&); nsStyleXUL(const nsStyleXUL& aSource); ~nsStyleXUL(); void FinishStyle(nsPresContext*, const nsStyleXUL*) {} @@ -2605,7 +2605,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleXUL { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn { - explicit nsStyleColumn(const nsPresContext* aContext); + explicit nsStyleColumn(const mozilla::dom::Document&); nsStyleColumn(const nsStyleColumn& aSource); ~nsStyleColumn(); void FinishStyle(nsPresContext*, const nsStyleColumn*) {} @@ -2733,7 +2733,7 @@ class nsStyleSVGPaint { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVG { - explicit nsStyleSVG(const nsPresContext* aContext); + explicit nsStyleSVG(const mozilla::dom::Document&); nsStyleSVG(const nsStyleSVG& aSource); ~nsStyleSVG(); void FinishStyle(nsPresContext*, const nsStyleSVG*) {} @@ -2886,7 +2886,7 @@ struct nsTArray_CopyChooser { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset { - explicit nsStyleSVGReset(const nsPresContext* aContext); + explicit nsStyleSVGReset(const mozilla::dom::Document&); nsStyleSVGReset(const nsStyleSVGReset& aSource); ~nsStyleSVGReset(); @@ -2923,7 +2923,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset { }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleEffects { - explicit nsStyleEffects(const nsPresContext* aContext); + explicit nsStyleEffects(const mozilla::dom::Document&); nsStyleEffects(const nsStyleEffects& aSource); ~nsStyleEffects(); void FinishStyle(nsPresContext*, const nsStyleEffects*) {}