Bug 1524240 - In EventStateManager::PostHandleKeyboardEvent look up TabParent by LayersId. r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D20654

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Henri Sivonen 2019-03-07 08:14:45 +00:00
Родитель acf9d0ab88
Коммит f332c6813c
1 изменённых файлов: 15 добавлений и 0 удалений

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

@ -2870,6 +2870,21 @@ void EventStateManager::PostHandleKeyboardEvent(
RefPtr<TabParent> remote =
aTargetFrame ? TabParent::GetFrom(aTargetFrame->GetContent())
: nullptr;
if (remote && aKeyboardEvent->mLayersId.IsValid()) {
// remote is null-checked above in order to let pre-existing event
// targeting code's chrome vs. content decision override APZ if they
// disagree in order not to disrupt non-Fission e10s mode in case
// there are still bugs in the Fission-mode code. That is, if remote
// is nullptr, the pre-existing event targeting code has deemed this
// event to belong to chrome rather than content.
TabParent* preciseRemote =
TabParent::GetTabParentFromLayersId(aKeyboardEvent->mLayersId);
if (preciseRemote) {
remote = preciseRemote;
}
// else there was a race between APZ and the chrome-process LayersId
// to TabParent mapping.
}
if (remote && !remote->IsReadyToHandleInputEvents()) {
// We need to dispatch the event to the browser element again if we were
// waiting for the key reply but the event wasn't sent to the content