Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6d620636ad5a8112e83589d1959778da52c72b5b
      
https://github.com/WebKit/WebKit/commit/6d620636ad5a8112e83589d1959778da52c72b5b
  Author: Razvan Caliman <rcali...@apple.com>
  Date:   2025-08-18 (Mon, 18 Aug 2025)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css
    M Source/WebInspectorUI/UserInterface/Views/FormattedValue.css
    M Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css

  Log Message:
  -----------
  Web Inspector: Can't select array element clipped by the console
https://bugs.webkit.org/show_bug.cgi?id=296325
rdar://157015598

Reviewed by Devin Rousso.

There is custom hit testing logic in 
`WI.TreeOutline.prototype.treeElementFromEvent()`
so that you can expand a node by cliking on the sides of the actual DOM element 
representing the tree element.

This breaks when the content of the tree element is clipped because the 
measurements used for
hit testing compute to a target outside the bounds of the tree element itself.

It occurs from the combination of:
- `white-space: nowrap` on `.tree-outline.object li` (from ObjectTreeView.css)
- `display: inline-block` on `.formatted-node` (from FormattedValue.css)

In this situation, the tree element's `offsetWidth` is larger
than the bounds of the container that clips the element.

Switching from `display: inline-block` to `display: block` is a viable fix,
but has side-effects for the layout of other types of formatted values.

This patch allows DOM tree outline elements descendant of a `.formatted-node`
to wrap so that they're never clipped. This ensures that they are:
- correctly identified on click
- fully visible to provide complete context

* Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css:

* Source/WebInspectorUI/UserInterface/Views/FormattedValue.css:
(.formatted-node > .tree-outline.dom li):

* Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css:
(.tree-outline.object ol):
(.tree-outline.object:not(:has(.tree-outline.dom)) ol):

Drive-by fix for horizontal shifting on hover of a DOM tree outline nested in a 
generic
tree outline because its `padding-inline-start` is overridden by a 
same-specificity rule.

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



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

Reply via email to