Skip to content

Commit c22a8d0

Browse files
hjanuschkaDevtools-frontend LUCI CQ
authored andcommitted
inspect({focus: false}): skip panel switch when omitFocus is set
When inspect(element, {focus: false}) is called, the V8 backend sends an omitFocus hint via Runtime.inspectRequested. Previously the frontend still switched to the Elements panel but merely avoided focusing the node within it. Per reviewer feedback, the intent of {focus: false} is to select the node in the Elements panel without switching the active panel at all. Change DOMNodeRevealer to pass {showPanel: false} when omitFocus is true, so the panel selection is updated silently for the next time the user opens the Elements panel. Bug: 433676513 Change-Id: I08cb369354cb0bdcc9ad2c0305ccefca5dc9c06b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7633666 Reviewed-by: Eric Leese <leese@chromium.org> Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Helmut Januschka <helmut@januschka.com>
1 parent 835aff5 commit c22a8d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

front_end/panels/elements/ElementsPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ export class DOMNodeRevealer implements
15561556
}
15571557

15581558
if (resolvedNode) {
1559-
const opts: RevealAndSelectNodeOpts = {showPanel: true, focusNode: !omitFocus};
1559+
const opts: RevealAndSelectNodeOpts = omitFocus ? {showPanel: false} : {showPanel: true, focusNode: true};
15601560
const promise = resolvedNode instanceof SDK.DOMModel.AdoptedStyleSheet ?
15611561
panel.revealAndSelectAdoptedStyleSheet(resolvedNode, opts) :
15621562
panel.revealAndSelectNode(resolvedNode, opts);

0 commit comments

Comments
 (0)