Web Inspector: Elements tab should toggle visibility for all selected nodes
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 05:21:41 +0000 (05:21 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 05:21:41 +0000 (05:21 +0000)
commitd21bb45d039a2aaa254590ba268c0197634a7dc4
treedcd9f0e03d5108e7268bd6d2f56d4f1d3a259261
parent8757f6df3c548a65b54199b655e991dd7a00136a
Web Inspector: Elements tab should toggle visibility for all selected nodes
https://bugs.webkit.org/show_bug.cgi?id=193089
<rdar://problem/47009256>

Reviewed by Devin Rousso.

Update "Toggle Visibility" command in DOM tree for multiple selection.
When both visible and hidden elements are selected in the DOM tree,
the toggle command behaves contextually. If one or more elements are
visible, they are hidden, otherwise they are shown. The context menu
shows "Hide Elements" or "Show Elements", respectively.

When only one element is selected, or the context menu target element
is not selected, the command continues to be "Toggle Visibility".

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.get isNodeHidden): Added.
(WI.DOMTreeElement.prototype.toggleElementVisibility.inspectedPage_node_injectStyleAndToggleClass):
(WI.DOMTreeElement.prototype.toggleElementVisibility):
(WI.DOMTreeElement.prototype._populateTagContextMenu):

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline):
(WI.DOMTreeOutline.prototype.toggleSelectedElementsVisibility):  Added.
Provide a public method for toggling the visibility of selected DOM nodes.
Used by the "H" keyboard shortcut and DOMTreeElement context menu.

(WI.DOMTreeOutline.prototype._hideElements):
(WI.DOMTreeOutline.prototype._hideElement): Deleted.
Rename for multiple selection.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js