Changeset 87140 in webkit
- Timestamp:
- May 24, 2011 2:24:50 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87139 r87140 1 2011-05-23 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: watched expressions buttons do not match inspector styles. 6 https://bugs.webkit.org/show_bug.cgi?id=30554 7 8 * WebCore.gypi: 9 * inspector/front-end/BreakpointsSidebarPane.js: 10 (WebInspector.XHRBreakpointsSidebarPane): 11 * inspector/front-end/Images/deleteIcon.png: Added. 12 * inspector/front-end/Images/paneRefreshButtons.png: Added. 13 * inspector/front-end/WatchExpressionsSidebarPane.js: 14 (WebInspector.WatchExpressionsSidebarPane.prototype.reset): 15 (WebInspector.WatchExpressionsSidebarPane.prototype._addButtonClicked): 16 (WebInspector.WatchExpressionsSidebarPane.prototype._refreshButtonClicked): 17 (WebInspector.WatchExpressionsSidebarPane.prototype.refreshExpressions): 18 (WebInspector.WatchExpressionsSection): 19 (WebInspector.WatchExpressionsSection.prototype.update.appendResult): 20 (WebInspector.WatchExpressionsSection.prototype.update): 21 (WebInspector.WatchExpressionsSection.prototype.saveExpressions): 22 (WebInspector.WatchExpressionsSection.prototype._mouseMove): 23 (WebInspector.WatchExpressionsSection.prototype._mouseOut): 24 (WebInspector.WatchExpressionsSection.prototype._updateHoveredElement): 25 (WebInspector.WatchExpressionsSection.CompareProperties): 26 (WebInspector.WatchExpressionTreeElement.prototype.update): 27 (WebInspector.WatchExpressionTreeElement.prototype.editingCancelled): 28 * inspector/front-end/WebKit.qrc: 29 * inspector/front-end/inspector.css: 30 (.properties-tree.watch-expressions): 31 (.properties-tree.watch-expressions li): 32 (.section .properties .delete-button): 33 (.section .properties li.hovered .delete-button): 34 (.pane > .title > .pane-title-button): 35 (.pane > .title > .pane-title-button:hover): 36 (.pane > .title > .pane-title-button:active): 37 (.pane > .title > .pane-title-button.add): 38 (.pane > .title > .pane-title-button.refresh): 39 1 40 2011-05-24 Yuta Kitamura <yutak@chromium.org> 2 41 -
trunk/Source/WebCore/WebCore.gypi
r87130 r87140 6286 6286 'inspector/front-end/Images/debuggerStepOut.png', 6287 6287 'inspector/front-end/Images/debuggerStepOver.png', 6288 'inspector/front-end/Images/deleteIcon.png', 6288 6289 'inspector/front-end/Images/disclosureTriangleSmallDown.png', 6289 6290 'inspector/front-end/Images/disclosureTriangleSmallDownBlack.png', … … 6312 6313 'inspector/front-end/Images/paneBottomGrowActive.png', 6313 6314 'inspector/front-end/Images/paneGrowHandleLine.png', 6315 'inspector/front-end/Images/paneRefreshButtons.png', 6314 6316 'inspector/front-end/Images/paneSettingsButtons.png', 6315 6317 'inspector/front-end/Images/popoverArrows.png', -
trunk/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
r85597 r87140 249 249 250 250 var addButton = document.createElement("button"); 251 addButton.className = " add";251 addButton.className = "pane-title-button add"; 252 252 addButton.addEventListener("click", this._addButtonClicked.bind(this), false); 253 253 this.titleElement.appendChild(addButton); -
trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
r81570 r87140 44 44 this.bodyElement.appendChild(this.section.element); 45 45 46 var addElement = document.createElement("button"); 47 addElement.setAttribute("type", "button"); 48 addElement.textContent = WebInspector.UIString("Add"); 49 addElement.addEventListener("click", this.section.addExpression.bind(this.section), false); 50 51 var refreshElement = document.createElement("button"); 52 refreshElement.setAttribute("type", "button"); 53 refreshElement.textContent = WebInspector.UIString("Refresh"); 54 refreshElement.addEventListener("click", this.section.update.bind(this.section), false); 55 56 var centerElement = document.createElement("div"); 57 centerElement.addStyleClass("watch-expressions-buttons-container"); 58 centerElement.appendChild(addElement); 59 centerElement.appendChild(refreshElement); 60 this.bodyElement.appendChild(centerElement); 46 var refreshButton = document.createElement("button"); 47 refreshButton.className = "pane-title-button refresh"; 48 refreshButton.addEventListener("click", this._refreshButtonClicked.bind(this), false); 49 this.titleElement.appendChild(refreshButton); 50 51 var addButton = document.createElement("button"); 52 addButton.className = "pane-title-button add"; 53 addButton.addEventListener("click", this._addButtonClicked.bind(this), false); 54 this.titleElement.appendChild(addButton); 61 55 62 56 this.onexpand = this.refreshExpressions.bind(this); 63 57 }, 64 58 59 _addButtonClicked: function(event) 60 { 61 event.stopPropagation(); 62 this.expanded = true; 63 this.section.addExpression(); 64 }, 65 66 _refreshButtonClicked: function(event) 67 { 68 event.stopPropagation(); 69 this.refreshExpressions(); 70 }, 71 65 72 refreshExpressions: function() 66 73 { 67 if (this.section) 68 this.section.update(); 74 this.section.update(); 69 75 } 70 76 } … … 77 83 78 84 WebInspector.ObjectPropertiesSection.call(this); 85 this.emptyElement = document.createElement("div"); 86 this.emptyElement.className = "info"; 87 this.emptyElement.textContent = WebInspector.UIString("No Watch Expressions"); 79 88 80 89 this.watchExpressions = WebInspector.settings.watchExpressions; … … 84 93 this.expanded = true; 85 94 this.propertiesElement.addStyleClass("watch-expressions"); 95 96 this.element.addEventListener("mousemove", this._mouseMove.bind(this), true); 97 this.element.addEventListener("mouseout", this._mouseOut.bind(this), true); 86 98 } 87 99 … … 89 101 90 102 WebInspector.WatchExpressionsSection.prototype = { 91 update: function() 92 { 103 update: function(e) 104 { 105 e && e.stopPropagation(); 106 93 107 function appendResult(expression, watchIndex, result) 94 108 { … … 96 110 property.watchIndex = watchIndex; 97 111 98 // To clarify what's going on here: 112 // To clarify what's going on here: 99 113 // In the outer function, we calculate the number of properties 100 114 // that we're going to be updating, and set that in the 101 // propertyCount variable. 102 // In this function, we test to see when we are processing the 103 // last property, and then call the superclass's updateProperties() 115 // propertyCount variable. 116 // In this function, we test to see when we are processing the 117 // last property, and then call the superclass's updateProperties() 104 118 // method to get all the properties refreshed at once. 105 119 properties.push(property); … … 117 131 treeElement.startEditing(); 118 132 } 133 134 // Force displaying delete button for hovered element. 135 if (this._lastMouseMovePageY) 136 this._updateHoveredElement(this._lastMouseMovePageY); 119 137 } 120 138 } … … 128 146 var propertyCount = 0; 129 147 for (var i = 0; i < this.watchExpressions.length; ++i) { 130 if (!this.watchExpressions[i]) 148 if (!this.watchExpressions[i]) 131 149 continue; 132 150 ++propertyCount; … … 140 158 continue; 141 159 142 WebInspector.console.evalInInspectedWindow("(" + expression + ")", this._watchObjectGroupId, false, appendResult.bind(this, expression, i)); 160 WebInspector.console.evalInInspectedWindow(expression, this._watchObjectGroupId, false, appendResult.bind(this, expression, i)); 161 } 162 163 if (!propertyCount) { 164 if (!this.emptyElement.parentNode) 165 this.element.appendChild(this.emptyElement); 166 } else { 167 if (this.emptyElement.parentNode) 168 this.element.removeChild(this.emptyElement); 143 169 } 144 170 … … 146 172 // with no expressions, and expanded tree, we get some extra vertical 147 173 // white space 148 // FIXME: should change to use header buttons instead of the buttons149 // at the bottom of the section, then we can add a "No Watch Expressions150 // element when there are no watch expressions, and this issue should151 // go away.152 174 this.expanded = (propertyCount != 0); 153 175 }, … … 184 206 WebInspector.settings.watchExpressions = toSave; 185 207 return toSave.length; 208 }, 209 210 _mouseMove: function(e) 211 { 212 if (this.propertiesElement.firstChild) 213 this._updateHoveredElement(e.pageY); 214 }, 215 216 _mouseOut: function() 217 { 218 if (this._hoveredElement) 219 this._hoveredElement.removeStyleClass("hovered"); 220 delete this._lastMouseMovePageY; 221 }, 222 223 _updateHoveredElement: function(pageY) 224 { 225 if (this._hoveredElement) 226 this._hoveredElement.removeStyleClass("hovered"); 227 228 this._hoveredElement = this.propertiesElement.firstChild; 229 while (true) { 230 var next = this._hoveredElement.nextSibling; 231 while(next && !next.clientHeight) 232 next = next.nextSibling; 233 if (!next || next.totalOffsetTop > pageY) 234 break; 235 this._hoveredElement = next; 236 } 237 this._hoveredElement.addStyleClass("hovered"); 238 239 this._lastMouseMovePageY = pageY; 186 240 } 187 241 } … … 189 243 WebInspector.WatchExpressionsSection.prototype.__proto__ = WebInspector.ObjectPropertiesSection.prototype; 190 244 191 WebInspector.WatchExpressionsSection.CompareProperties = function(propertyA, propertyB) 245 WebInspector.WatchExpressionsSection.CompareProperties = function(propertyA, propertyB) 192 246 { 193 247 if (propertyA.watchIndex == propertyB.watchIndex) … … 218 272 deleteButton.addStyleClass("delete-button"); 219 273 deleteButton.addEventListener("click", this._deleteButtonClicked.bind(this), false); 220 221 274 this.listItemElement.insertBefore(deleteButton, this.listItemElement.firstChild); 222 275 }, … … 252 305 if (!this.nameElement.textContent) 253 306 this.treeOutline.section.updateExpression(this, null); 254 307 255 308 this.update(); 256 309 this.editingEnded(context); -
trunk/Source/WebCore/inspector/front-end/WebKit.qrc
r85588 r87140 154 154 <file>Images/debuggerStepOut.png</file> 155 155 <file>Images/debuggerStepOver.png</file> 156 <file>Images/deleteIcon.png</file> 156 157 <file>Images/disclosureTriangleSmallDown.png</file> 157 158 <file>Images/disclosureTriangleSmallDownBlack.png</file> … … 180 181 <file>Images/paneBottomGrowActive.png</file> 181 182 <file>Images/paneGrowHandleLine.png</file> 183 <file>Images/paneRefreshButtons.png</file> 182 184 <file>Images/paneSettingsButtons.png</file> 183 185 <file>Images/popoverArrows.png</file> -
trunk/Source/WebCore/inspector/front-end/inspector.css
r85751 r87140 1348 1348 } 1349 1349 1350 .watch-expressions-buttons-container {1351 text-align: center;1352 }1353 1354 1350 .events-pane .section:not(:nth-of-type(1)) { 1355 1351 border-top: 1px solid rgb(191, 191, 191); … … 1595 1591 } 1596 1592 1593 .properties-tree.watch-expressions { 1594 padding-bottom: 8px; 1595 } 1596 1597 .properties-tree.watch-expressions li { 1598 padding-top: 2px; 1599 } 1600 1597 1601 .watch-expressions > li.editing-sub-part .name { 1598 1602 display: block; … … 1614 1618 } 1615 1619 1616 /* FIXME: need a better icon (comment in bug 27514) */1617 1620 .section .properties .delete-button { 1618 1621 width: 10px; 1619 1622 height: 10px; 1620 background-image: url(Images/ errorIcon.png);1623 background-image: url(Images/deleteIcon.png); 1621 1624 background-position: 0 0; 1622 1625 background-color: transparent; 1623 1626 background-repeat: no-repeat; 1624 1627 border: 0 none transparent; 1628 position: absolute; 1629 margin-left: -25px; 1630 margin-top: 2px; 1631 display: none; 1632 } 1633 1634 .section .properties li.hovered .delete-button { 1635 display: inline; 1625 1636 } 1626 1637 … … 1729 1740 } 1730 1741 1731 .pane > .title > button.add{1742 .pane > .title > .pane-title-button { 1732 1743 float: right; 1733 1744 width: 23px; … … 1736 1747 background-color: transparent; 1737 1748 border: none; 1738 background-image: url(Images/paneAddButtons.png);1739 1749 background-repeat: no-repeat; 1740 1750 margin: 1px 0 0 0; … … 1744 1754 } 1745 1755 1746 .pane > .title > button.add:hover {1756 .pane > .title > .pane-title-button:hover { 1747 1757 background-position: -23px 0px; 1748 1758 } 1749 1759 1750 .pane > .title > button.add:active {1760 .pane > .title > .pane-title-button:active { 1751 1761 background-position: -46px 0px; 1762 } 1763 1764 .pane > .title > .pane-title-button.add { 1765 background-image: url(Images/paneAddButtons.png); 1766 } 1767 1768 .pane > .title > .pane-title-button.refresh { 1769 background-image: url(Images/paneRefreshButtons.png); 1752 1770 } 1753 1771
Note: See TracChangeset
for help on using the changeset viewer.