Bug 1233056 - Long tapping on a link will select a different link from the page r=tnikkel

Long tapping would fail when Java Pan-Zoom was enabled in Fennec.
This commit is contained in:
Randall Barker 2016-01-04 12:43:05 -08:00
Родитель cddea9ec89
Коммит 3a71488eda
4 изменённых файлов: 20 добавлений и 5 удалений

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

@ -7659,7 +7659,7 @@ nsContentUtils::ToWidgetPoint(const CSSPoint& aPoint,
{
return LayoutDeviceIntPoint::FromAppUnitsRounded(
(CSSPoint::ToAppUnits(aPoint) +
aOffset).ApplyResolution(aPresContext->PresShell()->GetCumulativeNonRootScaleResolution()),
aOffset).ApplyResolution(nsLayoutUtils::GetCurrentAPZResolutionScale(aPresContext->PresShell())),
aPresContext->AppUnitsPerDevPixel());
}

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

@ -933,7 +933,7 @@ Event::GetScreenCoords(nsPresContext* aPresContext,
LayoutDevicePixel::ToAppUnits(aPoint, aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom());
if (aPresContext->PresShell()) {
pt = pt.RemoveResolution(aPresContext->PresShell()->GetCumulativeNonRootScaleResolution());
pt = pt.RemoveResolution(nsLayoutUtils::GetCurrentAPZResolutionScale(aPresContext->PresShell()));
}
pt += LayoutDevicePixel::ToAppUnits(guiEvent->widget->WidgetToScreenOffset(),

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

@ -809,6 +809,15 @@ nsLayoutUtils::AsyncPanZoomEnabled(nsIFrame* aFrame)
return widget->AsyncPanZoomEnabled();
}
float
nsLayoutUtils::GetCurrentAPZResolutionScale(nsIPresShell* aShell) {
#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
return aShell ? aShell->GetCumulativeNonRootScaleResolution() : 1.0;
#else
return 1.0f;
#endif
}
// Return the maximum displayport size, based on the LayerManager's maximum
// supported texture size. The result is in app units.
static nscoord
@ -2063,7 +2072,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsIWidget* aWidget,
nsPoint pt(presContext->DevPixelsToAppUnits(aPoint.x),
presContext->DevPixelsToAppUnits(aPoint.y));
pt = pt - view->ViewToWidgetOffset();
pt = pt.RemoveResolution(presContext->PresShell()->GetCumulativeNonRootScaleResolution());
pt = pt.RemoveResolution(GetCurrentAPZResolutionScale(presContext->PresShell()));
return pt;
}
}
@ -2102,7 +2111,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsIWidget* aWidget,
nsIPresShell* shell = aFrame->PresContext()->PresShell();
// XXX Bug 1224748 - Update nsLayoutUtils functions to correctly handle nsPresShell resolution
widgetToView = widgetToView.RemoveResolution(shell->GetCumulativeNonRootScaleResolution());
widgetToView = widgetToView.RemoveResolution(GetCurrentAPZResolutionScale(shell));
/* If we encountered a transform, we can't do simple arithmetic to figure
* out how to convert back to aFrame's coordinates and must use the CTM.
@ -2851,7 +2860,7 @@ nsLayoutUtils::TranslateViewToWidget(nsPresContext* aPresContext,
}
nsPoint pt = (aPt +
viewOffset).ApplyResolution(aPresContext->PresShell()->GetCumulativeNonRootScaleResolution());
viewOffset).ApplyResolution(GetCurrentAPZResolutionScale(aPresContext->PresShell()));
LayoutDeviceIntPoint relativeToViewWidget(aPresContext->AppUnitsToDevPixels(pt.x),
aPresContext->AppUnitsToDevPixels(pt.y));
return relativeToViewWidget + WidgetToWidgetOffset(viewWidget, aWidget);

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

@ -2660,6 +2660,12 @@ public:
*/
static bool AsyncPanZoomEnabled(nsIFrame* aFrame);
/**
* Returns the current APZ Resolution Scale. When Java Pan/Zoom is
* enabled in Fennec it will always return 1.0.
*/
static float GetCurrentAPZResolutionScale(nsIPresShell* aShell);
/**
* Log a key/value pair for APZ testing during a paint.
* @param aManager The data will be written to the APZTestData associated