Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug

It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr
This commit is contained in:
Hiroyuki Ikezoe
2018-02-21 07:00:10 +09:00
parent ce3e2391a3
commit b1da8534e8
52 changed files with 198 additions and 416 deletions

View File

@@ -43,8 +43,7 @@ bool
HTMLSourceElement::MatchesCurrentMedia()
{
if (mMediaList) {
nsIPresShell* presShell = OwnerDoc()->GetShell();
nsPresContext* pctx = presShell ? presShell->GetPresContext() : nullptr;
nsPresContext* pctx = OwnerDoc()->GetPresContext();
return pctx && mMediaList->Matches(pctx);
}
@@ -60,8 +59,7 @@ HTMLSourceElement::WouldMatchMediaForDocument(const nsAString& aMedia,
return true;
}
nsIPresShell* presShell = aDocument->GetShell();
nsPresContext* pctx = presShell ? presShell->GetPresContext() : nullptr;
nsPresContext* pctx = aDocument->GetPresContext();
RefPtr<MediaList> mediaList =
MediaList::Create(aDocument->GetStyleBackendType(), aMedia);