Bug 1486364 - Revert changes in Tree component and test; r=jdescottes.

In https://github.com/devtools-html/debugger.html/pull/6809 a check
was removed in the Tree component because seens as unnecessary, and
a test was modified to accomodate the change. Turns out the test was
needed in its original form, and was surfacing a bug.
This patch rolls back both the change in the Tree component _and_ in
the test.
The Tree modification will be backported to the Github repository.

Differential Revision: https://phabricator.services.mozilla.com/D4307

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Chevobbe 2018-08-27 07:30:02 +00:00
Родитель d17844e0bf
Коммит 226365011f
2 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -4465,7 +4465,17 @@ class Tree extends Component {
if (focused || !nativeEvent || !this.treeRef) {
return;
}
this._focus(traversal[0].item);
const { explicitOriginalTarget } = nativeEvent;
// Only set default focus to the first tree node if the focus came
// from outside the tree (e.g. by tabbing to the tree from other
// external elements).
if (
explicitOriginalTarget !== this.treeRef &&
!this.treeRef.contains(explicitOriginalTarget)
) {
this._focus(traversal[0].item);
}
},
onBlur: this._onBlur,
"aria-label": this.props.label,

Просмотреть файл

@ -39,7 +39,8 @@ add_task(async function() {
});
info("Expand the last node");
lastNode.click();
const view = lastNode.ownerDocument.defaultView;
EventUtils.synthesizeMouseAtCenter(lastNode, {}, view);
await onOiMutation;
is(scrollTop, outputContainer.scrollTop,