-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web Inspector: “Inspect Element” doesn’t reveal element in DOM tree if the element is hidden behind the "Show All Nodes" button #8502
Web Inspector: “Inspect Element” doesn’t reveal element in DOM tree if the element is hidden behind the "Show All Nodes" button #8502
Conversation
EWS run on previous version of this PR (hash 546ffac)
|
@@ -647,6 +647,12 @@ WI.DOMTreeElement = class DOMTreeElement extends WI.TreeElement | |||
this.expandedChildrenLimit = Math.max(visibleChildren.length, this.expandedChildrenLimit + WI.DOMTreeElement.InitialChildrenLimit); | |||
} | |||
|
|||
createElementsToRevealChildElement(childElement) | |||
{ | |||
let indexOfChild = this.children.indexOf(childElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use _visibleChildren()
instead? seems like other spots do
|
||
// Some subclasses may hide elements by default to avoid showing too many items initially, but to reveal an | ||
// element we must load that element and previous sibilings as well. | ||
currentElement.parent.createElementsToRevealChildElement(currentElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of having this be on the parent
, could we maybe have WI.DOMTreeElement
override reveal
to do this logic instead? IMO no reason to have a protected method if we can handle this just within WI.DOMTreeElement
instead. FYI it looks like showChildNode
already does something kinda like this
546ffac
to
f562e09
Compare
EWS run on current version of this PR (hash f562e09)
|
f562e09
to
43eef4d
Compare
…f the element is hidden behind the "Show All Nodes" button https://bugs.webkit.org/show_bug.cgi?id=250430 rdar://102669246 Reviewed by Devin Rousso. Revealing a TreeElement currently makes sure to traverse up through parent elements to expand each element to make sure the element is visible. This doesn't necessilary work for DOMTreeElements, though, since they may additionally have hidden elements behind a "Show All Nodes" button. This means we need to provide each parent element an opportunity to fill in these hidden elements so that the entire chain of tree elements is actually loaded, otherwise we won't actually reveal the element we wanted to. * Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype.reveal): - Tree elements should call to each ancestor to make sure the entire chain of elements is actually revealed by providing the parent elements an opportunity to fill in missing elements that they are not currently displaying. (WI.DOMTreeElement.prototype.onexpand): * Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline.prototype._onmousemove): - Related fixes: The element will not always be a DOMTreeElement (namely the button for showing more elements). * Source/WebInspectorUI/UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.reveal): - Provide a way for to bypass expanding the ancestor tree. This is used by DOMTreeElement which overrides this method, and expands the tree itself before calling here. Canonical link: https://commits.webkit.org/258805@main
43eef4d
to
93e9322
Compare
Committed 258805@main (93e9322): https://commits.webkit.org/258805@main Reviewed commits have been landed. Closing PR #8502 and removing active labels. |
93e9322
f562e09
🧪 api-mac🧪 api-ios🧪 api-gtk