diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3426,19 +3426,19 @@ bool
 nsStyleBackground::IsTransparent(const nsIFrame* aFrame) const
 {
   return IsTransparent(aFrame->StyleContext());
 }
 
 bool
 nsStyleBackground::IsTransparent(nsStyleContext* aContext) const
 {
-  return BottomLayer().mImage.IsEmpty() &&
-         mImage.mImageCount == 1 &&
-         NS_GET_A(BackgroundColor(aContext)) == 0;
+  return mImage.mImageCount == 1 &&
+         NS_GET_A(BackgroundColor(aContext)) == 0 &&
+         BottomLayer().mImage.IsEmpty();
 }
 
 void
 nsTimingFunction::AssignFromKeyword(int32_t aTimingFunctionType)
 {
   switch (aTimingFunctionType) {
     case NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START:
       mType = Type::StepStart;
