From 17d09b7ae14cc02a8caa1a5abab26108f950b290 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Thu, 28 Sep 2017 16:45:09 -0700 Subject: [PATCH] Bug 1403694: Fix a case where a NULL stylesheet would be added to the nsStyleSheetService if nsLayoutUtils::StyloSupportedInCurrentProcess() returns false. r=xidorn MozReview-Commit-ID: COaDbr49B7B --HG-- extra : rebase_source : c4cb37f2f57444af41eccfb93d0e73895e4ae7b8 --- layout/base/nsStyleSheetService.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layout/base/nsStyleSheetService.cpp b/layout/base/nsStyleSheetService.cpp index 2c6f2c4468bf..4b8599bff62f 100644 --- a/layout/base/nsStyleSheetService.cpp +++ b/layout/base/nsStyleSheetService.cpp @@ -251,23 +251,23 @@ nsStyleSheetService::LoadAndRegisterSheetInternal(nsIURI *aSheetURI, nsresult rv; RefPtr geckoSheet; - RefPtr servoSheet; rv = LoadSheet(aSheetURI, parsingMode, StyleBackendType::Gecko, &geckoSheet); NS_ENSURE_SUCCESS(rv, rv); MOZ_ASSERT(geckoSheet); + mGeckoSheets[aSheetType].AppendElement(geckoSheet); #ifdef MOZ_STYLO if (nsLayoutUtils::StyloSupportedInCurrentProcess()) { + RefPtr servoSheet; + rv = LoadSheet(aSheetURI, parsingMode, StyleBackendType::Servo, &servoSheet); NS_ENSURE_SUCCESS(rv, rv); MOZ_ASSERT(servoSheet); + mServoSheets[aSheetType].AppendElement(servoSheet); } #endif - mGeckoSheets[aSheetType].AppendElement(geckoSheet); - mServoSheets[aSheetType].AppendElement(servoSheet); - return NS_OK; }