зеркало из https://github.com/mozilla/gecko-dev.git
Bug 804970, patch 4: Refactor part of RebuildAllStyleData into a helper function (slightly reordering it), so that we can share that part. r=bzbarsky
This commit is contained in:
Родитель
0fac8d37bf
Коммит
ae03fa3b5b
|
@ -12101,6 +12101,24 @@ nsCSSFrameConstructor::RebuildAllStyleData(nsChangeHint aExtraHint)
|
||||||
|
|
||||||
nsAutoScriptBlocker scriptBlocker;
|
nsAutoScriptBlocker scriptBlocker;
|
||||||
|
|
||||||
|
nsPresContext *presContext = mPresShell->GetPresContext();
|
||||||
|
presContext->SetProcessingRestyles(true);
|
||||||
|
|
||||||
|
DoRebuildAllStyleData(mPendingRestyles, aExtraHint);
|
||||||
|
|
||||||
|
presContext->SetProcessingRestyles(false);
|
||||||
|
|
||||||
|
// Make sure that we process any pending animation restyles from the
|
||||||
|
// above style change. Note that we can *almost* implement the above
|
||||||
|
// by just posting a style change -- except we really need to restyle
|
||||||
|
// the root frame rather than the root element's primary frame.
|
||||||
|
ProcessPendingRestyles();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsCSSFrameConstructor::DoRebuildAllStyleData(RestyleTracker& aRestyleTracker,
|
||||||
|
nsChangeHint aExtraHint)
|
||||||
|
{
|
||||||
// Tell the style set to get the old rule tree out of the way
|
// Tell the style set to get the old rule tree out of the way
|
||||||
// so we can recalculate while maintaining rule tree immutability
|
// so we can recalculate while maintaining rule tree immutability
|
||||||
nsresult rv = mPresShell->StyleSet()->BeginReconstruct();
|
nsresult rv = mPresShell->StyleSet()->BeginReconstruct();
|
||||||
|
@ -12108,8 +12126,6 @@ nsCSSFrameConstructor::RebuildAllStyleData(nsChangeHint aExtraHint)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsPresContext *presContext = mPresShell->GetPresContext();
|
|
||||||
presContext->SetProcessingRestyles(true);
|
|
||||||
// Recalculate all of the style contexts for the document
|
// Recalculate all of the style contexts for the document
|
||||||
// Note that we can ignore the return value of ComputeStyleChangeFor
|
// Note that we can ignore the return value of ComputeStyleChangeFor
|
||||||
// because we never need to reframe the root frame
|
// because we never need to reframe the root frame
|
||||||
|
@ -12122,16 +12138,9 @@ nsCSSFrameConstructor::RebuildAllStyleData(nsChangeHint aExtraHint)
|
||||||
// Note: The restyle tracker we pass in here doesn't matter.
|
// Note: The restyle tracker we pass in here doesn't matter.
|
||||||
ComputeStyleChangeFor(mPresShell->GetRootFrame(),
|
ComputeStyleChangeFor(mPresShell->GetRootFrame(),
|
||||||
&changeList, aExtraHint,
|
&changeList, aExtraHint,
|
||||||
mPendingRestyles, true);
|
aRestyleTracker, true);
|
||||||
// Process the required changes
|
// Process the required changes
|
||||||
ProcessRestyledFrames(changeList);
|
ProcessRestyledFrames(changeList);
|
||||||
presContext->SetProcessingRestyles(false);
|
|
||||||
|
|
||||||
// Make sure that we process any pending animation restyles from the
|
|
||||||
// above style change. Note that we can *almost* implement the above
|
|
||||||
// by just posting a style change -- except we really need to restyle
|
|
||||||
// the root frame rather than the root element's primary frame.
|
|
||||||
ProcessPendingRestyles();
|
|
||||||
|
|
||||||
// Tell the style set it's safe to destroy the old rule tree. We
|
// Tell the style set it's safe to destroy the old rule tree. We
|
||||||
// must do this after the ProcessRestyledFrames call in case the
|
// must do this after the ProcessRestyledFrames call in case the
|
||||||
|
|
|
@ -276,6 +276,11 @@ public:
|
||||||
// must not contain nsChangeHint_ReconstructFrame) to the root frame.
|
// must not contain nsChangeHint_ReconstructFrame) to the root frame.
|
||||||
void RebuildAllStyleData(nsChangeHint aExtraHint);
|
void RebuildAllStyleData(nsChangeHint aExtraHint);
|
||||||
|
|
||||||
|
// Helper that does part of the work of RebuildAllStyleData, shared by
|
||||||
|
// RestyleElement for 'rem' handling.
|
||||||
|
void DoRebuildAllStyleData(RestyleTracker& aRestyleTracker,
|
||||||
|
nsChangeHint aExtraHint);
|
||||||
|
|
||||||
// See PostRestyleEventCommon below.
|
// See PostRestyleEventCommon below.
|
||||||
void PostRestyleEvent(Element* aElement,
|
void PostRestyleEvent(Element* aElement,
|
||||||
nsRestyleHint aRestyleHint,
|
nsRestyleHint aRestyleHint,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче