Bug 1304302 part 2 - Some small fixes. r?heycam
MozReview-Commit-ID: 7rnl4wkMorC
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1116,17 +1116,17 @@ Loader::CreateSheet(nsIURI* aURI,
}
#endif
bool fromCompleteSheets = false;
if (!sheet) {
// Then our per-document complete sheets.
URIPrincipalReferrerPolicyAndCORSModeHashKey key(aURI, aLoaderPrincipal, aCORSMode, aReferrerPolicy);
- StyleSheetHandle completeSheet;
+ StyleSheetHandle completeSheet = nullptr;
mSheets->mCompleteSheets.Get(&key, &completeSheet);
sheet = completeSheet;
LOG((" From completed: %p", sheet->AsVoidPtr()));
fromCompleteSheets = !!sheet;
}
if (sheet) {
--- a/layout/style/ServoStyleSheet.cpp
+++ b/layout/style/ServoStyleSheet.cpp
@@ -27,17 +27,17 @@ bool
ServoStyleSheet::IsApplicable() const
{
return !mDisabled && mComplete;
}
bool
ServoStyleSheet::HasRules() const
{
- return Servo_StyleSheet_HasRules(RawSheet());
+ return mSheet && Servo_StyleSheet_HasRules(RawSheet());
}
nsIDocument*
ServoStyleSheet::GetOwningDocument() const
{
return mDocument;
}
--- a/layout/style/StyleSheetHandleInlines.h
+++ b/layout/style/StyleSheetHandleInlines.h
@@ -166,16 +166,17 @@ StyleSheetHandle::Ptr::SizeOfIncludingTh
void
StyleSheetHandle::Ptr::List(FILE* aOut, int32_t aIndex) const
{
FORWARD(List, (aOut, aIndex));
}
#endif
#undef FORWARD
+#undef FORWARD_CONCRETE
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
StyleSheetHandle& aField,
const char* aName,
uint32_t aFlags = 0)
{
if (aField && aField->IsGecko()) {