Changeset 222124 in webkit


Ignore:
Timestamp:
Sep 15, 2017 7:12:17 PM (7 years ago)
Author:
webkit@devinrousso.com
Message:

Web Inspector: REGRESSION(r222057): recording state doesn't update when changing actions
https://bugs.webkit.org/show_bug.cgi?id=176988

Reviewed by Matt Baker.

Replace updateActionIndex with updateAction, where the currently selected RecordingAction
is passed to the DetailsSidebarPanel. Also remove the call to this._recording.actions in
order to ensure that all logic performed by both DetailsSidebarPanel is synchronous.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Views/RecordingTabContentView.js:

(WI.RecordingTabContentView.prototype._updateActionIndex):

  • UserInterface/Views/RecordingContentView.js:

(WI.RecordingContentView.prototype.async._generateContentCanvas2D):
(WI.RecordingContentView.prototype.async._generateContentCanvasWebGL):

  • UserInterface/Views/RecordingStateDetailsSidebarPanel.js:

(WI.RecordingStateDetailsSidebarPanel):
(WI.RecordingStateDetailsSidebarPanel.prototype.set recording):
(WI.RecordingStateDetailsSidebarPanel.prototype.updateAction):
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
(WI.RecordingStateDetailsSidebarPanel.prototype.updateActionIndex): Deleted.

  • UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:

(WI.RecordingTraceDetailsSidebarPanel):
(WI.RecordingTraceDetailsSidebarPanel.prototype.set recording):
(WI.RecordingTraceDetailsSidebarPanel.prototype.updateAction):
(WI.RecordingTraceDetailsSidebarPanel.prototype.updateActionIndex): Deleted.

