зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1250788 - Part 6: Create ServoStyleSheets for the pref style sheet. r=bholley
This commit is contained in:
Родитель
4a6f4650a2
Коммит
b8519d7944
|
@ -10,9 +10,11 @@
|
|||
#include "mozilla/CSSStyleSheet.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/ServoStyleSheet.h"
|
||||
#include "mozilla/StyleSheetHandle.h"
|
||||
#include "mozilla/StyleSheetHandleInlines.h"
|
||||
#include "mozilla/css/Loader.h"
|
||||
#include "mozilla/dom/SRIMetadata.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
@ -834,11 +836,13 @@ void
|
|||
nsLayoutStylesheetCache::BuildPreferenceSheet(StyleSheetHandle::RefPtr& aSheet,
|
||||
nsPresContext* aPresContext)
|
||||
{
|
||||
if (mBackendType == StyleBackendType::Servo) {
|
||||
MOZ_CRASH("not implemented");
|
||||
if (mBackendType == StyleBackendType::Gecko) {
|
||||
aSheet = new CSSStyleSheet(CORS_NONE, mozilla::net::RP_Default);
|
||||
} else {
|
||||
aSheet = new ServoStyleSheet(CORS_NONE, mozilla::net::RP_Default,
|
||||
dom::SRIMetadata());
|
||||
}
|
||||
|
||||
aSheet = new CSSStyleSheet(CORS_NONE, mozilla::net::RP_Default);
|
||||
aSheet->SetParsingMode(eAgentSheetFeatures);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
|
@ -933,7 +937,12 @@ nsLayoutStylesheetCache::BuildPreferenceSheet(StyleSheetHandle::RefPtr& aSheet,
|
|||
"kPreallocSize should be big enough to build preference style "
|
||||
"sheet without reallocation");
|
||||
|
||||
if (aSheet->IsGecko()) {
|
||||
aSheet->AsGecko()->ReparseSheet(sheetText);
|
||||
} else {
|
||||
aSheet->AsServo()->ParseSheet(sheetText, uri, uri, nullptr, 0,
|
||||
SheetParsingMode::eAuthorSheetFeatures);
|
||||
}
|
||||
|
||||
#undef NS_GET_R_G_B
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче