Bug 1656107 - remove FindContentForSubDocument use from EventStateManager. r=farre

Differential Revision: https://phabricator.services.mozilla.com/D98617
This commit is contained in:
Steven MacLeod 2020-12-16 01:06:39 +00:00
Родитель 063c946ad1
Коммит 1c72bc8ce8
1 изменённых файлов: 9 добавлений и 6 удалений

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

@ -4501,8 +4501,9 @@ void EventStateManager::NotifyMouseOver(WidgetMouseEvent* aMouseEvent,
// content associated with our subdocument. // content associated with our subdocument.
EnsureDocument(mPresContext); EnsureDocument(mPresContext);
if (Document* parentDoc = mDocument->GetInProcessParentDocument()) { if (Document* parentDoc = mDocument->GetInProcessParentDocument()) {
if (nsCOMPtr<nsIContent> docContent = if (RefPtr<BrowsingContext> bc = mDocument->GetBrowsingContext()) {
parentDoc->FindContentForSubDocument(mDocument)) { if (!bc->IsCached()) {
if (nsCOMPtr<nsIContent> docContent = bc->GetEmbedderElement()) {
if (PresShell* parentPresShell = parentDoc->GetPresShell()) { if (PresShell* parentPresShell = parentDoc->GetPresShell()) {
RefPtr<EventStateManager> parentESM = RefPtr<EventStateManager> parentESM =
parentPresShell->GetPresContext()->EventStateManager(); parentPresShell->GetPresContext()->EventStateManager();
@ -4510,6 +4511,8 @@ void EventStateManager::NotifyMouseOver(WidgetMouseEvent* aMouseEvent,
} }
} }
} }
}
}
// Firing the DOM event in the parent document could cause all kinds // Firing the DOM event in the parent document could cause all kinds
// of havoc. Reverify and take care. // of havoc. Reverify and take care.
if (wrapper->mLastOverElement == aContent) return; if (wrapper->mLastOverElement == aContent) return;