Bug 1028497 - Part 5: Implement document.fonts. r=bzbarsky

This commit is contained in:
Cameron McCormack 2014-10-02 12:32:06 +10:00
parent 1ab9074459
commit 1af7e9d722

View File

@ -12419,6 +12419,17 @@ nsAutoSyncOperation::~nsAutoSyncOperation()
FontFaceSet* FontFaceSet*
nsIDocument::GetFonts(ErrorResult& aRv) nsIDocument::GetFonts(ErrorResult& aRv)
{ {
aRv.Throw(NS_ERROR_FAILURE); nsIPresShell* shell = GetShell();
return nullptr; if (!shell) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsPresContext* presContext = shell->GetPresContext();
if (!presContext) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return presContext->Fonts();
} }