Bug 1304302 part 2 - Some small fixes. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Fri, 23 Sep 2016 16:48:29 +1000
changeset 416881 e44544f6598793025fcdeab810bc0d4a36fe837e
parent 416841 d5d55414f4722ab5acd9f7b490fd7933ddd48844
child 416882 1f2d0609f037479d81b170bf4b855ee4bc916765
push id30278
push userxquan@mozilla.com
push dateFri, 23 Sep 2016 07:08:40 +0000
reviewersheycam
bugs1304302
milestone51.0a1
Bug 1304302 part 2 - Some small fixes. r?heycam MozReview-Commit-ID: 7rnl4wkMorC
layout/style/Loader.cpp
layout/style/ServoStyleSheet.cpp
layout/style/StyleSheetHandleInlines.h
--- 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()) {