Bug 1341083: Cleanup infallible ProcessRestyledFrames. r?heycam
MozReview-Commit-ID: JfugKoU6caG
--- 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: