Bug 1700251 - Factor out a HitTestResult::CopyWithoutScrollbarNode() helper. r=tnikkel

Depends on D109458

Differential Revision: https://phabricator.services.mozilla.com/D109459
This commit is contained in:
Botond Ballo 2021-03-25 03:41:00 +00:00
parent 16fade4fa5
commit 8afb24e3fb
2 changed files with 15 additions and 4 deletions

View File

@ -1942,10 +1942,7 @@ void APZCTreeManager::ProcessTouchInput(InputHandlingState& aState,
HitTestResult hit = GetTouchInputBlockAPZC(aInput, &touchBehaviors);
// Repopulate mTouchBlockHitResult with the fields we care about.
mTouchBlockHitResult = HitTestResult();
mTouchBlockHitResult.mTargetApzc = hit.mTargetApzc;
mTouchBlockHitResult.mHitResult = hit.mHitResult;
mTouchBlockHitResult.mFixedPosSides = hit.mFixedPosSides;
mTouchBlockHitResult = hit.CopyWithoutScrollbarNode();
if (hit.mLayersId.IsValid()) {
// Check for validity because we won't get a layers id for multi-touch
// events.
@ -2496,6 +2493,16 @@ void APZCTreeManager::ClearTree() {
}));
}
APZCTreeManager::HitTestResult
APZCTreeManager::HitTestResult::CopyWithoutScrollbarNode() const {
HitTestResult result;
result.mTargetApzc = mTargetApzc;
result.mHitResult = mHitResult;
result.mLayersId = mLayersId;
result.mFixedPosSides = mFixedPosSides;
return result;
}
RefPtr<HitTestingTreeNode> APZCTreeManager::GetRootNode() const {
RecursiveMutexAutoLock lock(mTreeLock);
return mRootNode;

View File

@ -565,6 +565,10 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
// Make it move-only.
HitTestResult(HitTestResult&&) = default;
HitTestResult& operator=(HitTestResult&&) = default;
// Make a copy of all the fields except mScrollbarNode (the field
// that makes this move-only).
HitTestResult CopyWithoutScrollbarNode() const;
};
/* Some helper functions to find an APZC given some identifying input. These