Changeset 85034 in webkit
- Timestamp:
- Apr 27, 2011 1:34:21 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85030 r85034 1 2011-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 1 11 2011-04-27 Mihai Parparita <mihaip@chromium.org> 2 12 -
trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js
r84909 r85034 1697 1697 if (event.handled) 1698 1698 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 { 1699 1719 var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down"); 1700 1720 var pageKeyPressed = (event.keyIdentifier === "PageUp" || event.keyIdentifier === "PageDown"); 1701 1721 if (!arrowKeyPressed && !pageKeyPressed) 1702 return ;1722 return false; 1703 1723 1704 1724 var selection = window.getSelection(); 1705 1725 if (!selection.rangeCount) 1706 return ;1726 return false; 1707 1727 1708 1728 var selectionRange = selection.getRangeAt(0); 1709 1729 if (selectionRange.commonAncestorContainer !== this.valueElement && !selectionRange.commonAncestorContainer.isDescendant(this.valueElement)) 1710 return ;1730 return false; 1711 1731 1712 1732 var wordRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this.valueElement); … … 1759 1779 this.applyStyleText(this.nameElement.textContent + ": " + this.valueElement.textContent); 1760 1780 } 1781 return true; 1761 1782 }, 1762 1783 1763 1784 editingEnded: function(context) 1764 1785 { 1786 if (this._applyFreeFlowStyleTextEditTimer) 1787 clearTimeout(this._applyFreeFlowStyleTextEditTimer); 1788 1765 1789 this.hasChildren = context.hasChildren; 1766 1790 if (context.expanded)
Note: See TracChangeset
for help on using the changeset viewer.