mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-12 06:52:25 +00:00
Bug 896138 patch 10: Move beginning and ending of ProcessPendingRestyles into helper functions on the RestyleManager. r=heycam
This commit is contained in:
parent
e0fc597437
commit
ffe927da2c
@ -1371,6 +1371,32 @@ RestyleManager::ProcessPendingRestyles()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RestyleManager::BeginProcessingRestyles()
|
||||
{
|
||||
// Make sure to not rebuild quote or counter lists while we're
|
||||
// processing restyles
|
||||
mPresContext->FrameConstructor()->BeginUpdate();
|
||||
|
||||
mInStyleRefresh = true;
|
||||
}
|
||||
|
||||
void
|
||||
RestyleManager::EndProcessingRestyles()
|
||||
{
|
||||
FlushOverflowChangedTracker();
|
||||
|
||||
// Set mInStyleRefresh to false now, since the EndUpdate call might
|
||||
// add more restyles.
|
||||
mInStyleRefresh = false;
|
||||
|
||||
mPresContext->FrameConstructor()->EndUpdate();
|
||||
|
||||
#ifdef DEBUG
|
||||
mPresContext->PresShell()->VerifyStyleTree();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
RestyleManager::PostRestyleEventCommon(Element* aElement,
|
||||
nsRestyleHint aRestyleHint,
|
||||
|
@ -145,6 +145,12 @@ public:
|
||||
// itself.
|
||||
void ProcessPendingRestyles();
|
||||
|
||||
// ProcessPendingRestyles calls into one of our RestyleTracker
|
||||
// objects. It then calls back to these functions at the beginning
|
||||
// and end of its work.
|
||||
void BeginProcessingRestyles();
|
||||
void EndProcessingRestyles();
|
||||
|
||||
// Rebuilds all style data by throwing out the old rule tree and
|
||||
// building a new one, and additionally applying aExtraHint (which
|
||||
// must not contain nsChangeHint_ReconstructFrame) to the root frame.
|
||||
@ -179,11 +185,6 @@ public:
|
||||
PostRestyleEventInternal(true);
|
||||
}
|
||||
|
||||
void SetInStyleRefresh(bool aInStyleRefresh)
|
||||
{
|
||||
mInStyleRefresh = aInStyleRefresh;
|
||||
}
|
||||
|
||||
void FlushOverflowChangedTracker()
|
||||
{
|
||||
mOverflowChangedTracker.Flush();
|
||||
|
@ -135,11 +135,8 @@ void
|
||||
RestyleTracker::DoProcessRestyles()
|
||||
{
|
||||
PROFILER_LABEL("CSS", "ProcessRestyles");
|
||||
// Make sure to not rebuild quote or counter lists while we're
|
||||
// processing restyles
|
||||
mRestyleManager->PresContext()->FrameConstructor()->BeginUpdate();
|
||||
|
||||
mRestyleManager->SetInStyleRefresh(true);
|
||||
mRestyleManager->BeginProcessingRestyles();
|
||||
|
||||
// loop so that we process any restyle events generated by processing
|
||||
while (mPendingRestyles.Count()) {
|
||||
@ -239,17 +236,7 @@ RestyleTracker::DoProcessRestyles()
|
||||
}
|
||||
}
|
||||
|
||||
mRestyleManager->FlushOverflowChangedTracker();
|
||||
|
||||
// SetInStyleRefresh(false) now, since the EndUpdate call might
|
||||
// add more restyles.
|
||||
mRestyleManager->SetInStyleRefresh(false);
|
||||
|
||||
mRestyleManager->PresContext()->FrameConstructor()->EndUpdate();
|
||||
|
||||
#ifdef DEBUG
|
||||
mRestyleManager->PresContext()->PresShell()->VerifyStyleTree();
|
||||
#endif
|
||||
mRestyleManager->EndProcessingRestyles();
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user