Changeset 250076 in webkit


Ignore:
Timestamp:
Sep 18, 2019, 6:45:35 PM (6 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: console assertion when pressing up/down in empty console log view
https://bugs.webkit.org/show_bug.cgi?id=201948

Reviewed by Devin Rousso.

  • UserInterface/Views/LogContentView.js:

(WI.LogContentView.prototype._upArrowWasPressed):
(WI.LogContentView.prototype._downArrowWasPressed):
Ensure that a message exists before calling _updateMessagesSelection, which
would assert if given a bad message. Additionally, only perform preventDefault
when selecting a message. This allows us to fall back to a system beep if
this key event does nothing.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r249969 r250076  
     12019-09-18  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: console assertion when pressing up/down in empty console log view
     4        https://bugs.webkit.org/show_bug.cgi?id=201948
     5
     6        Reviewed by Devin Rousso.
     7
     8        * UserInterface/Views/LogContentView.js:
     9        (WI.LogContentView.prototype._upArrowWasPressed):
     10        (WI.LogContentView.prototype._downArrowWasPressed):
     11        Ensure that a message exists before calling `_updateMessagesSelection`, which
     12        would assert if given a bad message. Additionally, only perform preventDefault
     13        when selecting a message. This allows us to fall back to a system beep if
     14        this key event does nothing.
     15
    1162019-09-17  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js

    r249038 r250076  
    986986        var lastMessage = this._selectedMessages.lastValue;
    987987        var previousMessage = this._previousMessage(lastMessage);
    988         if (previousMessage)
     988        if (previousMessage) {
    989989            this._updateMessagesSelection(previousMessage, false, event.shiftKey, true);
    990         else if (!event.shiftKey) {
     990            event.preventDefault();
     991        } else if (!event.shiftKey) {
    991992            this._clearMessagesSelection();
    992             this._updateMessagesSelection(messages[0], false, false, true);
    993         }
    994 
    995         event.preventDefault();
     993            if (messages.length) {
     994                this._updateMessagesSelection(messages[0], false, false, true);
     995                event.preventDefault();
     996            }
     997        }
    996998    }
    997999
     
    10081010        var lastMessage = this._selectedMessages.lastValue;
    10091011        var nextMessage = this._nextMessage(lastMessage);
    1010         if (nextMessage)
     1012        if (nextMessage) {
    10111013            this._updateMessagesSelection(nextMessage, false, event.shiftKey, true);
    1012         else if (!event.shiftKey) {
     1014            event.preventDefault();
     1015        } else if (!event.shiftKey) {
    10131016            this._clearMessagesSelection();
    1014             this._updateMessagesSelection(messages.lastValue, false, false, true);
    1015         }
    1016 
    1017         event.preventDefault();
     1017            if (messages.length) {
     1018                this._updateMessagesSelection(messages.lastValue, false, false, true);
     1019                event.preventDefault();
     1020            }
     1021        }
    10181022    }
    10191023
Note: See TracChangeset for help on using the changeset viewer.