Bug 1344619 - Part 7: Drop EffectCompositor::ClearElementsToRestyle. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 09 Mar 2017 05:20:17 +0900
changeset 495419 67fe777fb2e38b1d6d1f75b4369e3e5dfd88bea7
parent 495418 1bbc77f1b16795a0cec1d76340de523b3ef06404
child 495549 b6bc8384614f39fe3e3641080580faac8609acfa
push id48329
push userhikezoe@mozilla.com
push dateWed, 08 Mar 2017 20:20:57 +0000
reviewersbirtles
bugs1344619
milestone55.0a1
Bug 1344619 - Part 7: Drop EffectCompositor::ClearElementsToRestyle. r?birtles MozReview-Commit-ID: DlTj2OR0wI0
dom/animation/EffectCompositor.cpp
dom/animation/EffectCompositor.h
layout/base/ServoRestyleManager.cpp
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -492,26 +492,16 @@ EffectCompositor::GetServoAnimationRule(
   }
 
   MOZ_ASSERT(effectSet == EffectSet::GetEffectSet(aElement, aPseudoType),
              "EffectSet should not change while composing style");
 
   return animRule.mServo;
 }
 
-void
-EffectCompositor::ClearElementsToRestyle()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  const auto iterEnd = mElementsToRestyle.end();
-  for (auto iter = mElementsToRestyle.begin(); iter != iterEnd; ++iter) {
-    iter->Clear();
-  }
-}
-
 /* static */ dom::Element*
 EffectCompositor::GetElementToRestyle(dom::Element* aElement,
                                       CSSPseudoElementType aPseudoType)
 {
   if (aPseudoType == CSSPseudoElementType::NotPseudo) {
     return aElement;
   }
 
--- a/dom/animation/EffectCompositor.h
+++ b/dom/animation/EffectCompositor.h
@@ -154,24 +154,16 @@ public:
 
   // Get animation rule for stylo. This is an equivalent of GetAnimationRule
   // and will be called from servo side. We need to be careful while doing any
   // modification because it may case some thread-safe issues.
   ServoAnimationRule* GetServoAnimationRule(const dom::Element* aElement,
                                             CSSPseudoElementType aPseudoType,
                                             CascadeLevel aCascadeLevel);
 
-  // Clear mElementsToRestyle hashtable. Unlike GetAnimationRule,
-  // in GetServoAnimationRule, we don't remove the entry of the composed
-  // animation, so we can prevent the thread-safe issues of dom::Element.
-  // Therefore, we need to call Clear mElementsToRestyle until we go back to
-  // Gecko side.
-  // FIXME: we shouldn't clear the animations on the compositor.
-  void ClearElementsToRestyle();
-
   bool HasPendingStyleUpdates() const;
   bool HasThrottledStyleUpdates() const;
 
   // Tell the restyle tracker about all the animated styles that have
   // pending updates so that it can update the animation rule for these
   // elements.
   void AddStyleUpdatesTo(RestyleTracker& aTracker);
 
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -378,18 +378,16 @@ ServoRestyleManager::ProcessPendingResty
   PresContext()->RefreshDriver()->MostRecentRefresh();
 
 
   // Perform the Servo traversal, and the post-traversal if required. We do this
   // in a loop because certain rare paths in the frame constructor (like
   // uninstalling XBL bindings) can trigger additional style validations.
   mInStyleRefresh = true;
   while (styleSet->StyleDocument()) {
-    PresContext()->EffectCompositor()->ClearElementsToRestyle();
-
     // Recreate style contexts, and queue up change hints (which also handle
     // lazy frame construction).
     nsStyleChangeList currentChanges(StyleBackendType::Servo);
     DocumentStyleRootIterator iter(doc);
     while (Element* root = iter.GetNextStyleRoot()) {
       ProcessPostTraversal(root, nullptr, styleSet, currentChanges);
     }