From 0ddec450535c12a14a7e526b36171d71621e5355 Mon Sep 17 00:00:00 2001 From: Bogdan Tara Date: Tue, 6 Oct 2020 13:45:14 +0300 Subject: [PATCH] Backed out changeset 33ba7de82d52 (bug 1657567) for browser_markup failures CLOSED TREE --- devtools/client/inspector/markup/markup.js | 7 ++----- .../client/inspector/markup/views/markup-container.js | 11 ++--------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/devtools/client/inspector/markup/markup.js b/devtools/client/inspector/markup/markup.js index 1bb7cada145a..599f8321eb2a 100644 --- a/devtools/client/inspector/markup/markup.js +++ b/devtools/client/inspector/markup/markup.js @@ -1311,16 +1311,13 @@ MarkupView.prototype = { * * @param {MarkupContainer} container * The container we're navigating to. - * @return {Boolean} - * Returns true if the MarkupContainer was navigated to and marked selected. - * Returns false if the MarkupContainer is already selected. */ navigate: function(container) { if (!container) { - return false; + return; } - return this._markContainerAsSelected(container, "treepanel"); + this._markContainerAsSelected(container, "treepanel"); }, /** diff --git a/devtools/client/inspector/markup/views/markup-container.js b/devtools/client/inspector/markup/views/markup-container.js index 383e29ee8f3a..3b32e58d4efa 100644 --- a/devtools/client/inspector/markup/views/markup-container.js +++ b/devtools/client/inspector/markup/views/markup-container.js @@ -547,17 +547,10 @@ MarkupContainer.prototype = { // target is the MarkupContainer itself. this.hovered = false; - // Flag is true if the container was marked as selected, false if already selected. - const didNavigate = this.markup.navigate(this); + this.markup.navigate(this); // Make container tabbable descendants tabbable and focus in. this.canFocus = true; - // Avoid moving focus if the container was already selected. - // This prevents shifting horizontal scroll on repeated clicks - // on the container on narrow viewports. Bug 1657567 - if (didNavigate) { - this.focus(); - } - + this.focus(); event.stopPropagation(); // Preventing the default behavior will avoid the body to gain focus on