Bug 1355374 - Remove the no-longer-used LayerMetricsWrapper::GetScrollThumbLength() and HitTestingTreeNode::mScrollThumbLength. r=kats
MozReview-Commit-ID: ICm2Q1hnKD6
--- a/gfx/layers/LayerMetricsWrapper.h
+++ b/gfx/layers/LayerMetricsWrapper.h
@@ -406,25 +406,16 @@ public:
FrameMetrics::ViewID GetScrollbarTargetContainerId() const
{
MOZ_ASSERT(IsValid());
return mLayer->GetScrollbarTargetContainerId();
}
- int32_t GetScrollThumbLength() const
- {
- if (GetScrollbarDirection() == ScrollDirection::VERTICAL) {
- return mLayer->GetVisibleRegion().GetBounds().height;
- } else {
- return mLayer->GetVisibleRegion().GetBounds().width;
- }
- }
-
bool IsScrollbarContainer() const
{
MOZ_ASSERT(IsValid());
return mLayer->IsScrollbarContainer();
}
FrameMetrics::ViewID GetFixedPositionScrollContainerId() const
{
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -490,17 +490,16 @@ APZCTreeManager::PrepareNodeForLayer(con
AttachNodeToTree(node, aParent, aNextSibling);
node->SetHitTestData(
GetEventRegions(aLayer),
aLayer.GetTransformTyped(),
aLayer.GetClipRect() ? Some(ParentLayerIntRegion(*aLayer.GetClipRect())) : Nothing(),
GetEventRegionsOverride(aParent, aLayer));
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
- aLayer.GetScrollThumbLength(),
aLayer.IsScrollbarContainer());
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
return node;
}
AsyncPanZoomController* apzc = nullptr;
// If we get here, aLayer is a scrollable layer and somebody
// has registered a GeckoContentController for it, so we need to ensure
@@ -680,17 +679,16 @@ APZCTreeManager::PrepareNodeForLayer(con
GetEventRegionsOverride(aParent, aLayer));
}
// Note: if layer properties must be propagated to nodes, RecvUpdate in
// LayerTransactionParent.cpp must ensure that APZ will be notified
// when those properties change.
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
- aLayer.GetScrollThumbLength(),
aLayer.IsScrollbarContainer());
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
return node;
}
template<typename PanGestureOrScrollWheelInput>
static bool
WillHandleInput(const PanGestureOrScrollWheelInput& aPanInput)
--- a/gfx/layers/apz/src/HitTestingTreeNode.cpp
+++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp
@@ -23,17 +23,16 @@ namespace layers {
HitTestingTreeNode::HitTestingTreeNode(AsyncPanZoomController* aApzc,
bool aIsPrimaryHolder,
uint64_t aLayersId)
: mApzc(aApzc)
, mIsPrimaryApzcHolder(aIsPrimaryHolder)
, mLayersId(aLayersId)
, mScrollViewId(FrameMetrics::NULL_SCROLL_ID)
, mScrollDir(ScrollDirection::NONE)
- , mScrollThumbLength(0)
, mIsScrollbarContainer(false)
, mFixedPosTarget(FrameMetrics::NULL_SCROLL_ID)
, mOverride(EventRegionsOverride::NoOverride)
{
if (mIsPrimaryApzcHolder) {
MOZ_ASSERT(mApzc);
}
MOZ_ASSERT(!mApzc || mApzc->GetLayersId() == mLayersId);
@@ -92,41 +91,33 @@ HitTestingTreeNode::SetLastChild(HitTest
aChild->SetApzcParent(parent);
}
}
}
void
HitTestingTreeNode::SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
ScrollDirection aDir,
- int32_t aScrollThumbLength,
bool aIsScrollContainer)
{
mScrollViewId = aScrollViewId;
mScrollDir = aDir;
- mScrollThumbLength = aScrollThumbLength;
mIsScrollbarContainer = aIsScrollContainer;
}
bool
HitTestingTreeNode::MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetrics) const
{
return ((mScrollDir == ScrollDirection::HORIZONTAL &&
aDragMetrics.mDirection == AsyncDragMetrics::HORIZONTAL) ||
(mScrollDir == ScrollDirection::VERTICAL &&
aDragMetrics.mDirection == AsyncDragMetrics::VERTICAL)) &&
mScrollViewId == aDragMetrics.mViewId;
}
-LayerIntCoord
-HitTestingTreeNode::GetScrollThumbLength() const
-{
- return mScrollThumbLength;
-}
-
bool
HitTestingTreeNode::IsScrollbarNode() const
{
return mIsScrollbarContainer || (mScrollDir != ScrollDirection::NONE);
}
FrameMetrics::ViewID
HitTestingTreeNode::GetScrollTargetId() const
--- a/gfx/layers/apz/src/HitTestingTreeNode.h
+++ b/gfx/layers/apz/src/HitTestingTreeNode.h
@@ -88,17 +88,16 @@ public:
const Maybe<ParentLayerIntRegion>& aClipRegion,
const EventRegionsOverride& aOverride);
bool IsOutsideClip(const ParentLayerPoint& aPoint) const;
/* Scrollbar info */
void SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
ScrollDirection aDir,
- int32_t aScrollThumbLength,
bool aIsScrollContainer);
bool MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetrics) const;
LayerIntCoord GetScrollThumbLength() const;
bool IsScrollbarNode() const;
FrameMetrics::ViewID GetScrollTargetId() const;
/* Fixed pos info */
@@ -130,17 +129,16 @@ private:
uint64_t mLayersId;
// This is set for both scroll track and scroll thumb Container layers, and
// represents the scroll id of the scroll frame scrolled by the scrollbar.
FrameMetrics::ViewID mScrollViewId;
// This is set for scroll thumb Container layers only.
ScrollDirection mScrollDir;
- int32_t mScrollThumbLength;
// This is set for scroll track Container layers only.
bool mIsScrollbarContainer;
FrameMetrics::ViewID mFixedPosTarget;
/* Let {L,M} be the {layer, scrollable metrics} pair that this node
* corresponds to in the layer tree. mEventRegions contains the event regions