Bug 1130129 - Better handle a case where the APZ hit-test disagrees with the main-thread hit-test results. r=botond

This commit is contained in:
Kartikaya Gupta 2015-02-06 09:26:44 -05:00
Родитель e194e1462e
Коммит 41393c974d
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -2419,6 +2419,17 @@ TabParent::MaybeForwardEventToRenderFrame(WidgetInputEvent& aEvent,
// id.
if (aOutTargetGuid) {
*aOutTargetGuid = InputAPZContext::GetTargetLayerGuid();
// There may be cases where the APZ hit-testing code came to a different
// conclusion than the main-thread hit-testing code as to where the event
// is destined. In such cases the layersId of the APZ result may not match
// the layersId of this renderframe. In such cases the main-thread hit-
// testing code "wins" so we need to update the guid to reflect this.
if (RenderFrameParent* rfp = GetRenderFrame()) {
if (aOutTargetGuid->mLayersId != rfp->GetLayersId()) {
*aOutTargetGuid = ScrollableLayerGuid(rfp->GetLayersId(), 0, FrameMetrics::NULL_SCROLL_ID);
}
}
}
if (aOutInputBlockId) {
*aOutInputBlockId = InputAPZContext::GetInputBlockId();