Location:
trunk/Source/WebInspectorUI
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r222102 r222124  
     12017-09-15  Devin Rousso  <webkit@devinrousso.com>
     2
     3        Web Inspector: REGRESSION(r222057): recording state doesn't update when changing actions
     4        https://bugs.webkit.org/show_bug.cgi?id=176988
     5
     6        Reviewed by Matt Baker.
     7
     8        Replace `updateActionIndex` with `updateAction`, where the currently selected RecordingAction
     9        is passed to the DetailsSidebarPanel. Also remove the call to `this._recording.actions` in
     10        order to ensure that all logic performed by both DetailsSidebarPanel is synchronous.
     11
     12        * Localizations/en.lproj/localizedStrings.js:
     13
     14        * UserInterface/Views/RecordingTabContentView.js:
     15        (WI.RecordingTabContentView.prototype._updateActionIndex):
     16
     17        * UserInterface/Views/RecordingContentView.js:
     18        (WI.RecordingContentView.prototype.async._generateContentCanvas2D):
     19        (WI.RecordingContentView.prototype.async._generateContentCanvasWebGL):
     20
     21        * UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
     22        (WI.RecordingStateDetailsSidebarPanel):
     23        (WI.RecordingStateDetailsSidebarPanel.prototype.set recording):
     24        (WI.RecordingStateDetailsSidebarPanel.prototype.updateAction):
     25        (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
     26        (WI.RecordingStateDetailsSidebarPanel.prototype.updateActionIndex): Deleted.
     27
     28        * UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
     29        (WI.RecordingTraceDetailsSidebarPanel):
     30        (WI.RecordingTraceDetailsSidebarPanel.prototype.set recording):
     31        (WI.RecordingTraceDetailsSidebarPanel.prototype.updateAction):
     32        (WI.RecordingTraceDetailsSidebarPanel.prototype.updateActionIndex): Deleted.
     33
    1342017-09-15  Matt Baker  <mattbaker@apple.com>
    235
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r222064 r222124  
    147147localizedStrings["Call Frames Truncated"] = "Call Frames Truncated";
    148148localizedStrings["Call Stack"] = "Call Stack";
     149localizedStrings["Call Stack Unavailable"] = "Call Stack Unavailable";
    149150localizedStrings["Call Trees"] = "Call Trees";
    150151localizedStrings["Calls"] = "Calls";
     
    595596localizedStrings["No Results Found"] = "No Results Found";
    596597localizedStrings["No Search Results"] = "No Search Results";
    597 localizedStrings["No Trace Data"] = "No Trace Data";
    598598localizedStrings["No Watch Expressions"] = "No Watch Expressions";
    599599localizedStrings["No matching ARIA role"] = "No matching ARIA role";
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingContentView.js

    r222057 r222124  
    399399        applyActions(snapshot.index, this._index, () => {
    400400            if (options.actionCompletedCallback)
    401                 options.actionCompletedCallback(snapshot.context);
     401                options.actionCompletedCallback(actions[this._index], snapshot.context);
    402402        });
    403403
     
    449449
    450450        if (options.actionCompletedCallback)
    451             options.actionCompletedCallback();
     451            options.actionCompletedCallback(actions[this._index]);
    452452    }
    453453
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingStateDetailsSidebarPanel.js

    r222102 r222124  
    3131
    3232        this._recording = null;
    33         this._index = NaN;
     33        this._action = null;
    3434
    3535        this._dataGrid = null;
     
    6161
    6262        this._recording = recording;
    63         this._index = NaN;
     63        this._action = null;
    6464
    6565        for (let subview of this.contentView.subviews)
     
    6767    }
    6868
    69     updateActionIndex(index, context, options = {})
     69    updateAction(action, context, options = {})
    7070    {
    71         if (!this._recording)
     71        if (!this._recording || action === this._action)
    7272            return;
    7373
    74         this._recording.actions.then((actions) => {
    75             console.assert(index >= 0 && index < actions.length);
    76             if (index < 0 || index > actions.length || index === this._index)
    77                 return;
     74        this._action = action;
    7875
    79             this._index = index;
     76        if (this._recording.type === WI.Recording.Type.Canvas2D)
     77            this._generateDetailsCanvas2D(action, context, options);
    8078
    81             if (this._recording.type === WI.Recording.Type.Canvas2D)
    82                 this._generateDetailsCanvas2D(context, actions, options);
    83 
    84             this.updateLayoutIfNeeded();
    85         });
     79        this.updateLayoutIfNeeded();
    8680    }
    8781
    8882    // Private
    8983
    90     _generateDetailsCanvas2D(context, actions, options = {})
     84    _generateDetailsCanvas2D(action, context, options = {})
    9185    {
    9286        if (!this._dataGrid) {
     
    149143        }
    150144
    151         let action = actions[this._index];
    152145        for (let name in state) {
    153146            let value = state[name];
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingTabContentView.js

    r222057 r222124  
    133133        this._scrubberNavigationItem.value = index;
    134134
    135         options.actionCompletedCallback = (context) => {
     135        options.actionCompletedCallback = (action, context) => {
    136136            for (let detailsSidebarPanel of this.detailsSidebarPanels) {
    137                 if (detailsSidebarPanel.updateActionIndex)
    138                     detailsSidebarPanel.updateActionIndex(index, context, options);
     137                if (detailsSidebarPanel.updateAction)
     138                    detailsSidebarPanel.updateAction(action, context, options);
    139139            }
    140140        };
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingTraceDetailsSidebarPanel.js

    r222057 r222124  
    3131
    3232        this._recording = null;
    33         this._index = NaN;
     33        this._action = null;
    3434    }
    3535
     
    5959
    6060        this._recording = recording;
    61         this._index = NaN;
     61        this._action = null;
    6262
    6363        this.contentView.element.removeChildren();
    6464    }
    6565
    66     updateActionIndex(index, context, options = {})
     66    updateAction(action, context, options = {})
    6767    {
    68         if (!this._recording)
     68        if (!this._recording || action === this._action)
    6969            return;
    7070
    71         this._recording.actions.then((actions) => {
    72             console.assert(index >= 0 && index < actions.length);
    73             if (index < 0 || index > actions.length || index === this._index)
    74                 return;
     71        this._action = action;
    7572
    76             this._index = index;
     73        this.contentView.element.removeChildren();
    7774
    78             this.contentView.element.removeChildren();
     75        let trace = this._action.trace;
     76        if (!trace.length) {
     77            let noTraceDataElement = this.contentView.element.appendChild(document.createElement("div"));
     78            noTraceDataElement.classList.add("no-trace-data");
    7979
    80             let trace = actions[this._index].trace;
    81             if (!trace.length) {
    82                 let noTraceDataElement = this.contentView.element.appendChild(document.createElement("div"));
    83                 noTraceDataElement.classList.add("no-trace-data");
     80            let noTraceDataMessageElement = noTraceDataElement.appendChild(document.createElement("div"));
     81            noTraceDataMessageElement.classList.add("message");
     82            noTraceDataMessageElement.textContent = WI.UIString("Call Stack Unavailable");
     83            return;
     84        }
    8485
    85                 let noTraceDataMessageElement = noTraceDataElement.appendChild(document.createElement("div"));
    86                 noTraceDataMessageElement.classList.add("message");
    87                 noTraceDataMessageElement.textContent = WI.UIString("No Trace Data");
    88                 return;
    89             }
    90 
    91             const showFunctionName = true;
    92             for (let callFrame of trace)
    93                 this.contentView.element.appendChild(new WI.CallFrameView(callFrame, showFunctionName));
    94         });
     86        const showFunctionName = true;
     87        for (let callFrame of trace)
     88            this.contentView.element.appendChild(new WI.CallFrameView(callFrame, showFunctionName));
    9589    }
    9690};
Note: See TracChangeset for help on using the changeset viewer.