Changeset 74193 in webkit


Ignore:
Timestamp:
Dec 16, 2010 8:56:53 AM (13 years ago)
Author:
yurys@chromium.org
Message:

2010-12-16 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Console always scroll to the bottom on new events
https://bugs.webkit.org/show_bug.cgi?id=51189

When new messages are added to the console it will auto scroll
only if it was already scrolled down to the last record.

  • inspector/front-end/ConsoleView.js: (WebInspector.ConsoleView.prototype._scheduleScrollIntoView.scrollIntoView): (WebInspector.ConsoleView.prototype._scheduleScrollIntoView): (WebInspector.ConsoleView.prototype._isScrolledToLastMessage): (WebInspector.ConsoleView.prototype.addMessage):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74191 r74193  
     12010-12-16  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Console always scroll to the bottom on new events
     6        https://bugs.webkit.org/show_bug.cgi?id=51189
     7
     8        When new messages are added to the console it will auto scroll
     9        only if it was already scrolled down to the last record.
     10
     11        * inspector/front-end/ConsoleView.js:
     12        (WebInspector.ConsoleView.prototype._scheduleScrollIntoView.scrollIntoView):
     13        (WebInspector.ConsoleView.prototype._scheduleScrollIntoView):
     14        (WebInspector.ConsoleView.prototype._isScrolledToLastMessage):
     15        (WebInspector.ConsoleView.prototype.addMessage):
     16
    1172010-12-16  Pavel Podivilov  <podivilov@chromium.org>
    218
  • trunk/WebCore/inspector/front-end/ConsoleView.js

    r74153 r74193  
    207207        function scrollIntoView()
    208208        {
    209             this.promptElement.scrollIntoView(false);
     209            this.promptElement.scrollIntoView(true);
    210210            delete this._scrollIntoViewTimer;
    211211        }
     
    215215    addMessage: function(msg)
    216216    {
     217        var shouldScrollToLastMessage = this.messagesElement.isScrolledToBottom();
     218
    217219        if (msg instanceof WebInspector.ConsoleMessage && !(msg instanceof WebInspector.ConsoleCommandResult)) {
    218220            this._incrementErrorWarningCount(msg);
     
    242244        }
    243245
    244         this._scheduleScrollIntoView();
     246        if (shouldScrollToLastMessage)
     247            this._scheduleScrollIntoView();
    245248    },
    246249
  • trunk/WebCore/inspector/front-end/DataGrid.js

    r73913 r74193  
    496496    isScrolledToLastRow: function()
    497497    {
    498         return this._scrollContainer.scrollTop === this._scrollContainer.scrollHeight - this._scrollContainer.offsetHeight;
     498        return this._scrollContainer.isScrolledToBottom();
    499499    },
    500500
  • trunk/WebCore/inspector/front-end/utilities.js

    r72737 r74193  
    215215        sibling = nextSibling;
    216216    }
     217}
     218
     219Element.prototype.isScrolledToBottom = function()
     220{
     221    return this.scrollTop === this.scrollHeight - this.offsetHeight;
    217222}
    218223
Note: See TracChangeset for help on using the changeset viewer.