mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1349815 - Avoid setting the static cache during the servo traversal. r=heycam
MozReview-Commit-ID: E9XC4kaCVd2
This commit is contained in:
parent
ec78798123
commit
8c4e31302e
@ -13,6 +13,7 @@
|
||||
#include "nsFont.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/widget/WidgetMessageUtils.h"
|
||||
|
||||
@ -437,6 +438,8 @@ nsXPLookAndFeel::OnPrefChanged(const char* aPref, void* aClosure)
|
||||
void
|
||||
nsXPLookAndFeel::Init()
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
// Say we're already initialized, and take the chance that it might fail;
|
||||
// protects against some other process writing to our static variables.
|
||||
sInitialized = true;
|
||||
@ -825,7 +828,10 @@ nsXPLookAndFeel::GetColorImpl(ColorID aID, bool aUseStandinsForNativeColors,
|
||||
}
|
||||
}
|
||||
|
||||
CACHE_COLOR(aID, aResult);
|
||||
if (!mozilla::ServoStyleSet::IsInServoTraversal()) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
CACHE_COLOR(aID, aResult);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user