Changeset 156675 in webkit
- Timestamp:
- Sep 30, 2013 1:10:14 PM (11 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r156673 r156675 1 2013-09-30 Antoine Quint <graouts@apple.com> 2 3 Web Inspector: rows in the Layer sidebar panel may have the incorrect background color 4 https://bugs.webkit.org/show_bug.cgi?id=122108 5 6 Reviewed by Darin Adler. 7 8 The LayerTreeDataGrid is a custom DataGrid subclass which exposes a .setChildren() method 9 used to sort chidren without DOM order manipulation, for performance reason. However, since 10 the way the alternating background color is usually implemented is based on the built-in 11 CSS pseudo-classes working with DOM order, the background colors of nodes in the LayerTreeDataGrid 12 can be incorrect depending on the sort order and the number of nodes. To fix this, we now manually 13 set "even" and "odd" CSS classes on those nodes when they're sorted such that we have a chance 14 to style them as intended. 15 16 * UserInterface/LayerTreeDataGrid.js: 17 (WebInspector.LayerTreeDataGrid.prototype._updateChildren): 18 Check if the data grid node index is even or odd and reflect this via an exclusive "even" 19 or "odd" CSS class name. 20 21 * UserInterface/LayerTreeSidebarPanel.css: 22 (.layer-tree.panel .data-container tbody > tr.even): 23 (.layer-tree.panel .data-container tbody > tr.odd): 24 Apply alternating colors based on the exclusive "even" and "odd" CSS class names as applied in 25 WebInspector.LayerTreeDataGrid.prototype._updateChildren(). 26 1 27 2013-09-30 Antoine Quint <graouts@apple.com> 2 28 -
trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js
r151453 r156675 93 93 var ty = (i - child._domIndex) * 100; 94 94 child.element.style.webkitTransform = "translateY(" + ty + "%)"; 95 96 // Since the DOM order won't necessarily match the visual order of the 97 // children in the data grid we manually set "even" and "odd" and CSS 98 // class names on the data grid nodes so that they may be styled with 99 // a different mechanism than the built-in CSS pseudo-classes. 100 var classList = child.element.classList; 101 if (i % 2) { 102 classList.remove("odd"); 103 classList.add("even"); 104 } else { 105 classList.remove("even"); 106 classList.add("odd"); 107 } 95 108 } 96 109 -
trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css
r155241 r156675 167 167 } 168 168 169 .layer-tree.panel .data-container tbody > tr.even { 170 background-color: white; 171 } 172 173 .layer-tree.panel .data-container tbody > tr.odd { 174 background-color: rgb(243, 246, 250); 175 } 176 169 177 /* Bottom bar */ 170 178
Note: See TracChangeset
for help on using the changeset viewer.