Changeset 186466 in webkit


Ignore:
Timestamp:
Jul 7, 2015 10:25:48 AM (9 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Option+Click not jumping to resource
https://bugs.webkit.org/show_bug.cgi?id=146498

Reviewed by Timothy Hatcher.

  • UserInterface/Base/Main.js: Always show the tab which contains the represented object.

(WebInspector._domNodeWasInspected):
(WebInspector._frameWasAdded):
(WebInspector.showConsoleTab):
(WebInspector.showRepresentedObject): Removed forceShowTab parameter.
(WebInspector.showMainFrameDOMTree):
(WebInspector.showContentFlowDOMTree):
(WebInspector.showSourceCodeForFrame):
(WebInspector.showSourceCode):
(WebInspector.showSourceCodeLocation):
(WebInspector.showOriginalUnformattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeTextRange):
(WebInspector.showResourceRequest):

  • UserInterface/Controllers/CodeMirrorTokenTrackingController.js:

(WebInspector.CodeMirrorTokenTrackingController.prototype._mouseButtonWasReleasedOverEditor):

  • UserInterface/Protocol/InspectorFrontendAPI.js:

(InspectorFrontendAPI.showMainResourceForFrame):

  • UserInterface/Views/ComputedStyleDetailsPanel.js:

(WebInspector.ComputedStyleDetailsPanel.prototype._goToContentFlowArrowWasClicked):
(WebInspector.ComputedStyleDetailsPanel):

  • UserInterface/Views/ObjectTreeBaseTreeElement.js:

(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
(WebInspector.ObjectTreeBaseTreeElement):

Location:
trunk/Source/WebInspectorUI
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r186463 r186466  
     12015-07-07  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Option+Click not jumping to resource
     4        https://bugs.webkit.org/show_bug.cgi?id=146498
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Base/Main.js: Always show the tab which contains the represented object.
     9        (WebInspector._domNodeWasInspected):
     10        (WebInspector._frameWasAdded):
     11        (WebInspector.showConsoleTab):
     12        (WebInspector.showRepresentedObject): Removed forceShowTab parameter.
     13        (WebInspector.showMainFrameDOMTree):
     14        (WebInspector.showContentFlowDOMTree):
     15        (WebInspector.showSourceCodeForFrame):
     16        (WebInspector.showSourceCode):
     17        (WebInspector.showSourceCodeLocation):
     18        (WebInspector.showOriginalUnformattedSourceCodeLocation):
     19        (WebInspector.showOriginalOrFormattedSourceCodeLocation):
     20        (WebInspector.showOriginalOrFormattedSourceCodeTextRange):
     21        (WebInspector.showResourceRequest):
     22        * UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
     23        (WebInspector.CodeMirrorTokenTrackingController.prototype._mouseButtonWasReleasedOverEditor):
     24        * UserInterface/Protocol/InspectorFrontendAPI.js:
     25        (InspectorFrontendAPI.showMainResourceForFrame):
     26        * UserInterface/Views/ComputedStyleDetailsPanel.js:
     27        (WebInspector.ComputedStyleDetailsPanel.prototype._goToContentFlowArrowWasClicked):
     28        (WebInspector.ComputedStyleDetailsPanel):
     29        * UserInterface/Views/ObjectTreeBaseTreeElement.js:
     30        (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
     31        (WebInspector.ObjectTreeBaseTreeElement):
     32
    1332015-07-07  Devin Rousso  <drousso@apple.com>
    234
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r186386 r186466  
    762762        this.consoleContentView.scopeBar.item(scope).selected = true;
    763763
    764     this.showRepresentedObject(this._consoleRepresentedObject, null, true);
     764    this.showRepresentedObject(this._consoleRepresentedObject);
    765765
    766766    console.assert(this.isShowingConsoleTab());
     
    924924};
    925925
    926 WebInspector.showRepresentedObject = function(representedObject, cookie, forceShowTab)
     926WebInspector.showRepresentedObject = function(representedObject, cookie)
    927927{
    928928    var tabContentView = this.tabContentViewForRepresentedObject(representedObject);
     
    931931        return;
    932932
    933     if (window.event || forceShowTab)
    934         this.tabBrowser.showTabForContentView(tabContentView);
    935 
     933    this.tabBrowser.showTabForContentView(tabContentView);
    936934    tabContentView.showRepresentedObject(representedObject, cookie);
    937935};
    938936
    939 WebInspector.showMainFrameDOMTree = function(nodeToSelect, forceShowTab)
     937WebInspector.showMainFrameDOMTree = function(nodeToSelect)
    940938{
    941939    console.assert(WebInspector.frameResourceManager.mainFrame);
    942940    if (!WebInspector.frameResourceManager.mainFrame)
    943941        return;
    944     this.showRepresentedObject(WebInspector.frameResourceManager.mainFrame.domTree, {nodeToSelect}, forceShowTab);
    945 };
    946 
    947 WebInspector.showContentFlowDOMTree = function(contentFlow, nodeToSelect, forceShowTab)
    948 {
    949     this.showRepresentedObject(contentFlow, {nodeToSelect}, forceShowTab);
    950 };
    951 
    952 WebInspector.showSourceCodeForFrame = function(frameIdentifier, forceShowTab)
     942    this.showRepresentedObject(WebInspector.frameResourceManager.mainFrame.domTree, {nodeToSelect});
     943};
     944
     945WebInspector.showContentFlowDOMTree = function(contentFlow, nodeToSelect)
     946{
     947    this.showRepresentedObject(contentFlow, {nodeToSelect});
     948};
     949
     950WebInspector.showSourceCodeForFrame = function(frameIdentifier)
    953951{
    954952    var frame = WebInspector.frameResourceManager.frameForIdentifier(frameIdentifier);
     
    960958    this._frameIdentifierToShowSourceCodeWhenAvailable = undefined;
    961959
    962     this.showRepresentedObject(frame, null, forceShowTab);
    963 };
    964 
    965 WebInspector.showSourceCode = function(sourceCode, positionToReveal, textRangeToSelect, forceUnformatted, forceShowTab)
     960    this.showRepresentedObject(frame);
     961};
     962
     963WebInspector.showSourceCode = function(sourceCode, positionToReveal, textRangeToSelect, forceUnformatted)
    966964{
    967965    console.assert(!positionToReveal || positionToReveal instanceof WebInspector.SourceCodePosition, positionToReveal);
     
    974972
    975973    var cookie = positionToReveal ? {lineNumber: positionToReveal.lineNumber, columnNumber: positionToReveal.columnNumber} : {};
    976     this.showRepresentedObject(representedObject, cookie, forceShowTab);
    977 };
    978 
    979 WebInspector.showSourceCodeLocation = function(sourceCodeLocation, forceShowTab)
    980 {
    981     this.showSourceCode(sourceCodeLocation.displaySourceCode, sourceCodeLocation.displayPosition(), null, false, forceShowTab);
    982 };
    983 
    984 WebInspector.showOriginalUnformattedSourceCodeLocation = function(sourceCodeLocation, forceShowTab)
     974    this.showRepresentedObject(representedObject, cookie);
     975};
     976
     977WebInspector.showSourceCodeLocation = function(sourceCodeLocation)
     978{
     979    this.showSourceCode(sourceCodeLocation.displaySourceCode, sourceCodeLocation.displayPosition());
     980};
     981
     982WebInspector.showOriginalUnformattedSourceCodeLocation = function(sourceCodeLocation)
    985983{
    986984    this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.position(), null, true);
    987985};
    988986
    989 WebInspector.showOriginalOrFormattedSourceCodeLocation = function(sourceCodeLocation, forceShowTab)
    990 {
    991     this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.formattedPosition(), null, false, forceShowTab);
    992 };
    993 
    994 WebInspector.showOriginalOrFormattedSourceCodeTextRange = function(sourceCodeTextRange, forceShowTab)
     987WebInspector.showOriginalOrFormattedSourceCodeLocation = function(sourceCodeLocation)
     988{
     989    this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.formattedPosition());
     990};
     991
     992WebInspector.showOriginalOrFormattedSourceCodeTextRange = function(sourceCodeTextRange)
    995993{
    996994    var textRangeToSelect = sourceCodeTextRange.formattedTextRange;
    997     this.showSourceCode(sourceCodeTextRange.sourceCode, textRangeToSelect.startPosition(), textRangeToSelect, false, forceShowTab);
    998 };
    999 
    1000 WebInspector.showResourceRequest = function(resource, forceShowTab)
    1001 {
    1002     this.showRepresentedObject(resource, {[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]: WebInspector.ResourceClusterContentView.RequestIdentifier}, forceShowTab);
     995    this.showSourceCode(sourceCodeTextRange.sourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
     996};
     997
     998WebInspector.showResourceRequest = function(resource)
     999{
     1000    this.showRepresentedObject(resource, {[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]: WebInspector.ResourceClusterContentView.RequestIdentifier});
    10031001};
    10041002
     
    11361134    function delayedWork()
    11371135    {
    1138         this.showSourceCodeForFrame(frame.id, true);
     1136        this.showSourceCodeForFrame(frame.id);
    11391137    }
    11401138
     
    15331531
    15341532    this.showElementsTab();
    1535     this.showMainFrameDOMTree(event.data.node, true);
     1533    this.showMainFrameDOMTree(event.data.node);
    15361534};
    15371535
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js

    r182113 r186466  
    352352            for (var i = 0; i < marks.length; ++i) {
    353353                if (marks[i] === this._codeMirrorMarkedText) {
    354                     if (this._delegate && typeof this._delegate.tokenTrackingControllerHighlightedRangeWasClicked === "function") {
    355                         // Trigger the clicked delegate asynchronously, letting the editor complete handling of the click.
    356                         setTimeout(function() { this._delegate.tokenTrackingControllerHighlightedRangeWasClicked(this); }.bind(this), 0);
    357                     }
     354                    if (this._delegate && typeof this._delegate.tokenTrackingControllerHighlightedRangeWasClicked === "function")
     355                        this._delegate.tokenTrackingControllerHighlightedRangeWasClicked(this);
     356
    358357                    break;
    359358                }
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js

    r183907 r186466  
    9494    showMainResourceForFrame: function(frameIdentifier)
    9595    {
    96         WebInspector.showSourceCodeForFrame(frameIdentifier, true);
     96        WebInspector.showSourceCodeForFrame(frameIdentifier);
    9797    },
    9898
  • trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js

    r185723 r186466  
    225225    _goToContentFlowArrowWasClicked()
    226226    {
    227         WebInspector.showContentFlowDOMTree(this._contentFlow, this.nodeStyles.node, true);
     227        WebInspector.showContentFlowDOMTree(this._contentFlow, this.nodeStyles.node);
    228228    }
    229229};
  • trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js

    r186080 r186466  
    224224
    225225                        var sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber || 0);
    226                         WebInspector.showSourceCodeLocation(sourceCodeLocation, true);
     226                        WebInspector.showSourceCodeLocation(sourceCodeLocation);
    227227                    });
    228228                });
Note: See TracChangeset for help on using the changeset viewer.