Backout changeset 3fb9ea77d858 for bug 876321 due to test failures (CLOSED TREE)
authorRobert O'Callahan <robert@ocallahan.org>
Sun, 03 Nov 2013 23:14:26 -0800
changeset 153331 b4143e04bea1482d74ec2575a9e4b21e01034dfd
parent 153330 516c014354de61890752997eaa382cc97ef52847
child 153333 fa59c8212e9e5ffba3d68c9caf426845e0297588
child 153363 b8051da2a5306127460e0902612efd6e6772df60
push id25581
push usercbook@mozilla.com
push dateMon, 04 Nov 2013 12:33:37 +0000
treeherdermozilla-central@b4143e04bea1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs876321
milestone28.0a1
backs out3fb9ea77d8583f331388fe57398c3e4972e8b6af
first release with
nightly linux32
b4143e04bea1 / 28.0a1 / 20131104044747 / files
nightly linux64
b4143e04bea1 / 28.0a1 / 20131104044747 / files
nightly mac
b4143e04bea1 / 28.0a1 / 20131104044747 / files
nightly win32
b4143e04bea1 / 28.0a1 / 20131104044747 / files
nightly win64
b4143e04bea1 / 28.0a1 / 20131104044747 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout changeset 3fb9ea77d858 for bug 876321 due to test failures (CLOSED TREE)
layout/base/ActiveLayerTracker.cpp
layout/base/ActiveLayerTracker.h
layout/base/RestyleManager.cpp
layout/base/nsLayoutUtils.cpp
layout/generic/nsIFrame.h
layout/style/nsDOMCSSAttrDeclaration.cpp
--- a/layout/base/ActiveLayerTracker.cpp
+++ b/layout/base/ActiveLayerTracker.cpp
@@ -33,33 +33,25 @@ public:
   {}
   ~LayerActivity();
   nsExpirationState* GetExpirationState() { return &mState; }
   uint8_t& RestyleCountForProperty(nsCSSProperty aProperty)
   {
     switch (aProperty) {
     case eCSSProperty_opacity: return mOpacityRestyleCount;
     case eCSSProperty_transform: return mTransformRestyleCount;
-    case eCSSProperty_left: return mLeftRestyleCount;
-    case eCSSProperty_top: return mTopRestyleCount;
-    case eCSSProperty_right: return mRightRestyleCount;
-    case eCSSProperty_bottom: return mBottomRestyleCount;
     default: MOZ_ASSERT(false); return mOpacityRestyleCount;
     }
   }
 
   nsIFrame* mFrame;
   nsExpirationState mState;
   // Number of restyle operations detected
   uint8_t mOpacityRestyleCount;
   uint8_t mTransformRestyleCount;
-  uint8_t mLeftRestyleCount;
-  uint8_t mTopRestyleCount;
-  uint8_t mRightRestyleCount;
-  uint8_t mBottomRestyleCount;
   bool mContentActive;
 };
 
 class LayerActivityTracker MOZ_FINAL : public nsExpirationTracker<LayerActivity,4> {
 public:
   // 75-100ms is a good timeout period. We use 4 generations of 25ms each.
   enum { GENERATION_MS = 100 };
   LayerActivityTracker()
@@ -81,38 +73,33 @@ LayerActivity::~LayerActivity()
   }
 }
 
 static void DestroyLayerActivity(void* aPropertyValue)
 {
   delete static_cast<LayerActivity*>(aPropertyValue);
 }
 
