Bug 1341083: Cleanup infallible ProcessRestyledFrames. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 17 Feb 2017 20:25:56 +0100
changeset 489455 f41819399a7f4494fae4dbdced2462502136f846
parent 489454 f68ac7a260c17fc272dc5dfb9057a134200a8296
child 489456 462c35542bbbb5b5a4e38f92f516a3ed7e7ab8d5
push id46822
push userbmo:emilio+bugs@crisal.io
push dateFri, 24 Feb 2017 20:50:08 +0000
reviewersheycam
bugs1341083
milestone54.0a1
Bug 1341083: Cleanup infallible ProcessRestyledFrames. r?heycam MozReview-Commit-ID: JfugKoU6caG
layout/base/PresShell.cpp
layout/base/RestyleManager.cpp
layout/base/RestyleManager.h
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -2908,21 +2908,21 @@ PresShell::RecreateFramesFor(nsIContent*
   nsAutoScriptBlocker scriptBlocker;
 
   nsStyleChangeList changeList;
   changeList.AppendChange(nullptr, aContent, nsChangeHint_ReconstructFrame);
 
   // Mark ourselves as not safe to flush while we're doing frame construction.
   ++mChangeNestCount;
   RestyleManager* restyleManager = mPresContext->RestyleManager();
-  nsresult rv = restyleManager->ProcessRestyledFrames(changeList);
+  restyleManager->ProcessRestyledFrames(changeList);
   restyleManager->FlushOverflowChangedTracker();
   --mChangeNestCount;
 
-  return rv;
+  return NS_OK;
 }
 
 void
 nsIPresShell::PostRecreateFramesFor(Element* aElement)
 {
   mPresContext->RestyleManager()->PostRestyleEvent(aElement, nsRestyleHint(0),
                                                    nsChangeHint_ReconstructFrame);
 }
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1355,23 +1355,23 @@ RestyleManager::GetNextContinuationWithS
     nextContinuation = nullptr;
     if (aHaveMoreContinuations) {
       *aHaveMoreContinuations = true;
     }
   }
   return nextContinuation;
 }
 
-nsresult
+void
 RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
 {
   NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
                "Someone forgot a script blocker");
   if (aChangeList.IsEmpty())
-    return NS_OK;
+    return;
 
   PROFILER_LABEL("RestyleManager", "ProcessRestyledFrames",
                  js::ProfileEntry::Category::CSS);
 
   nsPresContext* presContext = PresContext();
   FramePropertyTable* propTable = presContext->PropertyTable();
   nsCSSFrameConstructor* frameConstructor = presContext->FrameConstructor();
 
@@ -1672,17 +1672,16 @@ RestyleManager::ProcessRestyledFrames(ns
                data.mFrame->GetType() != nsGkAtoms::viewportFrame) {
       NS_WARNING("Unable to test style tree integrity -- no content node "
                  "(and not a viewport frame)");
     }
 #endif
   }
 
   aChangeList.Clear();
-  return NS_OK;
 }
 
 RestyleManager::AnimationsWithDestroyedFrame::AnimationsWithDestroyedFrame(
                                                 RestyleManager* aRestyleManager)
   : mRestyleManager(aRestyleManager)
   , mRestorePointer(mRestyleManager->mAnimationsWithDestroyedFrame)
 {
   MOZ_ASSERT(!mRestyleManager->mAnimationsWithDestroyedFrame,
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -73,17 +73,17 @@ public:
     mOverflowChangedTracker.RemoveFrame(aFrame);
   }
 
   // Note: It's the caller's responsibility to make sure to wrap a
   // ProcessRestyledFrames call in a view update batch and a script blocker.
   // This function does not call ProcessAttachedQueue() on the binding manager.
   // If the caller wants that to happen synchronously, it needs to handle that
   // itself.
-  nsresult ProcessRestyledFrames(nsStyleChangeList& aChangeList);
+  void ProcessRestyledFrames(nsStyleChangeList& aChangeList);
 
   bool IsInStyleRefresh() const { return mInStyleRefresh; }
 
   // AnimationsWithDestroyedFrame is used to stop animations and transitions
   // on elements that have no frame at the end of the restyling process.
   // It only lives during the restyling process.
   class MOZ_STACK_CLASS AnimationsWithDestroyedFrame final {
   public: