Closed Bug 1207637 Opened 10 years ago Closed 1 year ago

Inspector's scroll into view feature doesn't check node types on the server

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(firefox139 fixed)

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: pbro, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

(Whiteboard: [good next bug][lang=js][btpp-fix-later])

Attachments

(1 file)

In the markup-view, you can right-click any node and choose the scroll-into-view item to move that node into view. For now, this feature is checking for node types on the client-side, like if a node is a Text node, the item isn't available. But no checks are done on the server. In bug 1203147, we added a keyboard shortcut to the inspector where, if you press S when a node is selected, that node gets moved into view, but the client-side checking mechanism wasn't used for that. So, STR: - open the inspector - select a TEXT node - press S ==> The following exception appears in the logs: console.error: Message: TypeError: this.rawNode.scrollIntoView is not a function Stack: exports.NodeActor<.scrollIntoView<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:649:5 actorProto/</handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1013:19 DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:1596:15 ChildDebuggerTransport.prototype.receiveMessage@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/shared/transport/transport.js:742:5 I think the server-side implementation of scrollIntoView should check if the method exist, and we should also be re-using the client-side check when S is pressed.
Whiteboard: [good next bug][lang=js]
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P2
Whiteboard: [good next bug][lang=js] → [good next bug][lang=js][btpp-fix-later]
Product: Firefox → DevTools
Severity: normal → S3

The RDP method can be called for a Node actor whose underlying node
doesn't have the scrollIntoViewMethod (e.g. a Text or a Comment).
Use the same method between the context menu entry and the keyboard shortcut
to bail out when scrollIntoView isn't supported by the selected node.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b7e37d0c7114 [devtools] Add guard in NodeActor#scrollIntoView. r=devtools-reviewers,jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
QA Whiteboard: [qa-triage-done-c140/b139]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: