Bug 709256 part 1. Fast-path RestyleTracker::ProcessRestyles when there aren't any restyles to process. r=roc

This commit is contained in:
Boris Zbarsky 2011-12-14 23:42:14 -05:00
parent 33c5ecc6a8
commit 42b713ed34
2 changed files with 13 additions and 2 deletions

View File

@ -166,7 +166,7 @@ RestyleTracker::ProcessOneRestyle(Element* aElement,
}
void
RestyleTracker::ProcessRestyles()
RestyleTracker::DoProcessRestyles()
{
SAMPLE_LABEL("CSS", "ProcessRestyles");
// Make sure to not rebuild quote or counter lists while we're

View File

@ -94,7 +94,13 @@ public:
/**
* Process the restyles we've been tracking.
*/
void ProcessRestyles();
void ProcessRestyles() {
// Fast-path the common case (esp. for the animation restyle
// tracker) of not having anything to do.
if (mPendingRestyles.Count()) {
DoProcessRestyles();
}
}
// Return our ELEMENT_HAS_PENDING_(ANIMATION_)RESTYLE bit
PRUint32 RestyleBit() const {
@ -143,6 +149,11 @@ private:
nsRestyleHint aRestyleHint,
nsChangeHint aChangeHint);
/**
* The guts of our restyle processing.
*/
void DoProcessRestyles();
typedef nsDataHashtable<nsISupportsHashKey, RestyleData> PendingRestyleTable;
typedef nsAutoTArray< nsRefPtr<Element>, 32> RestyleRootArray;
// Our restyle bits. These will be a subset of ELEMENT_ALL_RESTYLE_FLAGS, and