Changeset 242566 in webkit


Ignore:
Timestamp:
Mar 6, 2019 2:28:27 PM (5 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: TimelineOverview clicks do not always behave as expected
https://bugs.webkit.org/show_bug.cgi?id=195319

Reviewed by Devin Rousso.

  • UserInterface/Views/TimelineRuler.js:

(WI.TimelineRuler.prototype._shouldIgnoreMicroMovement):
(WI.TimelineRuler.prototype._handleMouseDown):
(WI.TimelineRuler.prototype._handleMouseMove):
Ignore moves that haven't gone more than 4px. Once the threshold is
passed allow all moves. This improves the click behavior since
previously click would never re-dispatch if there was any movement.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r242562 r242566  
     12019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: TimelineOverview clicks do not always behave as expected
     4        https://bugs.webkit.org/show_bug.cgi?id=195319
     5
     6        Reviewed by Devin Rousso.
     7
     8        * UserInterface/Views/TimelineRuler.js:
     9        (WI.TimelineRuler.prototype._shouldIgnoreMicroMovement):
     10        (WI.TimelineRuler.prototype._handleMouseDown):
     11        (WI.TimelineRuler.prototype._handleMouseMove):
     12        Ignore moves that haven't gone more than 4px. Once the threshold is
     13        passed allow all moves. This improves the click behavior since
     14        previously click would never re-dispatch if there was any movement.
     15
    1162019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js

    r242194 r242566  
    747747    }
    748748
     749    _shouldIgnoreMicroMovement(event)
     750    {
     751        if (this._mousePassedMicroMovementTest)
     752            return false;
     753
     754        let pixels = Math.abs(event.pageX - this._mouseStartX);
     755        if (pixels <= 4)
     756            return true;
     757
     758        this._mousePassedMicroMovementTest = true;
     759        return false;
     760    }
     761
    749762    _handleClick(event)
    750763    {
     
    798811        this._mouseMoved = false;
    799812
     813        this._mousePassedMicroMovementTest = false;
     814        this._mouseStartX = event.pageX;
     815
    800816        this._mouseMoveEventListener = this._handleMouseMove.bind(this);
    801817        this._mouseUpEventListener = this._handleMouseUp.bind(this);
     
    812828    {
    813829        console.assert(event.button === 0);
     830
     831        if (this._shouldIgnoreMicroMovement(event))
     832            return;
    814833
    815834        this._mouseMoved = true;
Note: See TracChangeset for help on using the changeset viewer.