Title: [158794] branches/safari-537.73-branch/Source/WebInspectorUI
- Revision
- 158794
- Author
- [email protected]
- Date
- 2013-11-06 14:37:56 -0800 (Wed, 06 Nov 2013)
Log Message
Merged r156675. <rdar://problem/15406691>
Modified Paths
Diff
Modified: branches/safari-537.73-branch/Source/WebInspectorUI/ChangeLog (158793 => 158794)
--- branches/safari-537.73-branch/Source/WebInspectorUI/ChangeLog 2013-11-06 22:37:46 UTC (rev 158793)
+++ branches/safari-537.73-branch/Source/WebInspectorUI/ChangeLog 2013-11-06 22:37:56 UTC (rev 158794)
@@ -1,5 +1,35 @@
2013-11-06 Lucas Forschler <[email protected]>
+ Merge r156675
+
+ 2013-09-30 Antoine Quint <[email protected]>
+
+ Web Inspector: rows in the Layer sidebar panel may have the incorrect background color
+ https://bugs.webkit.org/show_bug.cgi?id=122108
+
+ Reviewed by Darin Adler.
+
+ The LayerTreeDataGrid is a custom DataGrid subclass which exposes a .setChildren() method
+ used to sort chidren without DOM order manipulation, for performance reason. However, since
+ the way the alternating background color is usually implemented is based on the built-in
+ CSS pseudo-classes working with DOM order, the background colors of nodes in the LayerTreeDataGrid
+ can be incorrect depending on the sort order and the number of nodes. To fix this, we now manually
+ set "even" and "odd" CSS classes on those nodes when they're sorted such that we have a chance
+ to style them as intended.
+
+ * UserInterface/LayerTreeDataGrid.js:
+ (WebInspector.LayerTreeDataGrid.prototype._updateChildren):
+ Check if the data grid node index is even or odd and reflect this via an exclusive "even"
+ or "odd" CSS class name.
+
+ * UserInterface/LayerTreeSidebarPanel.css:
+ (.layer-tree.panel .data-container tbody > tr.even):
+ (.layer-tree.panel .data-container tbody > tr.odd):
+ Apply alternating colors based on the exclusive "even" and "odd" CSS class names as applied in
+ WebInspector.LayerTreeDataGrid.prototype._updateChildren().
+
+2013-11-06 Lucas Forschler <[email protected]>
+
Merge r154550
2013-08-24 Joseph Pecoraro <[email protected]>
Modified: branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js (158793 => 158794)
--- branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js 2013-11-06 22:37:46 UTC (rev 158793)
+++ branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js 2013-11-06 22:37:56 UTC (rev 158794)
@@ -92,6 +92,19 @@
var ty = (i - child._domIndex) * 100;
child.element.style.webkitTransform = "translateY(" + ty + "%)";
+
+ // Since the DOM order won't necessarily match the visual order of the
+ // children in the data grid we manually set "even" and "odd" and CSS
+ // class names on the data grid nodes so that they may be styled with
+ // a different mechanism than the built-in CSS pseudo-classes.
+ var classList = child.element.classList;
+ if (i % 2) {
+ classList.remove("odd");
+ classList.add("even");
+ } else {
+ classList.remove("even");
+ classList.add("odd");
+ }
}
this.hasChildren = this.children.length > 0;
Modified: branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css (158793 => 158794)
--- branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css 2013-11-06 22:37:46 UTC (rev 158793)
+++ branches/safari-537.73-branch/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css 2013-11-06 22:37:56 UTC (rev 158794)
@@ -166,6 +166,14 @@
display: block;
}
+.layer-tree.panel .data-container tbody > tr.even {
+ background-color: white;
+}
+
+.layer-tree.panel .data-container tbody > tr.odd {
+ background-color: rgb(243, 246, 250);
+}
+
/* Bottom bar */
.layer-tree.panel .bottom-bar {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes