mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1037191 - Have APZCTreeManager::GetTargetAPZC(point) always return nullptr if an overscrolled APZC is matched. r=kats
--HG-- extra : rebase_source : 2714fa4480ccab42acde9a6dfa36f1d4424bb630
This commit is contained in:
parent
3ffe1a37c3
commit
dba111cd34
@ -960,12 +960,18 @@ APZCTreeManager::GetTargetAPZC(const ScreenPoint& aPoint, bool* aOutInOverscroll
|
|||||||
nsRefPtr<AsyncPanZoomController> target;
|
nsRefPtr<AsyncPanZoomController> target;
|
||||||
// The root may have siblings, so check those too
|
// The root may have siblings, so check those too
|
||||||
gfxPoint point(aPoint.x, aPoint.y);
|
gfxPoint point(aPoint.x, aPoint.y);
|
||||||
|
bool inOverscrolledApzc = false;
|
||||||
for (AsyncPanZoomController* apzc = mRootApzc; apzc; apzc = apzc->GetPrevSibling()) {
|
for (AsyncPanZoomController* apzc = mRootApzc; apzc; apzc = apzc->GetPrevSibling()) {
|
||||||
target = GetAPZCAtPoint(apzc, point, aOutInOverscrolledApzc);
|
target = GetAPZCAtPoint(apzc, point, &inOverscrolledApzc);
|
||||||
if (target) {
|
if (target) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If we are in an overscrolled APZC, we should be returning nullptr.
|
||||||
|
MOZ_ASSERT(!(target && inOverscrolledApzc));
|
||||||
|
if (aOutInOverscrolledApzc) {
|
||||||
|
*aOutInOverscrolledApzc = inOverscrolledApzc;
|
||||||
|
}
|
||||||
return target.forget();
|
return target.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1139,6 +1145,10 @@ APZCTreeManager::GetAPZCAtPoint(AsyncPanZoomController* aApzc,
|
|||||||
if (hitTestPointForChildLayers.HasPositiveWCoord()) {
|
if (hitTestPointForChildLayers.HasPositiveWCoord()) {
|
||||||
for (AsyncPanZoomController* child = aApzc->GetLastChild(); child; child = child->GetPrevSibling()) {
|
for (AsyncPanZoomController* child = aApzc->GetLastChild(); child; child = child->GetPrevSibling()) {
|
||||||
AsyncPanZoomController* match = GetAPZCAtPoint(child, hitTestPointForChildLayers.As2DPoint(), aOutInOverscrolledApzc);
|
AsyncPanZoomController* match = GetAPZCAtPoint(child, hitTestPointForChildLayers.As2DPoint(), aOutInOverscrolledApzc);
|
||||||
|
if (*aOutInOverscrolledApzc) {
|
||||||
|
// We matched an overscrolled APZC, abort.
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
if (match) {
|
if (match) {
|
||||||
result = match;
|
result = match;
|
||||||
break;
|
break;
|
||||||
@ -1156,9 +1166,7 @@ APZCTreeManager::GetAPZCAtPoint(AsyncPanZoomController* aApzc,
|
|||||||
// the result is inside an overscrolled APZC, inform our caller of this
|
// the result is inside an overscrolled APZC, inform our caller of this
|
||||||
// (callers typically ignore events targeted at overscrolled APZCs).
|
// (callers typically ignore events targeted at overscrolled APZCs).
|
||||||
if (result && aApzc->IsOverscrolled()) {
|
if (result && aApzc->IsOverscrolled()) {
|
||||||
if (aOutInOverscrolledApzc) {
|
*aOutInOverscrolledApzc = true;
|
||||||
*aOutInOverscrolledApzc = true;
|
|
||||||
}
|
|
||||||
result = nullptr;
|
result = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user