Changeset 224499 in webkit


Ignore:
Timestamp:
Nov 6, 2017 10:56:38 AM (6 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Selecting a DOM Search Result in Search Tab unexpectedly changes Tabs
https://bugs.webkit.org/show_bug.cgi?id=179223
<rdar://problem/33949556>

Reviewed by Devin Rousso.

  • Localizations/en.lproj/localizedStrings.js:

New string.

  • UserInterface/Views/SearchResultTreeElement.js:

(WI.SearchResultTreeElement.prototype.populateContextMenu):
Add a context menu for search results to jump to a different tab.
These behaviors match the double click behavior for search results.

  • UserInterface/Views/SearchTabContentView.js:

(WI.SearchTabContentView.prototype.canShowRepresentedObject):
Always support showing a DOM Tree. Clients should be using
ignoreSearchTab if they don't want to jump here.

  • UserInterface/Views/DOMTreeDataGridNode.js:

(WI.DOMTreeDataGridNode.prototype._goToArrowWasClicked):

  • UserInterface/Views/LayerTreeDataGridNode.js:

(WI.LayerTreeDataGridNode.prototype._goToArrowWasClicked):
Use ignoreSearchTab just in case when showing a DOM Tree.

  • UserInterface/Views/ContentBrowser.js:

(WI.ContentBrowser.prototype.shown):
When showing, update our UI to reflect the values of the current content view, which
for a while may have been owned by another ContentBrowser.

(WI.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
(WI.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
(WI.ContentBrowser.prototype._contentViewNavigationItemsDidChange):
We can avoid work in a few places where we might not be the owning ContentBrowser
of a ContentView that is changing.

Location:
trunk/Source/WebInspectorUI
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r224481 r224499  
     12017-11-06  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Selecting a DOM Search Result in Search Tab unexpectedly changes Tabs
     4        https://bugs.webkit.org/show_bug.cgi?id=179223
     5        <rdar://problem/33949556>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * Localizations/en.lproj/localizedStrings.js:
     10        New string.
     11
     12        * UserInterface/Views/SearchResultTreeElement.js:
     13        (WI.SearchResultTreeElement.prototype.populateContextMenu):
     14        Add a context menu for search results to jump to a different tab.
     15        These behaviors match the double click behavior for search results.
     16
     17        * UserInterface/Views/SearchTabContentView.js:
     18        (WI.SearchTabContentView.prototype.canShowRepresentedObject):
     19        Always support showing a DOM Tree. Clients should be using
     20        ignoreSearchTab if they don't want to jump here.
     21
     22        * UserInterface/Views/DOMTreeDataGridNode.js:
     23        (WI.DOMTreeDataGridNode.prototype._goToArrowWasClicked):
     24        * UserInterface/Views/LayerTreeDataGridNode.js:
     25        (WI.LayerTreeDataGridNode.prototype._goToArrowWasClicked):
     26        Use ignoreSearchTab just in case when showing a DOM Tree.
     27
     28        * UserInterface/Views/ContentBrowser.js:
     29        (WI.ContentBrowser.prototype.shown):
     30        When showing, update our UI to reflect the values of the current content view, which
     31        for a while may have been owned by another ContentBrowser.
     32
     33        (WI.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
     34        (WI.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
     35        (WI.ContentBrowser.prototype._contentViewNavigationItemsDidChange):
     36        We can avoid work in a few places where we might not be the owning ContentBrowser
     37        of a ContentView that is changing.
     38
    1392017-11-05  Nikita Vasilyev  <nvasilyev@apple.com>
    240
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r224456 r224499  
    779779localizedStrings["Reveal in DOM Tree"] = "Reveal in DOM Tree";
    780780localizedStrings["Reveal in Debugger Tab"] = "Reveal in Debugger Tab";
     781localizedStrings["Reveal in Elements Tab"] = "Reveal in Elements Tab";
    781782localizedStrings["Reveal in Original Resource"] = "Reveal in Original Resource";
    782783localizedStrings["Reveal in Resources Tab"] = "Reveal in Resources Tab";
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r223948 r224499  
    17831783
    17841784    this.showElementsTab();
    1785     this.showMainFrameDOMTree(event.data.node);
     1785    this.showMainFrameDOMTree(event.data.node, {ignoreSearchTab: true});
    17861786};
    17871787
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js

    r222868 r224499  
    232232    shown()
    233233    {
     234        this._updateContentViewSelectionPathNavigationItem(this.currentContentView);
     235        this.updateHierarchicalPathForCurrentContentView()
     236
    234237        this._contentViewContainer.shown();
    235238    }
     
    488491            return;
    489492
     493        // If the ContentView is a tombstone within our ContentViewContainer, do nothing. Let the owning ContentBrowser react.
     494        if (event.target.parentContainer !== this._contentViewContainer)
     495            return;
     496
    490497        this._updateContentViewSelectionPathNavigationItem(event.target);
    491498        this._updateBackForwardButtons();
     
    501508    {
    502509        if (event.target !== this.currentContentView)
     510            return;
     511
     512        // If the ContentView is a tombstone within our ContentViewContainer, do nothing. Let the owning ContentBrowser react.
     513        if (event.target.parentContainer !== this._contentViewContainer)
    503514            return;
    504515
     
    527538    {
    528539        if (event.target !== this.currentContentView)
     540            return;
     541
     542        // If the ContentView is a tombstone within our ContentViewContainer, do nothing. Let the owning ContentBrowser react.
     543        if (event.target.parentContainer !== this._contentViewContainer)
    529544            return;
    530545
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js

    r220119 r224499  
    6565    _goToArrowWasClicked()
    6666    {
    67         WI.showMainFrameDOMTree(this._domNode);
     67        WI.showMainFrameDOMTree(this._domNode, {ignoreSearchTab: true});
    6868    }
    6969};
  • trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js

    r220119 r224499  
    161161    {
    162162        var domNode = WI.domTreeManager.nodeForId(this._layer.nodeId);
    163         WI.showMainFrameDOMTree(domNode);
     163        WI.showMainFrameDOMTree(domNode, {ignoreSearchTab: true});
    164164    }
    165165};
  • trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js

    r220119 r224499  
    9090        return this.representedObject.sourceCodeTextRange.synthesizedTextValue + ":" + this.representedObject.title;
    9191    }
     92
     93    // Protected
     94
     95    populateContextMenu(contextMenu, event)
     96    {
     97        if (this.representedObject instanceof WI.DOMSearchMatchObject) {
     98            contextMenu.appendItem(WI.UIString("Reveal in Elements Tab"), () => {
     99                WI.showMainFrameDOMTree(this.representedObject.domNode, {
     100                    ignoreSearchTab: true,
     101                });
     102            });
     103        } else if (this.representedObject instanceof WI.SourceCodeSearchMatchObject) {
     104            contextMenu.appendItem(WI.UIString("Reveal in Resources Tab"), () => {
     105                WI.showOriginalOrFormattedSourceCodeTextRange(this.representedObject.sourceCodeTextRange, {
     106                    ignoreNetworkTab: true,
     107                    ignoreSearchTab: true,
     108                });
     109            });
     110        }
     111
     112        super.populateContextMenu(contextMenu, event);
     113    }
    92114};
  • trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js

    r224431 r224499  
    7171    canShowRepresentedObject(representedObject)
    7272    {
    73         if (!(representedObject instanceof WI.Resource) && !(representedObject instanceof WI.Script) && !(representedObject instanceof WI.DOMTree))
     73        if (representedObject instanceof WI.DOMTree)
     74            return true;
     75
     76        if (!(representedObject instanceof WI.Resource) && !(representedObject instanceof WI.Script))
    7477            return false;
    7578
Note: See TracChangeset for help on using the changeset viewer.