зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1287576 - Extract a helper method to update a frame to the touch target document's root frame. No functional changes. r=botond
MozReview-Commit-ID: 3SRxAfTeMR
This commit is contained in:
Родитель
2ce1dbdf14
Коммит
4ba7371861
|
@ -554,6 +554,24 @@ GetRootDocumentElementFor(nsIWidget* aWidget)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static nsIFrame*
|
||||||
|
UpdateRootFrameForTouchTargetDocument(nsIFrame* aRootFrame)
|
||||||
|
{
|
||||||
|
#if defined(MOZ_ANDROID_APZ)
|
||||||
|
// Re-target so that the hit test is performed relative to the frame for the
|
||||||
|
// Root Content Document instead of the Root Document which are different in
|
||||||
|
// Android. See bug 1229752 comment 16 for an explanation of why this is necessary.
|
||||||
|
if (nsIDocument* doc = aRootFrame->PresContext()->PresShell()->GetTouchEventTargetDocument()) {
|
||||||
|
if (nsIPresShell* shell = doc->GetShell()) {
|
||||||
|
if (nsIFrame* frame = shell->GetRootFrame()) {
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return aRootFrame;
|
||||||
|
}
|
||||||
|
|
||||||
// Determine the scrollable target frame for the given point and add it to
|
// Determine the scrollable target frame for the given point and add it to
|
||||||
// the target list. If the frame doesn't have a displayport, set one.
|
// the target list. If the frame doesn't have a displayport, set one.
|
||||||
// Return whether or not a displayport was set.
|
// Return whether or not a displayport was set.
|
||||||
|
@ -564,19 +582,6 @@ PrepareForSetTargetAPZCNotification(nsIWidget* aWidget,
|
||||||
const LayoutDeviceIntPoint& aRefPoint,
|
const LayoutDeviceIntPoint& aRefPoint,
|
||||||
nsTArray<ScrollableLayerGuid>* aTargets)
|
nsTArray<ScrollableLayerGuid>* aTargets)
|
||||||
{
|
{
|
||||||
#if defined(MOZ_ANDROID_APZ)
|
|
||||||
// Re-target so that the hit test is performed relative to the frame for the
|
|
||||||
// Root Content Document instead of the Root Document which are different in
|
|
||||||
// Android. See bug 1229752 comment 16 for an explanation of why this is necessary.
|
|
||||||
if (nsIDocument* doc = aRootFrame->PresContext()->PresShell()->GetTouchEventTargetDocument()) {
|
|
||||||
if (nsIPresShell* shell = doc->GetShell()) {
|
|
||||||
if(nsIFrame* frame = shell->GetRootFrame()) {
|
|
||||||
aRootFrame = frame;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ScrollableLayerGuid guid(aGuid.mLayersId, 0, FrameMetrics::NULL_SCROLL_ID);
|
ScrollableLayerGuid guid(aGuid.mLayersId, 0, FrameMetrics::NULL_SCROLL_ID);
|
||||||
nsPoint point =
|
nsPoint point =
|
||||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(aWidget, aRefPoint, aRootFrame);
|
nsLayoutUtils::GetEventCoordinatesRelativeTo(aWidget, aRefPoint, aRootFrame);
|
||||||
|
@ -739,6 +744,8 @@ APZCCallbackHelper::SendSetTargetAPZCNotification(nsIWidget* aWidget,
|
||||||
sLastTargetAPZCNotificationInputBlock = aInputBlockId;
|
sLastTargetAPZCNotificationInputBlock = aInputBlockId;
|
||||||
if (nsIPresShell* shell = aDocument->GetShell()) {
|
if (nsIPresShell* shell = aDocument->GetShell()) {
|
||||||
if (nsIFrame* rootFrame = shell->GetRootFrame()) {
|
if (nsIFrame* rootFrame = shell->GetRootFrame()) {
|
||||||
|
rootFrame = UpdateRootFrameForTouchTargetDocument(rootFrame);
|
||||||
|
|
||||||
bool waitForRefresh = false;
|
bool waitForRefresh = false;
|
||||||
nsTArray<ScrollableLayerGuid> targets;
|
nsTArray<ScrollableLayerGuid> targets;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче