Changeset 243403 in webkit


Ignore:
Timestamp:
Mar 22, 2019 3:19:38 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Sources: "Reveal in Resources Tab" still shown when Sources tab is enabled
https://bugs.webkit.org/show_bug.cgi?id=196134

Reviewed by Joseph Pecoraro.

  • UserInterface/Views/RecordingActionTreeElement.js:

(WI.RecordingActionTreeElement.prototype.populateContextMenu):
Drive-by: find the first call frame that has a source code location, rather than naively
always using the top call frame.

  • UserInterface/Views/SearchResultTreeElement.js:

(WI.SearchResultTreeElement.prototype.populateContextMenu):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r243396 r243403  
     12019-03-22  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Sources: "Reveal in Resources Tab" still shown when Sources tab is enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=196134
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * UserInterface/Views/RecordingActionTreeElement.js:
     9        (WI.RecordingActionTreeElement.prototype.populateContextMenu):
     10        Drive-by: find the first call frame that has a source code location, rather than naively
     11        always using the top call frame.
     12
     13        * UserInterface/Views/SearchResultTreeElement.js:
     14        (WI.SearchResultTreeElement.prototype.populateContextMenu):
     15
    1162019-03-22  Keith Rollin  <krollin@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js

    r242768 r243403  
    429429        contextMenu.appendSeparator();
    430430
    431         let callFrame = this.representedObject.trace[0];
    432         if (callFrame) {
    433             contextMenu.appendItem(WI.UIString("Reveal in Resources Tab"), () => {
    434                 WI.showSourceCodeLocation(callFrame.sourceCodeLocation, {
     431        let sourceCodeLocation = null;
     432        for (let callFrame of this.representedObject.trace) {
     433            if (callFrame.sourceCodeLocation) {
     434                sourceCodeLocation = callFrame.sourceCodeLocation;
     435                break;
     436            }
     437        }
     438
     439        if (sourceCodeLocation) {
     440            let label = null;
     441            if (WI.settings.experimentalEnableSourcesTab.value)
     442                label = WI.UIString("Reveal in Sources Tab");
     443            else
     444                label = WI.UIString("Reveal in Resources Tab");
     445            contextMenu.appendItem(label, () => {
     446                WI.showSourceCodeLocation(sourceCodeLocation, {
    435447                    ignoreNetworkTab: true,
    436448                    ignoreSearchTab: true,
  • trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js

    r242018 r243403  
    100100            });
    101101        } else if (this.representedObject instanceof WI.SourceCodeSearchMatchObject) {
    102             contextMenu.appendItem(WI.UIString("Reveal in Resources Tab"), () => {
     102            let label = null;
     103            if (WI.settings.experimentalEnableSourcesTab.value)
     104                label = WI.UIString("Reveal in Sources Tab");
     105            else
     106                label = WI.UIString("Reveal in Resources Tab");
     107            contextMenu.appendItem(label, () => {
    103108                WI.showOriginalOrFormattedSourceCodeTextRange(this.representedObject.sourceCodeTextRange, {
    104109                    ignoreNetworkTab: true,
Note: See TracChangeset for help on using the changeset viewer.