Bug 1163259. Make sure we don't look at the parent ref layer when looking for a layer with the frame metrics for a scrollbar. r=kats

The ref layer comes from the parent process, and hence a different scrollid space. If the scrollid on it's metrics happen to match a scrollbar from the child process we have a problem.
This commit is contained in:
Timothy Nikkel 2015-05-12 00:13:04 -05:00
parent 0080559c75
commit 943736bd0c

View File

@ -881,14 +881,15 @@ FindScrolledLayerForScrollbar(Layer* aScrollbar, bool* aOutIsAncestor)
{
// First check if the scrolled layer is an ancestor of the scrollbar layer.
LayerMetricsWrapper root(aScrollbar->Manager()->GetRoot());
LayerMetricsWrapper scrollbar(aScrollbar);
LayerMetricsWrapper prevAncestor(aScrollbar);
for (LayerMetricsWrapper ancestor(aScrollbar); ancestor; ancestor = ancestor.GetParent()) {
// Don't walk into remote layer trees; the scrollbar will always be in
// the same layer space.
if (ancestor.AsRefLayer()) {
root = ancestor;
root = prevAncestor;
break;
}
prevAncestor = ancestor;
if (LayerIsScrollbarTarget(ancestor, aScrollbar)) {
*aOutIsAncestor = true;