-// Frames with this property have NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY set
 NS_DECLARE_FRAME_PROPERTY(LayerActivityProperty, DestroyLayerActivity)
 
 void
 LayerActivityTracker::NotifyExpired(LayerActivity* aObject)
 {
   RemoveObject(aObject);
 
   nsIFrame* f = aObject->mFrame;
   aObject->mFrame = nullptr;
 
   f->SchedulePaint();
-  f->RemoveStateBits(NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY);
   f->Properties().Delete(LayerActivityProperty());
 }
 
 static LayerActivity*
 GetLayerActivity(nsIFrame* aFrame)
 {
-  if (!aFrame->HasAnyStateBits(NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY)) {
-    return nullptr;
-  }
   FrameProperties properties = aFrame->Properties();
   return static_cast<LayerActivity*>(properties.Get(LayerActivityProperty()));
 }
 
 static LayerActivity*
 GetLayerActivityForUpdate(nsIFrame* aFrame)
 {
   FrameProperties properties = aFrame->Properties();
@@ -121,44 +108,27 @@ GetLayerActivityForUpdate(nsIFrame* aFra
   if (layerActivity) {
     gLayerActivityTracker->MarkUsed(layerActivity);
   } else {
     if (!gLayerActivityTracker) {
       gLayerActivityTracker = new LayerActivityTracker();
     }
     layerActivity = new LayerActivity(aFrame);
     gLayerActivityTracker->AddObject(layerActivity);
-    aFrame->AddStateBits(NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY);
     properties.Set(LayerActivityProperty(), layerActivity);
   }
   return layerActivity;
 }
 
-static void
-IncrementMutationCount(uint8_t* aCount)
-{
-  *aCount = uint8_t(std::min(0xFF, *aCount + 1));
-}
-
 /* static */ void
 ActiveLayerTracker::NotifyRestyle(nsIFrame* aFrame, nsCSSProperty aProperty)
 {
   LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
   uint8_t& mutationCount = layerActivity->RestyleCountForProperty(aProperty);
-  IncrementMutationCount(&mutationCount);
-}
-
-/* static */ void
-ActiveLayerTracker::NotifyOffsetRestyle(nsIFrame* aFrame)
-{
-  LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
-  IncrementMutationCount(&layerActivity->mLeftRestyleCount);
-  IncrementMutationCount(&layerActivity->mTopRestyleCount);
-  IncrementMutationCount(&layerActivity->mRightRestyleCount);
-  IncrementMutationCount(&layerActivity->mBottomRestyleCount);
+  mutationCount = uint8_t(std::min(0xFF, mutationCount + 1));
 }
 
 /* static */ void
 ActiveLayerTracker::NotifyAnimated(nsIFrame* aFrame, nsCSSProperty aProperty)
 {
   LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
   uint8_t& mutationCount = layerActivity->RestyleCountForProperty(aProperty);
   // We know this is animated, so just hack the mutation count.
@@ -197,31 +167,16 @@ ActiveLayerTracker::IsStyleAnimated(nsIF
     }
   }
   if (aProperty == eCSSProperty_transform && aFrame->Preserves3D()) {
     return IsStyleAnimated(aFrame->GetParent(), aProperty);
   }
   return false;
 }
 
-/* static */ bool
-ActiveLayerTracker::IsOffsetStyleAnimated(nsIFrame* aFrame)
-{
-  LayerActivity* layerActivity = GetLayerActivity(aFrame);
-  if (layerActivity) {
-    if (layerActivity->mLeftRestyleCount >= 2 ||
-        layerActivity->mTopRestyleCount >= 2 ||
-        layerActivity->mRightRestyleCount >= 2 ||
-        layerActivity->mBottomRestyleCount >= 2) {
-      return true;
-    }
-  }
-  return false;
-}
-
 /* static */ void
 ActiveLayerTracker::NotifyContentChange(nsIFrame* aFrame)
 {
   LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
   layerActivity->mContentActive = true;
 }
 
 /* static */ bool
