Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 44655d4ac52531716690a293dc8ead0393f8bb22
      
https://github.com/WebKit/WebKit/commit/44655d4ac52531716690a293dc8ead0393f8bb22
  Author: Razvan Caliman <[email protected]>
  Date:   2025-09-24 (Wed, 24 Sep 2025)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
    M Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js

  Log Message:
  -----------
  Web Inspector: Elements: Unable to navigate with keyboard past `<style>` 
element in DOM tree
https://bugs.webkit.org/show_bug.cgi?id=299445
rdar://159841729

Reviewed by Devin Rousso.

When selecting nodes in the DOM tree outline, only the suitable details sidebar 
panels are shown.
For a text node, like the contents of a `<style>` node, only the Node details 
sidebar is shown,
while Styles, Computed, Layout, Fonts, and Changes are removed.

Navigating between different nodes types triggers relayout in 
`WI.DOMTreeContentView`
as the details sidebars are added or removed.

The view resize handler in `WI.DOMTreeContentView.prototype.sizeDidChange()`
re-selects the selected node in order to scroll it back into the viewport if 
needed.
This was implemented in https://commits.webkit.org/204576@main

The DOM node is associated with both the opening and closing tags in the DOM 
tree outline.
But when re-selecting the DOM node, there's no context about which of the tags 
was previously selected.

Keyboard navigation correctly goes from the text node to the closing `<style>` 
tag.
But the action in the resize handler causes the the opening `<style>` to be 
selected. A loop is created.

There is no need to re-select the DOM node (and unnecessarily wasteful for all 
the sidebars),
It's enough to bring its corresponding DOM tree outline element back into view.

* Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.sizeDidChange):
* Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.objectForSelection):

Canonical link: https://commits.webkit.org/300471@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to