Bug 1247478: Rename FirstAdditionalAuthorSheet() to GetFirstAdditionalAuthorSheet(), since it can return null. r=heycam

This commit is contained in:
Daniel Holbert 2016-02-29 15:09:13 -08:00
parent 7eeafeb0b3
commit cfda6970cc
5 changed files with 10 additions and 9 deletions

View File

@ -4479,7 +4479,7 @@ nsDocument::RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheet
}
StyleSheetHandle
nsDocument::FirstAdditionalAuthorSheet()
nsDocument::GetFirstAdditionalAuthorSheet()
{
return mAdditionalSheets[eAuthorSheet].SafeElementAt(0, StyleSheetHandle());
}

View File

@ -827,7 +827,7 @@ public:
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;

View File

@ -1007,7 +1007,7 @@ public:
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.

View File

@ -1466,9 +1466,10 @@ PresShell::AddAuthorSheet(nsISupports* aSheet)
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 {

View File

@ -752,10 +752,10 @@ nsStyleSet::AddDocStyleSheet(CSSStyleSheet* aSheet, nsIDocument* aDocument)
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;
}
}