Changeset 246556 in webkit


Ignore:
Timestamp:
Jun 18, 2019 12:13:06 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Canvas: the initial state should be selected when processing a new/imported recording if the navigation sidebar is collapsed
https://bugs.webkit.org/show_bug.cgi?id=198952

Reviewed by Joseph Pecoraro.

Prevent any content from being generated until initialLayout is called, as otherwise it's
possible for the CanvasNavigationSidebar to update the current action index before the
preview element has been created, which would throw an error.

  • UserInterface/Views/RecordingContentView.js:

(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.initialLayout):
(WI.RecordingContentView.prototype._updateSliderValue):
(WI.RecordingContentView.prototype._handleRecordingProcessedAction):
Drive-by: update the slider max each time the selected action index is changed.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r246555 r246556  
     12019-06-18  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Canvas: the initial state should be selected when processing a new/imported recording if the navigation sidebar is collapsed
     4        https://bugs.webkit.org/show_bug.cgi?id=198952
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Prevent any content from being generated until `initialLayout` is called, as otherwise it's
     9        possible for the `CanvasNavigationSidebar` to update the current action index before the
     10        preview element has been created, which would throw an error.
     11
     12        * UserInterface/Views/RecordingContentView.js:
     13        (WI.RecordingContentView.prototype.updateActionIndex):
     14        (WI.RecordingContentView.prototype.initialLayout):
     15        (WI.RecordingContentView.prototype._updateSliderValue):
     16        (WI.RecordingContentView.prototype._handleRecordingProcessedAction):
     17        Drive-by: update the slider max each time the selected action index is changed.
     18
    1192019-06-18  Devin Rousso  <drousso@apple.com>
    220
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingContentView.js

    r244908 r246556  
    112112        this._updateSliderValue();
    113113
    114         this._generateContentThrottler.fire();
     114        if (this.didInitialLayout)
     115            this._generateContentThrottler.fire();
    115116
    116117        this._action = this.representedObject.actions[this._index];
     
    180181
    181182        this._updateSliderValue();
     183
     184        if (!isNaN(this._index))
     185            this._generateContentThrottler.fire();
    182186    }
    183187
     
    484488
    485489        this._sliderElement.value = visualActionIndex;
     490        this._sliderElement.max = visualActionIndexes.length;
    486491        this._sliderValueElement.textContent = WI.UIString("%d of %d").format(visualActionIndex, visualActionIndexes.length);
    487492    }
     
    524529        this._updateExportButton();
    525530
    526         this._sliderElement.max = this.representedObject.visualActionIndexes.length;
    527531        this._updateSliderValue();
    528532
Note: See TracChangeset for help on using the changeset viewer.