Bug 1247478: Rename FirstAdditionalAuthorSheet() to GetFirstAdditionalAuthorSheet(), since it can return null. r=heycam
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 29 Feb 2016 15:09:13 -0800
changeset 322515 be17cdb8e8e0b36e8433d9d14611f68444a337ab
parent 322514 c8e1ff0ab5a4cc172155cefbdd47a7b8fea66b64
child 322516 25b27835c872681a8e97ba1ba27fd5e0acd398d8
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1247478
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1247478: Rename FirstAdditionalAuthorSheet() to GetFirstAdditionalAuthorSheet(), since it can return null. r=heycam
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/base/nsIDocument.h
layout/base/nsPresShell.cpp
layout/style/nsStyleSet.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -4474,17 +4474,17 @@ nsDocument::RemoveAdditionalStyleSheet(a
     NotifyStyleSheetRemoved(sheetRef, false);
     EndUpdate(UPDATE_STYLE);
 
     sheetRef->SetOwningDocument(nullptr);
   }
 }
 
 StyleSheetHandle
-nsDocument::FirstAdditionalAuthorSheet()
+nsDocument::GetFirstAdditionalAuthorSheet()
 {
   return mAdditionalSheets[eAuthorSheet].SafeElementAt(0, StyleSheetHandle());
 }
 
 nsIGlobalObject*
 nsDocument::GetScopeObject() const
 {
   nsCOMPtr<nsIGlobalObject> scope(do_QueryReferent(mScopeObject));
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -822,17 +822,17 @@ public:
                                             bool aApplicable) override;
 
   virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType,
                                             nsIURI* aSheetURI) override;
   virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType,
                                            mozilla::StyleSheetHandle aSheet) override;
   virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
                                           nsIURI* sheetURI) override;
-  virtual mozilla::StyleSheetHandle FirstAdditionalAuthorSheet() override;
+  virtual mozilla::StyleSheetHandle GetFirstAdditionalAuthorSheet() override;
 
   virtual nsIChannel* GetChannel() const override {
     return mChannel;
   }
 
   virtual nsIChannel* GetFailedChannel() const override {
     return mFailedChannel;
   }
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -1002,17 +1002,17 @@ public:
   };
 
   virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType,
                                             nsIURI* aSheetURI) = 0;
   virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType,
                                            mozilla::StyleSheetHandle aSheet) = 0;
   virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
                                           nsIURI* sheetURI) = 0;
-  virtual mozilla::StyleSheetHandle FirstAdditionalAuthorSheet() = 0;
+  virtual mozilla::StyleSheetHandle GetFirstAdditionalAuthorSheet() = 0;
 
   /**
    * Get this document's CSSLoader.  This is guaranteed to not return null.
    */
   mozilla::css::Loader* CSSLoader() const {
     return mCSSLoader;
   }
 
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -1461,19 +1461,20 @@ PresShell::AddAuthorSheet(nsISupports* a
 {
   // XXXheycam This needs to work with ServoStyleSheets too.
   RefPtr<CSSStyleSheet> sheet = do_QueryObject(aSheet);
   if (!sheet) {
     NS_ERROR("stylo: AddAuthorSheet needs to support ServoStyleSheets");
     return;
   }
 
-  // Document specific "additional" Author sheets should be stronger than the ones
-  // added with the StyleSheetService.
-  StyleSheetHandle firstAuthorSheet = mDocument->FirstAdditionalAuthorSheet();
+  // Document specific "additional" Author sheets should be stronger than the
+  // ones added with the StyleSheetService.
+  StyleSheetHandle firstAuthorSheet =
+    mDocument->GetFirstAdditionalAuthorSheet();
   if (firstAuthorSheet) {
     mStyleSet->InsertStyleSheetBefore(SheetType::Doc, sheet, firstAuthorSheet);
   } else {
     mStyleSet->AppendStyleSheet(SheetType::Doc, sheet);
   }
 
   ReconstructStyleData();
 }
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -747,20 +747,20 @@ nsStyleSet::AddDocStyleSheet(CSSStyleShe
     if (sheetDocIndex < 0) {
       if (sheetService) {
         auto& authorSheets = *sheetService->AuthorStyleSheets();
         StyleSheetHandle handle = sheet;
         if (authorSheets.IndexOf(handle) != authorSheets.NoIndex) {
           break;
         }
       }
-      MOZ_ASSERT(!aDocument->FirstAdditionalAuthorSheet() ||
-                 aDocument->FirstAdditionalAuthorSheet()->IsGecko(),
+      MOZ_ASSERT(!aDocument->GetFirstAdditionalAuthorSheet() ||
+                 aDocument->GetFirstAdditionalAuthorSheet()->IsGecko(),
                  "why do we have a ServoStyleSheet for an nsStyleSet?");
-      if (sheet == aDocument->FirstAdditionalAuthorSheet()->GetAsGecko()) {
+      if (sheet == aDocument->GetFirstAdditionalAuthorSheet()->GetAsGecko()) {
         break;
       }
     }
   }
 
   sheets.InsertElementAt(index, aSheet);
 
   if (!present) {