Changeset 193016 in webkit


Ignore:
Timestamp:
Dec 3, 2015, 10:31:33 AM (10 years ago)
Author:
timothy@apple.com
Message:

Merge r187207. rdar://problem/23221163

Location:
branches/safari-601-branch/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601-branch/Source/WebInspectorUI/ChangeLog

    r193015 r193016  
     12015-12-01  Timothy Hatcher  <timothy@apple.com>
     2
     3        Merge r187207. rdar://problem/23221163
     4
     5    2015-07-22  Matt Baker  <mattbaker@apple.com>
     6
     7            Web Inspector: TimelineRuler shouldn't dispatch selection changed event unless it actually changes
     8            https://bugs.webkit.org/show_bug.cgi?id=147219
     9
     10            Reviewed by Timothy Hatcher.
     11
     12            Moved to a "suppress next" model for suppressing dispatch of TimelineRuler's selection changed event. The
     13            ruler's _timeRangeSelectionChanged flag is now reset only when an event is finally dispatched.
     14
     15            * UserInterface/Views/TimelineRuler.js:
     16            (WebInspector.TimelineRuler):
     17            (WebInspector.TimelineRuler.prototype._updateSelection):
     18            (WebInspector.TimelineRuler.prototype._dispatchTimeRangeSelectionChangedEvent):
     19            Check for this._timeRangeSelectionChanged moved into dispatch function.
     20            (WebInspector.TimelineRuler.prototype._handleMouseDown):
     21            (WebInspector.TimelineRuler.prototype._handleMouseMove):
     22            (WebInspector.TimelineRuler.prototype._handleMouseUp):
     23            We now suppress the next dispatch only, rather than a toggle.
     24
    1252015-12-01  Timothy Hatcher  <timothy@apple.com>
    226
  • branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js

    r193011 r193016  
    5252    this._minimumSelectionDuration = 0.01;
    5353    this._formatLabelCallback = null;
     54    this._suppressNextTimeRangeSelectionChangedEvent = false;
     55    this._timeRangeSelectionChanged = false;
    5456
    5557    this._markerElementMap = new Map;
     
    617619        }
    618620
    619         if (this._timeRangeSelectionChanged)
    620             this._dispatchTimeRangeSelectionChangedEvent();
     621        this._dispatchTimeRangeSelectionChangedEvent();
    621622    },
    622623
     
    639640    _dispatchTimeRangeSelectionChangedEvent: function()
    640641    {
    641         delete this._timeRangeSelectionChanged;
    642 
    643         if (this._suppressTimeRangeSelectionChangedEvent)
    644             return;
     642        if (!this._timeRangeSelectionChanged)
     643            return;
     644
     645        if (this._suppressNextTimeRangeSelectionChangedEvent) {
     646            this._suppressNextTimeRangeSelectionChangedEvent = false;
     647            return;
     648        }
     649
     650        this._timeRangeSelectionChanged = false;
    645651
    646652        this.dispatchEventToListeners(WebInspector.TimelineRuler.Event.TimeRangeSelectionChanged);
     
    659665
    660666        this._selectionIsMove = event.target === this._selectionDragElement;
    661         this._suppressTimeRangeSelectionChangedEvent = !this._selectionIsMove;
    662667        this._rulerBoundingClientRect = this._element.getBoundingClientRect();
    663668
     
    684689    {
    685690        console.assert(event.button === 0);
     691
     692        this._suppressNextTimeRangeSelectionChangedEvent = !this._selectionIsMove;
    686693
    687694        if (this._selectionIsMove) {
     
    736743            }
    737744        }
    738 
    739         delete this._suppressTimeRangeSelectionChangedEvent;
    740745
    741746        this._dispatchTimeRangeSelectionChangedEvent();
Note: See TracChangeset for help on using the changeset viewer.