Bug 1675397 - Part 1: Use RefPtr<Element> for nsFocusManager::mFirst{Blur|Focus}Event; r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D95946
This commit is contained in:
Edgar Chen 2020-11-05 09:04:38 +00:00
Родитель a87cdef8a4
Коммит 117f50f8ce
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -2118,7 +2118,9 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear,
mFocusedElement = nullptr;
return true;
}
if (element == mFirstBlurEvent) return true;
if (element == mFirstBlurEvent) {
return true;
}
}
RefPtr<BrowsingContext> focusedBrowsingContext = GetFocusedBrowsingContext();

Просмотреть файл

@ -870,8 +870,8 @@ class nsFocusManager final : public nsIFocusManager,
// these fields store a content node temporarily while it is being focused
// or blurred to ensure that a recursive call doesn't refire the same event.
// They will always be cleared afterwards.
nsCOMPtr<nsIContent> mFirstBlurEvent;
nsCOMPtr<nsIContent> mFirstFocusEvent;
RefPtr<mozilla::dom::Element> mFirstBlurEvent;
RefPtr<mozilla::dom::Element> mFirstFocusEvent;
// keep track of a window while it is being lowered
nsCOMPtr<nsPIDOMWindowOuter> mWindowBeingLowered;