Bug 1301245 - Part 5. (Stylo) Remove original code of triggering style image download.
MozReview-Commit-ID: L6eSUIFSZrh
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -844,41 +844,46 @@ AddAndRemoveImageAssociations(nsFrame* a
// backgrounds from some other frame's style data, and we don't want
// to clear those notifiers unless we have to. (They'll be reset
// when we paint, although we could miss a notification in that
// interval.)
if (aOldLayers) {
NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(i, (*aOldLayers)) {
// If there is an image in oldBG that's not in newBG, drop it.
+ const nsStyleImage& oldImage = aOldLayers->mLayers[i].mImage;
+ if (!oldImage.IsResolved()) {
+ continue;
+ }
if (i >= aNewLayers->mImageCount ||
!aOldLayers->mLayers[i].mImage.ImageDataEquals(
aNewLayers->mLayers[i].mImage)) {
- const nsStyleImage& oldImage = aOldLayers->mLayers[i].mImage;
if (oldImage.GetType() != eStyleImageType_Image) {
continue;
}
if (aFrame->HasImageRequest()) {
if (imgRequestProxy* req = oldImage.GetImageData()) {
imageLoader->DisassociateRequestFromFrame(req, aFrame);
}
}
}
}
}
NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(i, (*aNewLayers)) {
// If there is an image in newBG that's not in oldBG, add it.
+ const nsStyleImage& newImage = aNewLayers->mLayers[i].mImage;
+ if (!newImage.IsResolved()) {
+ continue;
+ }
if (!aOldLayers || i >= aOldLayers->mImageCount ||
!aNewLayers->mLayers[i].mImage.ImageDataEquals(
aOldLayers->mLayers[i].mImage)) {
- const nsStyleImage& newImage = aNewLayers->mLayers[i].mImage;
- if (newImage.GetType() != eStyleImageType_Image ||
- !newImage.IsResolved()) {
+ if (newImage.GetType() != eStyleImageType_Image) {
continue;
}
if (imgRequestProxy* req = newImage.GetImageData()) {
imageLoader->AssociateRequestToFrame(req, aFrame);
}
}
}
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -1194,25 +1194,16 @@ nsStyleSVGReset::nsStyleSVGReset(const n
void
nsStyleSVGReset::Destroy(nsPresContext* aContext)
{
this->~nsStyleSVGReset();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleSVGReset, this);
}
-void
-nsStyleSVGReset::FinishStyle(nsPresContext* aPresContext)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aPresContext->StyleSet()->IsServo());
-
- mMask.ResolveImages(aPresContext);
-}
-
nsChangeHint
nsStyleSVGReset::CalcDifference(const nsStyleSVGReset& aNewData) const
{
nsChangeHint hint = nsChangeHint(0);
if (!mClipPath.DefinitelyEquals(aNewData.mClipPath)) {
hint |= nsChangeHint_UpdateEffects |
nsChangeHint_RepaintFrame;
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3679,20 +3679,17 @@ struct nsTArray_CopyChooser<nsStyleFilte
};
struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset
{
explicit nsStyleSVGReset(const nsPresContext* aContext);
nsStyleSVGReset(const nsStyleSVGReset& aSource);
~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* aPresContext);
+ void FinishStyle(nsPresContext* aPresContext) {}
const static bool kHasFinishStyle = true;
void* operator new(size_t sz, nsStyleSVGReset* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleSVGReset, sz);
}
void Destroy(nsPresContext* aContext);