Bug 1044586 - fix propagating document events to the window when the inner window has changed, r=smaug

MozReview-Commit-ID: G6yPBwbITvG

--HG--
extra : rebase_source : e57e2a481d83060dcd9fbfce5b2f26c59fd7d1cf
This commit is contained in:
Gijs Kruitbosch 2016-11-30 18:33:55 +00:00
Родитель efb1ecf093
Коммит 33ea64842e
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -7620,9 +7620,12 @@ nsDocument::GetEventTargetParent(EventChainPreVisitor& aVisitor)
// Load events must not propagate to |window| object, see bug 335251.
if (aVisitor.mEvent->mMessage != eLoad) {
nsGlobalWindow* window = nsGlobalWindow::Cast(GetWindow());
aVisitor.mParentTarget =
window ? window->GetTargetForEventTargetChain() : nullptr;
nsPIDOMWindowInner* innerWindow = GetInnerWindow();
if (innerWindow && innerWindow->IsCurrentInnerWindow()) {
nsGlobalWindow* window = nsGlobalWindow::Cast(GetWindow());
aVisitor.mParentTarget =
window ? window->GetTargetForEventTargetChain() : nullptr;
}
}
return NS_OK;
}