Bug 1376879 - Check if we have a retargeted PresShell in FocusTarget. r=kats

MozReview-Commit-ID: L2v2U0MXecv

--HG--
extra : rebase_source : 271fb2d8c31b511981d4ace880b56df7a9b79455
extra : histedit_source : 37be2c45de26bf84124615900638f6803e11c553
This commit is contained in:
Ryan Hunt 2017-06-28 14:03:34 -04:00
parent 09b27eb5ff
commit 83d3e638ed

View File

@ -84,6 +84,11 @@ FocusTarget::FocusTarget(nsIPresShell* aRootPresShell,
// Key events can be retargeted to a child PresShell when there is an iframe
nsCOMPtr<nsIPresShell> presShell = GetRetargetEventPresShell(aRootPresShell);
if (!presShell) {
mType = FocusTarget::eNone;
return;
}
// Get the content that should be scrolled for this PresShell, which is
// the current focused element or the current DOM selection
nsCOMPtr<nsIContent> scrollTarget = presShell->GetContentForScrolling();