Bug 1301245 - Part 1. Implement nsStyleImage::IsResolved. r=heycam
authorcku <cku@mozilla.com>
Thu, 20 Jul 2017 01:02:17 +0800
changeset 419798 76ec2bd0f25126da421ce9c9150a6a92450f5ce1
parent 419797 8b274bfe790511b3517f9dc98f54f56efc8dee7c
child 419799 ebe4713f3fbac2e08c36ab6b85bec40d198ce719
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1301245
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1301245 - Part 1. Implement nsStyleImage::IsResolved. r=heycam We need this new API in the following patch. MozReview-Commit-ID: JSoCgzKWrfs
layout/style/nsStyleStruct.h
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -458,16 +458,19 @@ struct nsStyleImage
   }
   imgRequestProxy* GetImageData() const {
     return GetImageRequest()->get();
   }
   nsStyleGradient* GetGradientData() const {
     NS_ASSERTION(mType == eStyleImageType_Gradient, "Data is not a gradient!");
     return mGradient;
   }
+  bool IsResolved() const {
+    return mType != eStyleImageType_Image || GetImageRequest()->IsResolved();
+  }
   const nsIAtom* GetElementId() const {
     NS_ASSERTION(mType == eStyleImageType_Element, "Data is not an element!");
     return mElementId;
   }
   const mozilla::UniquePtr<nsStyleSides>& GetCropRect() const {
     NS_ASSERTION(mType == eStyleImageType_Image,
                  "Only image data can have a crop rect");
     return mCropRect;