diff --git a/layout/style/ComputedStyleInlines.h b/layout/style/ComputedStyleInlines.h index 2a5707a28991d..d8038dce6fdb1 100644 --- a/layout/style/ComputedStyleInlines.h +++ b/layout/style/ComputedStyleInlines.h @@ -17,6 +17,7 @@ #include "mozilla/ComputedStyle.h" #include "mozilla/ServoComputedDataInlines.h" #include "mozilla/ServoUtils.h" +#include "nsPresContext.h" namespace mozilla { @@ -37,24 +38,25 @@ namespace mozilla { #undef STYLE_STRUCT // Helper functions for GetStyle* and PeekStyle* -#define STYLE_STRUCT(name_) \ - template \ - const nsStyle##name_* ComputedStyle::DoGetStyle##name_() { \ - const auto kStructID = StyleStructID::name_; \ - const bool needToCompute = !HasRequestedStruct(kStructID); \ - if (!aComputeData && needToCompute) { \ - return nullptr; \ - } \ - const nsStyle##name_* data = ComputedData()->GetStyle##name_(); \ - /* perform any remaining main thread work on the struct */ \ - if (needToCompute) { \ - MOZ_ASSERT(NS_IsMainThread()); \ - MOZ_ASSERT(!mozilla::IsInServoTraversal()); \ - const_cast(data)->FinishStyle(mPresContext, nullptr); \ - /* the ComputedStyle owns the struct */ \ - SetRequestedStruct(kStructID); \ - } \ - return data; \ +#define STYLE_STRUCT(name_) \ + template \ + const nsStyle##name_* ComputedStyle::DoGetStyle##name_() { \ + const auto kStructID = StyleStructID::name_; \ + const bool needToCompute = !HasRequestedStruct(kStructID); \ + if (!aComputeData && needToCompute) { \ + return nullptr; \ + } \ + const nsStyle##name_* data = ComputedData()->GetStyle##name_(); \ + /* perform any remaining main thread work on the struct */ \ + if (needToCompute) { \ + MOZ_ASSERT(NS_IsMainThread()); \ + MOZ_ASSERT(!mozilla::IsInServoTraversal()); \ + const_cast(data)->FinishStyle( \ + *mPresContext->Document(), nullptr); \ + /* the ComputedStyle owns the struct */ \ + SetRequestedStruct(kStructID); \ + } \ + return data; \ } #include "nsStyleStructList.h" #undef STYLE_STRUCT @@ -73,7 +75,8 @@ void ComputedStyle::ResolveSameStructsAs(const ComputedStyle* aOther) { (newBits & StyleStructConstants::BitFor(StyleStructID::name_))) { \ const nsStyle##name_* data = ComputedData()->GetStyle##name_(); \ const nsStyle##name_* oldData = aOther->ComputedData()->GetStyle##name_(); \ - const_cast(data)->FinishStyle(mPresContext, oldData); \ + const_cast(data)->FinishStyle(*mPresContext->Document(), \ + oldData); \ } #include "nsStyleStructList.h" #undef STYLE_STRUCT diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 435833691d666..04e78eb5a3eb3 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -289,12 +289,12 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc) nsStyleBorder::~nsStyleBorder() { MOZ_COUNT_DTOR(nsStyleBorder); } -void nsStyleBorder::FinishStyle(nsPresContext* aPresContext, +void nsStyleBorder::FinishStyle(Document& aDocument, const nsStyleBorder* aOldStyle) { MOZ_ASSERT(NS_IsMainThread()); mBorderImageSource.ResolveImage( - aPresContext, aOldStyle ? &aOldStyle->mBorderImageSource : nullptr); + aDocument, aOldStyle ? &aOldStyle->mBorderImageSource : nullptr); } nsMargin nsStyleBorder::GetImageOutset() const { @@ -474,13 +474,13 @@ nsStyleList::nsStyleList(const nsStyleList& aSource) MOZ_COUNT_CTOR(nsStyleList); } -void nsStyleList::FinishStyle(nsPresContext* aPresContext, +void nsStyleList::FinishStyle(Document& aDocument, const nsStyleList* aOldStyle) { MOZ_ASSERT(NS_IsMainThread()); if (mListStyleImage && !mListStyleImage->IsResolved()) { mListStyleImage->Resolve( - aPresContext, aOldStyle ? aOldStyle->mListStyleImage.get() : nullptr); + aDocument, aOldStyle ? aOldStyle->mListStyleImage.get() : nullptr); } } @@ -888,7 +888,7 @@ void StyleShapeSource::SetPath(UniquePtr aPath) { mType = StyleShapeSourceType::Path; } -void StyleShapeSource::FinishStyle(nsPresContext* aPresContext, +void StyleShapeSource::FinishStyle(Document& aDocument, const StyleShapeSource* aOldShapeSource) { if (GetType() != StyleShapeSourceType::Image) { return; @@ -898,7 +898,7 @@ void StyleShapeSource::FinishStyle(nsPresContext* aPresContext, StyleShapeSourceType::Image) ? &aOldShapeSource->ShapeImage() : nullptr; - mShapeImage->ResolveImage(aPresContext, oldShapeImage); + mShapeImage->ResolveImage(aDocument, oldShapeImage); } void StyleShapeSource::SetReferenceBox(StyleGeometryBox aReferenceBox) { @@ -1083,7 +1083,7 @@ nsStyleSVGReset::nsStyleSVGReset(const nsStyleSVGReset& aSource) MOZ_COUNT_CTOR(nsStyleSVGReset); } -void nsStyleSVGReset::FinishStyle(nsPresContext* aPresContext, +void nsStyleSVGReset::FinishStyle(Document& aDocument, const nsStyleSVGReset* aOldStyle) { MOZ_ASSERT(NS_IsMainThread()); @@ -1113,7 +1113,7 @@ void nsStyleSVGReset::FinishStyle(nsPresContext* aPresContext, ? &aOldStyle->mMask.mLayers[i].mImage : nullptr; - image.ResolveImage(aPresContext, oldImage); + image.ResolveImage(aDocument, oldImage); } } } @@ -1851,16 +1851,14 @@ nsStyleImageRequest::~nsStyleImageRequest() { MOZ_ASSERT(!mImageTracker); } -bool nsStyleImageRequest::Resolve(nsPresContext* aPresContext, +bool nsStyleImageRequest::Resolve(Document& aDocument, const nsStyleImageRequest* aOldImageRequest) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(!IsResolved(), "already resolved"); - MOZ_ASSERT(aPresContext); mResolved = true; - Document* doc = aPresContext->Document(); - nsIURI* docURI = doc->GetDocumentURI(); + nsIURI* docURI = aDocument.GetDocumentURI(); if (GetImageValue()->HasRef()) { bool isEqualExceptRef = false; RefPtr imageURI = GetImageURI(); @@ -1881,21 +1879,22 @@ bool nsStyleImageRequest::Resolve(nsPresContext* aPresContext, // 1440305, but that seems too risky, and a lot of work to do before 60. // // Once that's fixed, the "old style" argument to FinishStyle can go away. - if (aPresContext->IsChrome() && aOldImageRequest && + if (nsContentUtils::IsChromeDoc(&aDocument) && aOldImageRequest && aOldImageRequest->IsResolved() && DefinitelyEquals(*aOldImageRequest)) { - MOZ_ASSERT(aOldImageRequest->mDocGroup == doc->GetDocGroup()); + MOZ_ASSERT(aOldImageRequest->mDocGroup == aDocument.GetDocGroup()); MOZ_ASSERT(mModeFlags == aOldImageRequest->mModeFlags); mDocGroup = aOldImageRequest->mDocGroup; mImageValue = aOldImageRequest->mImageValue; mRequestProxy = aOldImageRequest->mRequestProxy; } else { - mDocGroup = doc->GetDocGroup(); - imgRequestProxy* request = mImageValue->LoadImage(doc); - if (aPresContext->IsDynamic()) { + mDocGroup = aDocument.GetDocGroup(); + imgRequestProxy* request = mImageValue->LoadImage(&aDocument); + bool isPrint = !!aDocument.GetOriginalDocument(); + if (!isPrint) { mRequestProxy = request; } else if (request) { - request->GetStaticRequest(doc, getter_AddRefs(mRequestProxy)); + request->GetStaticRequest(&aDocument, getter_AddRefs(mRequestProxy)); } } @@ -1905,7 +1904,7 @@ bool nsStyleImageRequest::Resolve(nsPresContext* aPresContext, } if (mModeFlags & Mode::Track) { - mImageTracker = doc->ImageTracker(); + mImageTracker = aDocument.ImageTracker(); } MaybeTrackAndLock(); @@ -2858,11 +2857,10 @@ nsStyleBackground::nsStyleBackground(const nsStyleBackground& aSource) nsStyleBackground::~nsStyleBackground() { MOZ_COUNT_DTOR(nsStyleBackground); } -void nsStyleBackground::FinishStyle(nsPresContext* aPresContext, +void nsStyleBackground::FinishStyle(Document& aDocument, const nsStyleBackground* aOldStyle) { MOZ_ASSERT(NS_IsMainThread()); - - mImage.ResolveImages(aPresContext, aOldStyle ? &aOldStyle->mImage : nullptr); + mImage.ResolveImages(aDocument, aOldStyle ? &aOldStyle->mImage : nullptr); } nsChangeHint nsStyleBackground::CalcDifference( @@ -3134,11 +3132,11 @@ nsStyleDisplay::~nsStyleDisplay() { MOZ_COUNT_DTOR(nsStyleDisplay); } -void nsStyleDisplay::FinishStyle(nsPresContext* aPresContext, +void nsStyleDisplay::FinishStyle(Document& aDocument, const nsStyleDisplay* aOldStyle) { MOZ_ASSERT(NS_IsMainThread()); - mShapeOutside.FinishStyle(aPresContext, + mShapeOutside.FinishStyle(aDocument, aOldStyle ? &aOldStyle->mShapeOutside : nullptr); GenerateCombinedIndividualTransform(); } @@ -3634,7 +3632,7 @@ bool nsStyleContentData::operator==(const nsStyleContentData& aOther) const { return true; } -void nsStyleContentData::Resolve(nsPresContext* aPresContext, +void nsStyleContentData::Resolve(Document& aDocument, const nsStyleContentData* aOldStyle) { if (mType != StyleContentType::Image) { return; @@ -3644,7 +3642,7 @@ void nsStyleContentData::Resolve(nsPresContext* aPresContext, (aOldStyle && aOldStyle->mType == StyleContentType::Image) ? aOldStyle->mContent.mImage : nullptr; - mContent.mImage->Resolve(aPresContext, oldRequest); + mContent.mImage->Resolve(aDocument, oldRequest); } } @@ -3658,14 +3656,14 @@ nsStyleContent::nsStyleContent(const Document& aDocument) { nsStyleContent::~nsStyleContent() { MOZ_COUNT_DTOR(nsStyleContent); } -void nsStyleContent::FinishStyle(nsPresContext* aPresContext, +void nsStyleContent::FinishStyle(Document& aDocument, const nsStyleContent* aOldStyle) { for (size_t i = 0; i < mContents.Length(); ++i) { const nsStyleContentData* oldData = (aOldStyle && aOldStyle->mContents.Length() > i) ? &aOldStyle->mContents[i] : nullptr; - mContents[i].Resolve(aPresContext, oldData); + mContents[i].Resolve(aDocument, oldData); } } @@ -3992,8 +3990,7 @@ nsStyleUI::nsStyleUI(const nsStyleUI& aSource) nsStyleUI::~nsStyleUI() { MOZ_COUNT_DTOR(nsStyleUI); } -void nsStyleUI::FinishStyle(nsPresContext* aPresContext, - const nsStyleUI* aOldStyle) { +void nsStyleUI::FinishStyle(Document& aDocument, const nsStyleUI* aOldStyle) { MOZ_ASSERT(NS_IsMainThread()); for (size_t i = 0; i < mCursorImages.Length(); ++i) { @@ -4004,7 +4001,7 @@ void nsStyleUI::FinishStyle(nsPresContext* aPresContext, (aOldStyle && aOldStyle->mCursorImages.Length() > i) ? &aOldStyle->mCursorImages[i] : nullptr; - cursor.mImage->Resolve(aPresContext, + cursor.mImage->Resolve(aDocument, oldCursor ? oldCursor->mImage.get() : nullptr); } } diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 48f66e4aa3993..93d27afdb2fbf 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -88,7 +88,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleFont { nsStyleFont(const nsStyleFont& aStyleFont); explicit nsStyleFont(const mozilla::dom::Document&); ~nsStyleFont() { MOZ_COUNT_DTOR(nsStyleFont); } - void FinishStyle(nsPresContext*, const nsStyleFont*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleFont*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleFont& aNewData) const; @@ -242,7 +242,8 @@ class nsStyleImageRequest { // on the main thread before get() can be used. nsStyleImageRequest(Mode aModeFlags, mozilla::css::URLValue* aImageValue); - bool Resolve(nsPresContext*, const nsStyleImageRequest* aOldImageRequest); + bool Resolve(mozilla::dom::Document&, + const nsStyleImageRequest* aOldImageRequest); bool IsResolved() const { return mResolved; } imgRequestProxy* get() { @@ -334,14 +335,15 @@ struct nsStyleImage { void SetCropRect(mozilla::UniquePtr aCropRect); void SetURLValue(already_AddRefed aURLValue); - void ResolveImage(nsPresContext* aContext, const nsStyleImage* aOldImage) { + void ResolveImage(mozilla::dom::Document& aDocument, + const nsStyleImage* aOldImage) { MOZ_ASSERT(mType != eStyleImageType_Image || mImage); if (mType == eStyleImageType_Image && !mImage->IsResolved()) { const nsStyleImageRequest* oldRequest = (aOldImage && aOldImage->GetType() == eStyleImageType_Image) ? aOldImage->ImageRequest() : nullptr; - mImage->Resolve(aContext, oldRequest); + mImage->Resolve(aDocument, oldRequest); } } @@ -469,7 +471,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColor { explicit nsStyleColor(const mozilla::dom::Document&); nsStyleColor(const nsStyleColor& aOther); ~nsStyleColor() { MOZ_COUNT_DTOR(nsStyleColor); } - void FinishStyle(nsPresContext*, const nsStyleColor*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleColor*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleColor& aNewData) const; @@ -635,8 +637,9 @@ struct nsStyleImageLayers { // Initialize mRepeat and mOrigin by specified layer type void Initialize(LayerType aType); - void ResolveImage(nsPresContext* aContext, const Layer* aOldLayer) { - mImage.ResolveImage(aContext, aOldLayer ? &aOldLayer->mImage : nullptr); + void ResolveImage(mozilla::dom::Document& aDocument, + const Layer* aOldLayer) { + mImage.ResolveImage(aDocument, aOldLayer ? &aOldLayer->mImage : nullptr); } // True if the rendering of this layer might change when the size @@ -683,13 +686,13 @@ struct nsStyleImageLayers { const Layer& BottomLayer() const { return mLayers[mImageCount - 1]; } - void ResolveImages(nsPresContext* aContext, + void ResolveImages(mozilla::dom::Document& aDocument, const nsStyleImageLayers* aOldLayers) { for (uint32_t i = 0; i < mImageCount; ++i) { const Layer* oldLayer = (aOldLayers && aOldLayers->mLayers.Length() > i) ? &aOldLayers->mLayers[i] : nullptr; - mLayers[i].ResolveImage(aContext, oldLayer); + mLayers[i].ResolveImage(aDocument, oldLayer); } } @@ -728,7 +731,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBackground { // Resolves and tracks the images in mImage. Only called with a Servo-backed // style system, where those images must be resolved later than the OMT // nsStyleBackground constructor call. - void FinishStyle(nsPresContext*, const nsStyleBackground*); + void FinishStyle(mozilla::dom::Document&, const nsStyleBackground*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleBackground& aNewData) const; @@ -763,7 +766,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleMargin { explicit nsStyleMargin(const mozilla::dom::Document&); nsStyleMargin(const nsStyleMargin& aMargin); ~nsStyleMargin() { MOZ_COUNT_DTOR(nsStyleMargin); } - void FinishStyle(nsPresContext*, const nsStyleMargin*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleMargin*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleMargin& aNewData) const; @@ -789,7 +792,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePadding { explicit nsStylePadding(const mozilla::dom::Document&); nsStylePadding(const nsStylePadding& aPadding); ~nsStylePadding() { MOZ_COUNT_DTOR(nsStylePadding); } - void FinishStyle(nsPresContext*, const nsStylePadding*) {} + void FinishStyle(mozilla::dom::Document&, const nsStylePadding*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStylePadding& aNewData) const; @@ -934,7 +937,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder { // Resolves and tracks mBorderImageSource. Only called with a Servo-backed // style system, where those images must be resolved later than the OMT // nsStyleBorder constructor call. - void FinishStyle(nsPresContext*, const nsStyleBorder*); + void FinishStyle(mozilla::dom::Document&, const nsStyleBorder*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleBorder& aNewData) const; @@ -1103,7 +1106,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleOutline { explicit nsStyleOutline(const mozilla::dom::Document&); nsStyleOutline(const nsStyleOutline& aOutline); ~nsStyleOutline() { MOZ_COUNT_DTOR(nsStyleOutline); } - void FinishStyle(nsPresContext*, const nsStyleOutline*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleOutline*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleOutline& aNewData) const; @@ -1148,7 +1151,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleList { nsStyleList(const nsStyleList& aStyleList); ~nsStyleList(); - void FinishStyle(nsPresContext*, const nsStyleList*); + void FinishStyle(mozilla::dom::Document&, const nsStyleList*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleList& aNewData, @@ -1291,7 +1294,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition { explicit nsStylePosition(const mozilla::dom::Document&); nsStylePosition(const nsStylePosition& aOther); ~nsStylePosition(); - void FinishStyle(nsPresContext*, const nsStylePosition*) {} + void FinishStyle(mozilla::dom::Document&, const nsStylePosition*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference( @@ -1466,7 +1469,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTextReset { explicit nsStyleTextReset(const mozilla::dom::Document&); nsStyleTextReset(const nsStyleTextReset& aOther); ~nsStyleTextReset(); - void FinishStyle(nsPresContext*, const nsStyleTextReset*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleTextReset*) {} const static bool kHasFinishStyle = false; // Note the difference between this and @@ -1492,7 +1495,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText { explicit nsStyleText(const mozilla::dom::Document&); nsStyleText(const nsStyleText& aOther); ~nsStyleText(); - void FinishStyle(nsPresContext*, const nsStyleText*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleText*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleText& aNewData) const; @@ -1590,7 +1593,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleVisibility { explicit nsStyleVisibility(const mozilla::dom::Document&); nsStyleVisibility(const nsStyleVisibility& aVisibility); ~nsStyleVisibility() { MOZ_COUNT_DTOR(nsStyleVisibility); } - void FinishStyle(nsPresContext*, const nsStyleVisibility*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleVisibility*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleVisibility& aNewData) const; @@ -1826,7 +1829,8 @@ struct StyleShapeSource final { } void SetPath(UniquePtr aPath); - void FinishStyle(nsPresContext*, const StyleShapeSource* aOldShapeSource); + void FinishStyle(mozilla::dom::Document&, + const StyleShapeSource* aOldShapeSource); private: void* operator new(size_t) = delete; @@ -1874,7 +1878,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay { nsStyleDisplay(const nsStyleDisplay& aOther); ~nsStyleDisplay(); - void FinishStyle(nsPresContext*, const nsStyleDisplay*); + void FinishStyle(mozilla::dom::Document&, const nsStyleDisplay*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleDisplay& aNewData) const; @@ -2312,7 +2316,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTable { explicit nsStyleTable(const mozilla::dom::Document&); nsStyleTable(const nsStyleTable& aOther); ~nsStyleTable(); - void FinishStyle(nsPresContext*, const nsStyleTable*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleTable*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleTable& aNewData) const; @@ -2325,7 +2329,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTableBorder { explicit nsStyleTableBorder(const mozilla::dom::Document&); nsStyleTableBorder(const nsStyleTableBorder& aOther); ~nsStyleTableBorder(); - void FinishStyle(nsPresContext*, const nsStyleTableBorder*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleTableBorder*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleTableBorder& aNewData) const; @@ -2427,7 +2431,7 @@ class nsStyleContentData { MOZ_ASSERT(mContent.mImage); } - void Resolve(nsPresContext*, const nsStyleContentData*); + void Resolve(mozilla::dom::Document&, const nsStyleContentData*); private: StyleContentType mType; @@ -2456,7 +2460,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent { explicit nsStyleContent(const mozilla::dom::Document&); nsStyleContent(const nsStyleContent& aContent); ~nsStyleContent(); - void FinishStyle(nsPresContext*, const nsStyleContent*); + void FinishStyle(mozilla::dom::Document&, const nsStyleContent*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleContent& aNewData) const; @@ -2521,7 +2525,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset { explicit nsStyleUIReset(const mozilla::dom::Document&); nsStyleUIReset(const nsStyleUIReset& aOther); ~nsStyleUIReset(); - void FinishStyle(nsPresContext*, const nsStyleUIReset*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleUIReset*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const; @@ -2560,7 +2564,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI { nsStyleUI(const nsStyleUI& aOther); ~nsStyleUI(); - void FinishStyle(nsPresContext*, const nsStyleUI*); + void FinishStyle(mozilla::dom::Document&, const nsStyleUI*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleUI& aNewData) const; @@ -2588,7 +2592,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleXUL { explicit nsStyleXUL(const mozilla::dom::Document&); nsStyleXUL(const nsStyleXUL& aSource); ~nsStyleXUL(); - void FinishStyle(nsPresContext*, const nsStyleXUL*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleXUL*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleXUL& aNewData) const; @@ -2606,7 +2610,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn { explicit nsStyleColumn(const mozilla::dom::Document&); nsStyleColumn(const nsStyleColumn& aSource); ~nsStyleColumn(); - void FinishStyle(nsPresContext*, const nsStyleColumn*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleColumn*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleColumn& aNewData) const; @@ -2734,7 +2738,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVG { explicit nsStyleSVG(const mozilla::dom::Document&); nsStyleSVG(const nsStyleSVG& aSource); ~nsStyleSVG(); - void FinishStyle(nsPresContext*, const nsStyleSVG*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleSVG*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleSVG& aNewData) const; @@ -2833,7 +2837,7 @@ struct nsStyleFilter { nsStyleFilter(); nsStyleFilter(const nsStyleFilter& aSource); ~nsStyleFilter(); - void FinishStyle(nsPresContext*, const nsStyleFilter*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleFilter*) {} const static bool kHasFinishStyle = false; nsStyleFilter& operator=(const nsStyleFilter& aOther); @@ -2891,7 +2895,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset { // Resolves and tracks the images in mMask. Only called with a Servo-backed // style system, where those images must be resolved later than the OMT // nsStyleSVGReset constructor call. - void FinishStyle(nsPresContext*, const nsStyleSVGReset*); + void FinishStyle(mozilla::dom::Document&, const nsStyleSVGReset*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleSVGReset& aNewData) const; @@ -2924,7 +2928,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleEffects { explicit nsStyleEffects(const mozilla::dom::Document&); nsStyleEffects(const nsStyleEffects& aSource); ~nsStyleEffects(); - void FinishStyle(nsPresContext*, const nsStyleEffects*) {} + void FinishStyle(mozilla::dom::Document&, const nsStyleEffects*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleEffects& aNewData) const; diff --git a/layout/svg/SVGObserverUtils.cpp b/layout/svg/SVGObserverUtils.cpp index 85b45092fdcfe..ef4a188e10a6c 100644 --- a/layout/svg/SVGObserverUtils.cpp +++ b/layout/svg/SVGObserverUtils.cpp @@ -759,7 +759,7 @@ void SVGMaskObserverList::ResolveImage(uint32_t aIndex) { if (!image.IsResolved()) { MOZ_ASSERT(image.GetType() == nsStyleImageType::eStyleImageType_Image); - image.ResolveImage(mFrame->PresContext(), nullptr); + image.ResolveImage(*mFrame->PresContext()->Document(), nullptr); mozilla::css::ImageLoader* imageLoader = mFrame->PresContext()->Document()->StyleImageLoader();