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
Родитель fb80a6703c
Коммит 757b7ac1bc
2 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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