Changeset 85034 in webkit


Ignore:
Timestamp:
Apr 27, 2011 1:34:21 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-04-27 Pavel Feldman <pfeldman@google.com>

Reviewed by Yury Semikhatsky.

Web Inspector: implement incremental CSS editing in the structure view.
https://bugs.webkit.org/show_bug.cgi?id=59455

  • inspector/front-end/StylesSidebarPane.js: (WebInspector.StylePropertyTreeElement.prototype):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85030 r85034  
     12011-04-27  Pavel Feldman  <pfeldman@google.com>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: implement incremental CSS editing in the structure view.
     6        https://bugs.webkit.org/show_bug.cgi?id=59455
     7
     8        * inspector/front-end/StylesSidebarPane.js:
     9        (WebInspector.StylePropertyTreeElement.prototype):
     10
    1112011-04-27  Mihai Parparita  <mihaip@chromium.org>
    212
  • trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js

    r84909 r85034  
    16971697        if (event.handled)
    16981698            return;
     1699        if (this._handleUpOrDownKeyPressed(event))
     1700            return;
     1701
     1702        this._applyFreeFlowStyleTextEdit();
     1703    },
     1704
     1705    _applyFreeFlowStyleTextEdit: function()
     1706    {
     1707        if (this._applyFreeFlowStyleTextEditTimer)
     1708            clearTimeout(this._applyFreeFlowStyleTextEditTimer);
     1709
     1710        function apply()
     1711        {
     1712            this.applyStyleText(this.nameElement.textContent + ": " + this.valueElement.textContent);
     1713        }
     1714        this._applyFreeFlowStyleTextEditTimer = setTimeout(apply.bind(this), 100);
     1715    },
     1716
     1717    _handleUpOrDownKeyPressed: function(event)
     1718    {
    16991719        var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down");
    17001720        var pageKeyPressed = (event.keyIdentifier === "PageUp" || event.keyIdentifier === "PageDown");
    17011721        if (!arrowKeyPressed && !pageKeyPressed)
    1702             return;
     1722            return false;
    17031723
    17041724        var selection = window.getSelection();
    17051725        if (!selection.rangeCount)
    1706             return;
     1726            return false;
    17071727
    17081728        var selectionRange = selection.getRangeAt(0);
    17091729        if (selectionRange.commonAncestorContainer !== this.valueElement && !selectionRange.commonAncestorContainer.isDescendant(this.valueElement))
    1710             return;
     1730            return false;
    17111731
    17121732        var wordRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this.valueElement);
     
    17591779            this.applyStyleText(this.nameElement.textContent + ": " + this.valueElement.textContent);
    17601780        }
     1781        return true;
    17611782    },
    17621783
    17631784    editingEnded: function(context)
    17641785    {
     1786        if (this._applyFreeFlowStyleTextEditTimer)
     1787            clearTimeout(this._applyFreeFlowStyleTextEditTimer);
     1788
    17651789        this.hasChildren = context.hasChildren;
    17661790        if (context.expanded)
Note: See TracChangeset for help on using the changeset viewer.