Bug 1463605 - Check mMayHaveOpacityAnimation in nsFrame::HasOpacityInternal(). r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 23 May 2018 18:15:12 +0900
changeset 798671 30afd4222e9be5138ed5ebb73f1158313ff760cf
parent 798670 617058506bb9bd96050c088832f7853cf5dbf76f
child 798672 e1a3cb72c379c24b25ae5aacaa4ae97af6ea76a4
push id110818
push userbmo:hikezoe@mozilla.com
push dateWed, 23 May 2018 09:17:42 +0000
reviewersbirtles
bugs1463605
milestone62.0a1
Bug 1463605 - Check mMayHaveOpacityAnimation in nsFrame::HasOpacityInternal(). r?birtles If the mMayHaveOpacityAnimation is false there, we don't need to check opacity animations at all. MozReview-Commit-ID: LTYPPXzF8V6
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1541,16 +1541,20 @@ nsIFrame::HasOpacityInternal(float aThre
                              EffectSet* aEffectSet) const
 {
   MOZ_ASSERT(0.0 <= aThreshold && aThreshold <= 1.0, "Invalid argument");
   if (StyleEffects()->mOpacity < aThreshold ||
       (StyleDisplay()->mWillChangeBitField & NS_STYLE_WILL_CHANGE_OPACITY)) {
     return true;
   }
 
+  if (!mMayHaveOpacityAnimation) {
+    return false;
+  }
+
   EffectSet* effects =
     aEffectSet ? aEffectSet : EffectSet::GetEffectSet(this);
   if (!effects) {
     return false;
   }
 
   return ((IsPrimaryFrame() ||
            nsLayoutUtils::FirstContinuationOrIBSplitSibling(this)->