mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1234773 - Followup assertion.
This commit is contained in:
parent
399f165259
commit
180c72432f
@ -817,8 +817,10 @@ nsLayoutStylesheetCache::BuildPreferenceSheet(RefPtr<CSSStyleSheet>& aSheet,
|
||||
aSheet->SetURIs(uri, uri, uri);
|
||||
aSheet->SetComplete();
|
||||
|
||||
static const uint32_t kPreallocSize = 1024;
|
||||
|
||||
nsString sheetText;
|
||||
sheetText.SetCapacity(1024);
|
||||
sheetText.SetCapacity(kPreallocSize);
|
||||
|
||||
#define NS_GET_R_G_B(color_) \
|
||||
NS_GET_R(color_), NS_GET_G(color_), NS_GET_B(color_)
|
||||
@ -896,6 +898,10 @@ nsLayoutStylesheetCache::BuildPreferenceSheet(RefPtr<CSSStyleSheet>& aSheet,
|
||||
NS_GET_R_G_B(focusBG));
|
||||
}
|
||||
|
||||
NS_ASSERTION(sheetText.Length() <= kPreallocSize,
|
||||
"kPreallocSize should be big enough to build preference style "
|
||||
"sheet without reallocation");
|
||||
|
||||
aSheet->ReparseSheet(sheetText);
|
||||
|
||||
#undef NS_GET_R_G_B
|
||||
|
Loading…
Reference in New Issue
Block a user