Bug 1374966 - Drop nsChangeHint_UpdateTransformLayer when we also have nsChangeHint_AddOrRemoveTransform; r=heycam
authorBrian Birtles <birtles@gmail.com>
Thu, 27 Jul 2017 12:05:47 +0900
changeset 420252 6d372311a32e5cb4dc24f93cdac71dc1cd2ae9b2
parent 420251 9bba40accbf61384715d963df18e05227676591f
child 420253 ff43f98ed0d67bf0b5816ad6d68fb95ff90c5288
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
bugs1374966
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 1374966 - Drop nsChangeHint_UpdateTransformLayer when we also have nsChangeHint_AddOrRemoveTransform; r=heycam MozReview-Commit-ID: 2eFl7cDXNA
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1526,16 +1526,35 @@ RestyleManager::ProcessRestyledFrames(ns
 
       if (!(frame->GetStateBits() & NS_FRAME_MAY_BE_TRANSFORMED)) {
         // Frame can not be transformed, and thus a change in transform will
         // have no effect and we should not use the
         // nsChangeHint_UpdatePostTransformOverflow hint.
         hint &= ~nsChangeHint_UpdatePostTransformOverflow;
       }
 
+      if (hint & nsChangeHint_AddOrRemoveTransform) {
+        // When dropping a running transform animation we will first add an
+        // nsChangeHint_UpdateTransformLayer hint as part of the animation-only
+        // restyle. During the subsequent regular restyle, if the animation was
+        // the only reason the element had any transform applied, we will add
+        // nsChangeHint_AddOrRemoveTransform as part of the regular restyle.
+        //
+        // With the Gecko backend, these two change hints are processed
+        // after each restyle but when using the Servo backend they accumulate
+        // and are processed together after we have already removed the
+        // transform as part of the regular restyle. Since we don't actually
+        // need the nsChangeHint_UpdateTransformLayer hint if we already have
+        // a nsChangeHint_AddOrRemoveTransform hint, and since we
+        // will fail an assertion in ApplyRenderingChangeToTree if we try
+        // specify nsChangeHint_UpdateTransformLayer but don't have any
+        // transform style, we just drop the unneeded hint here.
+        hint &= ~nsChangeHint_UpdateTransformLayer;
+      }
+
       if (hint & nsChangeHint_UpdateEffects) {
         for (nsIFrame* cont = frame; cont;
              cont = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(cont)) {
           nsSVGEffects::UpdateEffects(cont);
         }
       }
       if ((hint & nsChangeHint_InvalidateRenderingObservers) ||
           ((hint & nsChangeHint_UpdateOpacityLayer) &&