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

@@ -70,12 +70,11 @@ HTMLMenuElement::SendShowEvent()
event.mFlags.mBubbles = false;
event.mFlags.mCancelable = false;
nsCOMPtr<nsIPresShell> shell = document->GetShell();
if (!shell) {
RefPtr<nsPresContext> presContext = document->GetPresContext();
if (!presContext) {
return;
}
RefPtr<nsPresContext> presContext = shell->GetPresContext();
nsEventStatus status = nsEventStatus_eIgnore;
EventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
&event, nullptr, &status);