Changeset 183375 in webkit


Ignore:
Timestamp:
Apr 26, 2015, 6:24:37 PM (10 years ago)
Author:
timothy@apple.com
Message:

Web Inspector: Don't use treeElement.revealAndSelect when showing a default content view
https://bugs.webkit.org/show_bug.cgi?id=144239

Using revealAndSelect will end up calling WebInspector.showRepresentedObject. That is not bad
is most cases, but if the select tab supports the same represented object, it can end up showing
the content view in the wrong tab.

Reviewed by Darin Adler.

  • UserInterface/Views/ContentBrowserTabContentView.js:

(WebInspector.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObjectInNavigationSidebar):

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):

  • UserInterface/Views/NavigationSidebarPanel.js:

(WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype.showContentViewForCurrentSelection): Deleted.

  • UserInterface/Views/ResourceSidebarPanel.js:

(WebInspector.ResourceSidebarPanel.prototype.showDefaultContentView):
(WebInspector.ResourceSidebarPanel.prototype._mainFrameDidChange):
(WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange.delayedWork):
(WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange):

Location:
trunk/Source/WebInspectorUI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r183352 r183375  
     12015-04-26  Timothy Hatcher  <timothy@apple.com>
     2
     3        Web Inspector: Don't use treeElement.revealAndSelect when showing a default content view
     4        https://bugs.webkit.org/show_bug.cgi?id=144239
     5
     6        Using revealAndSelect will end up calling WebInspector.showRepresentedObject. That is not bad
     7        is most cases, but if the select tab supports the same represented object, it can end up showing
     8        the content view in the wrong tab.
     9
     10        Reviewed by Darin Adler.
     11
     12        * UserInterface/Views/ContentBrowserTabContentView.js:
     13        (WebInspector.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObjectInNavigationSidebar):
     14        * UserInterface/Views/DebuggerSidebarPanel.js:
     15        (WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):
     16        * UserInterface/Views/NavigationSidebarPanel.js:
     17        (WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
     18        (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
     19        (WebInspector.NavigationSidebarPanel):
     20        (WebInspector.NavigationSidebarPanel.prototype.showContentViewForCurrentSelection): Deleted.
     21        * UserInterface/Views/ResourceSidebarPanel.js:
     22        (WebInspector.ResourceSidebarPanel.prototype.showDefaultContentView):
     23        (WebInspector.ResourceSidebarPanel.prototype._mainFrameDidChange):
     24        (WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange.delayedWork):
     25        (WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange):
     26
    1272015-04-26  Jono Wells  <jonowells@apple.com>
    228
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js

    r183324 r183375  
    257257
    258258        if (treeElement)
    259             treeElement.revealAndSelect(true, false, false, true);
     259            treeElement.revealAndSelect(true, false, true, true);
    260260        else if (this.navigationSidebarPanel.contentTreeOutline.selectedTreeElement)
    261261            this.navigationSidebarPanel.contentTreeOutline.selectedTreeElement.deselect(true);
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

    r183331 r183375  
    185185        while (currentTreeElement && !currentTreeElement.root) {
    186186            if (currentTreeElement instanceof WebInspector.ResourceTreeElement || currentTreeElement instanceof WebInspector.ScriptTreeElement) {
    187                 currentTreeElement.revealAndSelect();
     187                this.showDefaultContentViewForTreeElement(currentTreeElement);
    188188                return;
    189189            }
  • trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js

    r183331 r183375  
    174174    }
    175175
    176     showContentViewForCurrentSelection()
    177     {
    178         // Reselect the selected tree element to cause the content view to be shown as well. <rdar://problem/10854727>
    179         var selectedTreeElement = this._contentTreeOutline.selectedTreeElement;
    180         if (selectedTreeElement)
    181             selectedTreeElement.select();
     176    showDefaultContentViewForTreeElement(treeElement)
     177    {
     178        console.assert(treeElement);
     179        console.assert(treeElement.representedObject);
     180        if (!treeElement || !treeElement.representedObject)
     181            return;
     182        this.contentBrowser.showContentViewForRepresentedObject(treeElement.representedObject);
     183        treeElement.revealAndSelect(true, false, true, true);
    182184    }
    183185
     
    689691
    690692        if (matchedElement) {
    691             matchedElement.revealAndSelect();
     693            this.showDefaultContentViewForTreeElement(matchedElement);
    692694
    693695            delete this._pendingViewStateCookie;
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js

    r183339 r183375  
    8686        var firstTreeElement = this.contentTreeOutline.children[0];
    8787        if (firstTreeElement)
    88             firstTreeElement.revealAndSelect();
     88            this.showDefaultContentViewForTreeElement(firstTreeElement);
    8989    }
    9090
     
    185185                if (!treeElement)
    186186                    treeElement = this._mainFrameTreeElement;
    187                 treeElement.revealAndSelect(true, false, !!currentContentView, true);
     187                this.showDefaultContentViewForTreeElement(treeElement);
    188188            }
    189189        }
     
    221221                // NOTE: This selection, during provisional loading, won't be saved, so it is
    222222                // safe to do and not-clobber cookie restoration.
    223                 this._mainFrameTreeElement.revealAndSelect(true, false);
     223                this.showDefaultContentViewForTreeElement(this._mainFrameTreeElement);
    224224            }
    225225        }
Note: See TracChangeset for help on using the changeset viewer.