--- a/layout/base/ActiveLayerTracker.h
+++ b/layout/base/ActiveLayerTracker.h
@@ -17,58 +17,44 @@ namespace mozilla {
  * that drive those decisions. It manages per-frame state to support those
  * heuristics.
  */
 class ActiveLayerTracker {
 public:
   static void Shutdown();
 
   /*
-   * We track style changes to selected styles:
-   *   eCSSProperty_transform
-   *   eCSSProperty_opacity
-   *   eCSSProperty_left, eCSSProperty_top, eCSSProperty_right, eCSSProperty_bottom
+   * We track eCSSProperty_transform and eCSSProperty_opacity style changes
    * and use that information to guess whether style changes are animated.
    */
 
   /**
    * Notify aFrame's style property as having changed due to a restyle,
    * and therefore possibly wanting an active layer to render that style.
    * Any such marking will time out after a short period.
    * @param aProperty the property that has changed
    */
   static void NotifyRestyle(nsIFrame* aFrame, nsCSSProperty aProperty);
   /**
-   * Notify aFrame's left/top/right/bottom properties as having (maybe)
-   * changed due to a restyle, and therefore possibly wanting an active layer
-   * to render that style. Any such marking will time out after a short period.
-   */
-  static void NotifyOffsetRestyle(nsIFrame* aFrame);
-  /**
    * Mark aFrame as being known to have an animation of aProperty.
    * Any such marking will time out after a short period.
    */
   static void NotifyAnimated(nsIFrame* aFrame, nsCSSProperty aProperty);
   /**
    * Notify that a property in the inline style rule of aFrame's element
    * has been modified.
    * This notification is incomplete --- not all modifications to inline
    * style will trigger this.
    */
   static void NotifyInlineStyleRuleModified(nsIFrame* aFrame, nsCSSProperty aProperty);
   /**
    * Return true if aFrame's aProperty style should be considered as being animated
    * for constructing active layers.
    */
   static bool IsStyleAnimated(nsIFrame* aFrame, nsCSSProperty aProperty);
-  /**
-   * Return true if any of aFrame's offset property styles should be considered
-   * as being animated for constructing active layers.
-   */
-  static bool IsOffsetStyleAnimated(nsIFrame* aFrame);
 
   /*
    * We track modifications to the content of certain frames (i.e. canvas frames)
    * and use that to make layering decisions.
    */
 
   /**
    * Mark aFrame's content as being active. This marking will time out after
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -698,17 +698,16 @@ RestyleManager::ProcessRestyledFrames(ns
         didReflowThisFrame = true;
       }
       if (hint & (nsChangeHint_RepaintFrame | nsChangeHint_SyncFrameView |
                   nsChangeHint_UpdateOpacityLayer | nsChangeHint_UpdateTransformLayer |
                   nsChangeHint_ChildrenOnlyTransform)) {
         ApplyRenderingChangeToTree(mPresContext, frame, hint);
       }
       if ((hint & nsChangeHint_RecomputePosition) && !didReflowThisFrame) {
-        ActiveLayerTracker::NotifyOffsetRestyle(frame);
         // It is possible for this to fall back to a reflow
         if (!RecomputePosition(frame)) {
           didReflowThisFrame = true;
         }
       }
       NS_ASSERTION(!(hint & nsChangeHint_ChildrenOnlyTransform) ||
                    (hint & nsChangeHint_UpdateOverflow),
                    "nsChangeHint_UpdateOverflow should be passed too");
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -66,17 +66,16 @@
 #include "nsFontInflationData.h"
 #include "nsSVGUtils.h"
 #include "nsSVGTextFrame2.h"
 #include "nsStyleStructInlines.h"
 #include "nsStyleTransformMatrix.h"
 #include "nsIFrameInlines.h"
 #include "ImageContainer.h"
 #include "nsComputedDOMStyle.h"
-#include "ActiveLayerTracker.h"
 
 #include "mozilla/Preferences.h"
 
 #ifdef MOZ_XUL
 #include "nsXULPopupManager.h"
 #endif
 
 #include "GeckoProfiler.h"
@@ -1250,18 +1249,16 @@ nsIFrame*
 nsLayoutUtils::GetActiveScrolledRootFor(nsIFrame* aFrame,
                                         const nsIFrame* aStopAtAncestor)
 {
   nsIFrame* f = aFrame;
   nsIFrame* stickyFrame = nullptr;
   while (f != aStopAtAncestor) {
     if (IsPopup(f))
       break;
-    if (ActiveLayerTracker::IsOffsetStyleAnimated(f))
-      break;
     nsIFrame* parent = GetCrossDocParentFrame(f);
     if (!parent)
       break;
     // Sticky frames are active if their nearest scrollable frame
     // is also active, just keep a record of sticky frames that we
     // encounter for now.
     if (f->StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY &&
         !stickyFrame) {
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -322,19 +322,16 @@ typedef uint64_t nsFrameState;
 // Frame is marked as NS_FRAME_NEEDS_PAINT and also has an explicit
 // rect stored to invalidate.
 #define NS_FRAME_HAS_INVALID_RECT                   NS_FRAME_STATE_BIT(52)
 
 // Frame is not displayed directly due to it being, or being under, an SVG
 // <defs> element or an SVG resource element (<mask>, <pattern>, etc.)
 #define NS_FRAME_IS_NONDISPLAY                      NS_FRAME_STATE_BIT(53)
 
-// Frame has a LayerActivityProperty property
-#define NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY        NS_FRAME_STATE_BIT(54)
-
 // Box layout bits
 #define NS_STATE_IS_HORIZONTAL                      NS_FRAME_STATE_BIT(22)
 #define NS_STATE_IS_DIRECTION_NORMAL                NS_FRAME_STATE_BIT(31)
 
 // Helper macros
 #define NS_SUBTREE_DIRTY(_frame)  \
   (((_frame)->GetStateBits() &      \
     (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) != 0)
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -173,18 +173,16 @@ nsDOMCSSAttributeDeclaration::GetParentO
 
 NS_IMETHODIMP
 nsDOMCSSAttributeDeclaration::SetPropertyValue(const nsCSSProperty aPropID,
                                                const nsAString& aValue)
 {
   // Scripted modifications to style.opacity or style.transform
   // could immediately force us into the animated state if heuristics suggest
   // this is scripted animation.
-  if (aPropID == eCSSProperty_opacity || aPropID == eCSSProperty_transform ||
-      aPropID == eCSSProperty_left || aPropID == eCSSProperty_top ||
-      aPropID == eCSSProperty_right || aPropID == eCSSProperty_bottom) {
+  if (aPropID == eCSSProperty_opacity || aPropID == eCSSProperty_transform) {
     nsIFrame* frame = mElement->GetPrimaryFrame();
     if (frame) {
       ActiveLayerTracker::NotifyInlineStyleRuleModified(frame, aPropID);
     }
   }
   return nsDOMCSSDeclaration::SetPropertyValue(aPropID, aValue);
 }