Changeset 31910 in webkit
- Timestamp:
- Apr 15, 2008 10:24:22 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31909 r31910 1 2008-04-15 Timothy Hatcher <timothy@apple.com> 2 3 Fixes the regression where the error and warning counts did not show up in the Resources 4 sidebar next to resources. 5 6 https://bugs.webkit.org/show_bug.cgi?id=18494 7 8 Reviewed by Adam Roben. 9 10 * page/inspector/ResourcesPanel.js: 11 (WebInspector.ResourcesPanel.prototype.addMessageToResource): Increment errors or warnings 12 on the resource. Set the bubbleText to the total of the errors and warnings. Add a error 13 or warning class to the bubble. 14 (WebInspector.ResourcesPanel.prototype.clearMessages): Zero out the errors and warnings 15 properties on each resource. Set the bubbleText back to an empty string. 16 * page/inspector/SidebarTreeElement.js: 17 (WebInspector.SidebarTreeElement): Create a statusElement. 18 (WebInspector.SidebarTreeElement.prototype.get bubbleText): Return _bubbleText. 19 (WebInspector.SidebarTreeElement.prototype.set bubbleText): Create bubbleElement if needed. 20 Assign the value to _bubbleText and bubbleElement.textContent. 21 (WebInspector.SidebarTreeElement.prototype.onattach): Append statusElement to _listItemNode. 22 * page/inspector/inspector.css: Style rules for bubbles and status elements. 23 1 24 2008-04-15 Timothy Hatcher <timothy@apple.com> 2 25 -
trunk/WebCore/page/inspector/ResourcesPanel.js
r31909 r31910 266 266 return; 267 267 268 var bubbleClass; 269 switch (msg.level) { 270 case WebInspector.ConsoleMessage.MessageLevel.Warning: 271 ++resource.warnings; 272 bubbleClass = "warning"; 273 break; 274 case WebInspector.ConsoleMessage.MessageLevel.Error: 275 ++resource.errors; 276 bubbleClass = "error"; 277 break; 278 } 279 280 resource._resourcesTreeElement.bubbleText = (resource.warnings + resource.errors); 281 282 if (bubbleClass) 283 resource._resourcesTreeElement.bubbleElement.addStyleClass(bubbleClass); 284 268 285 var view = this._resourceView(resource); 269 286 if (view.addMessage) … … 276 293 for (var i = 0; i < resourcesLength; ++i) { 277 294 var resource = this._resources[i]; 295 resource.warnings = 0; 296 resource.errors = 0; 297 298 resource._resourcesTreeElement.bubbleText = ""; 299 resource._resourcesTreeElement.bubbleElement.removeStyleClass("error"); 300 resource._resourcesTreeElement.bubbleElement.removeStyleClass("warning"); 301 278 302 var view = resource._resourcesView; 279 303 if (!view || !view.clearMessages) -
trunk/WebCore/page/inspector/SidebarTreeElement.js
r31736 r31910 55 55 } 56 56 57 this.statusElement = document.createElement("div"); 58 this.statusElement.className = "status"; 59 57 60 this.titlesElement = document.createElement("div"); 58 61 this.titlesElement.className = "titles"; … … 94 97 }, 95 98 99 get bubbleText() 100 { 101 return this._bubbleText; 102 }, 103 104 set bubbleText(x) 105 { 106 if (!this.bubbleElement) { 107 this.bubbleElement = document.createElement("div"); 108 this.bubbleElement.className = "bubble"; 109 this.statusElement.appendChild(this.bubbleElement); 110 } 111 112 this._bubbleText = x; 113 this.bubbleElement.textContent = x; 114 }, 115 96 116 refreshTitles: function() 97 117 { … … 126 146 var iconElement = document.createElement("img"); 127 147 iconElement.className = "icon"; 148 128 149 this._listItemNode.appendChild(iconElement); 129 150 this._listItemNode.appendChild(this.statusElement); 130 151 this._listItemNode.appendChild(this.titlesElement); 131 152 }, -
trunk/WebCore/page/inspector/inspector.css
r31885 r31910 1642 1642 } 1643 1643 1644 .sidebar-tree-item .status { 1645 float: right; 1646 height: 16px; 1647 margin-top: 10px; 1648 margin-left: 4px; 1649 line-height: 1em; 1650 } 1651 1652 .sidebar-tree-item .status:empty { 1653 display: none; 1654 } 1655 1656 .sidebar-tree-item .status .bubble { 1657 display: inline-block; 1658 height: 14px; 1659 min-width: 16px; 1660 margin-top: 1px; 1661 background-color: rgb(128, 151, 189); 1662 vertical-align: middle; 1663 white-space: nowrap; 1664 padding: 1px 4px; 1665 text-align: center; 1666 font-size: 11px; 1667 font-family: Helvetia, Arial, sans-serif; 1668 font-weight: bold; 1669 text-shadow: none; 1670 color: white; 1671 -webkit-border-radius: 7px; 1672 } 1673 1674 .sidebar-tree-item .status .bubble:empty { 1675 display: none; 1676 } 1677 1678 .sidebar-tree-item.selected .status .bubble { 1679 background-color: white !important; 1680 color: rgb(132, 154, 190) !important; 1681 } 1682 1683 .focused .sidebar-tree-item.selected .status .bubble { 1684 color: rgb(36, 98, 172) !important; 1685 } 1686 1687 body.inactive .sidebar-tree-item.selected .status .bubble { 1688 color: rgb(159, 159, 159) !important; 1689 } 1690 1644 1691 .sidebar-tree.small .sidebar-tree-item, .sidebar-tree .children.small .sidebar-tree-item, .sidebar-tree-item.small { 1645 1692 height: 20px; 1646 .sidebar-tree-itemne-height: 18px;1693 line-height: 18px; 1647 1694 } 1648 1695 … … 1650 1697 width: 16px; 1651 1698 height: 16px; 1699 } 1700 1701 .sidebar-tree.small .sidebar-tree-item .status, .sidebar-tree .children.small .sidebar-tree-item .status, .sidebar-tree-item.small .status { 1702 margin-top: 2px; 1652 1703 } 1653 1704 … … 1807 1858 content: url(Images/resourceDocumentIconSmall.png); 1808 1859 } 1860 1861 .resource-sidebar-tree-item .bubble.warning { 1862 background-color: rgb(232, 164, 0); 1863 } 1864 1865 .resource-sidebar-tree-item .bubble.error { 1866 background-color: rgb(216, 35, 35); 1867 }
Note: See TracChangeset
for help on using the changeset viewer.