Skip to content

Commit

Permalink
Bug 1258851 - Update HitTestingTreeNode::IsScrollbarNode to include t…
Browse files Browse the repository at this point in the history
…he scrollbar track layers. r=rbarker

MozReview-Commit-ID: CmyeeEPPYAq

--HG--
extra : rebase_source : f6b01531e45881409b6c4796a8b5ecff135217d4
  • Loading branch information
staktrace committed Apr 14, 2016
1 parent 987d948 commit 0b2d4ef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 6 additions & 0 deletions gfx/layers/LayerMetricsWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ class MOZ_STACK_CLASS LayerMetricsWrapper {
}
}

bool IsScrollbarContainer() const
{
MOZ_ASSERT(IsValid());
return mLayer->IsScrollbarContainer();
}

// Expose an opaque pointer to the layer. Mostly used for printf
// purposes. This is not intended to be a general-purpose accessor
// for the underlying layer.
Expand Down
6 changes: 4 additions & 2 deletions gfx/layers/apz/src/APZCTreeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
GetEventRegionsOverride(aParent, aLayer));
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
aLayer.GetScrollbarSize());
aLayer.GetScrollbarSize(),
aLayer.IsScrollbarContainer());
return node;
}

Expand Down Expand Up @@ -546,7 +547,8 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,

node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
aLayer.GetScrollbarSize());
aLayer.GetScrollbarSize(),
aLayer.IsScrollbarContainer());
return node;
}

Expand Down
9 changes: 7 additions & 2 deletions gfx/layers/apz/src/HitTestingTreeNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ HitTestingTreeNode::HitTestingTreeNode(AsyncPanZoomController* aApzc,
, mScrollViewId(FrameMetrics::NULL_SCROLL_ID)
, mScrollDir(Layer::NONE)
, mScrollSize(0)
, mIsScrollbarContainer(false)
, mOverride(EventRegionsOverride::NoOverride)
{
if (mIsPrimaryApzcHolder) {
Expand Down Expand Up @@ -92,11 +93,15 @@ HitTestingTreeNode::SetLastChild(HitTestingTreeNode* aChild)
}

void
HitTestingTreeNode::SetScrollbarData(FrameMetrics::ViewID aScrollViewId, Layer::ScrollDirection aDir, int32_t aScrollSize)
HitTestingTreeNode::SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
Layer::ScrollDirection aDir,
int32_t aScrollSize,
bool aIsScrollContainer)
{
mScrollViewId = aScrollViewId;
mScrollDir = aDir;
mScrollSize = aScrollSize;;
mIsScrollbarContainer = aIsScrollContainer;
}

bool
Expand All @@ -118,7 +123,7 @@ HitTestingTreeNode::GetScrollSize() const
bool
HitTestingTreeNode::IsScrollbarNode() const
{
return (mScrollDir != Layer::NONE);
return mIsScrollbarContainer;
}

void
Expand Down
6 changes: 5 additions & 1 deletion gfx/layers/apz/src/HitTestingTreeNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ class HitTestingTreeNode {

/* Scrollbar info */

void SetScrollbarData(FrameMetrics::ViewID aScrollViewId, Layer::ScrollDirection aDir, int32_t aScrollSize);
void SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
Layer::ScrollDirection aDir,
int32_t aScrollSize,
bool aIsScrollContainer);
bool MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetrics) const;
int32_t GetScrollSize() const;
bool IsScrollbarNode() const;
Expand Down Expand Up @@ -124,6 +127,7 @@ class HitTestingTreeNode {
FrameMetrics::ViewID mScrollViewId;
Layer::ScrollDirection mScrollDir;
int32_t mScrollSize;
bool mIsScrollbarContainer;

/* Let {L,M} be the {layer, scrollable metrics} pair that this node
* corresponds to in the layer tree. mEventRegions contains the event regions
Expand Down

0 comments on commit 0b2d4ef

Please sign in to comment.