Title: [242560] trunk/Source/WebInspectorUI
Revision
242560
Author
[email protected]
Date
2019-03-06 12:16:35 -0800 (Wed, 06 Mar 2019)

Log Message

Web Inspector: Simplify chart <rect>s with x/y attributes instead of transform(x, y)
https://bugs.webkit.org/show_bug.cgi?id=195352

Patch by Joseph Pecoraro <[email protected]> on 2019-03-06
Reviewed by Matt Baker.

* UserInterface/Views/ColumnChart.js:
(WI.ColumnChart.prototype.layout):
(WI.ColumnChart):
* UserInterface/Views/RangeChart.js:
(WI.RangeChart.prototype.layout):
(WI.RangeChart):
* UserInterface/Views/StackedColumnChart.js:
(WI.StackedColumnChart.prototype.layout):
(WI.StackedColumnChart):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (242559 => 242560)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-03-06 20:05:49 UTC (rev 242559)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-03-06 20:16:35 UTC (rev 242560)
@@ -1,3 +1,20 @@
+2019-03-06  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Simplify chart <rect>s with x/y attributes instead of transform(x, y)
+        https://bugs.webkit.org/show_bug.cgi?id=195352
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/ColumnChart.js:
+        (WI.ColumnChart.prototype.layout):
+        (WI.ColumnChart):
+        * UserInterface/Views/RangeChart.js:
+        (WI.RangeChart.prototype.layout):
+        (WI.RangeChart):
+        * UserInterface/Views/StackedColumnChart.js:
+        (WI.StackedColumnChart.prototype.layout):
+        (WI.StackedColumnChart):
+
 2019-03-06  Devin Rousso  <[email protected]>
 
         Web Inspector: CSS Changes: only show changes for the given node

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js (242559 => 242560)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js	2019-03-06 20:05:49 UTC (rev 242559)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js	2019-03-06 20:16:35 UTC (rev 242560)
@@ -34,8 +34,8 @@
 //
 //  <div class="column-chart">
 //      <svg viewBox="0 0 800 75">
-//          <rect width="<w>" height="<h>" transform="translate(<x>, <y>)" />
-//          <rect width="<w>" height="<h>" transform="translate(<x>, <y>)" />
+//          <rect width="<w>" height="<h>" x="<x>" y="<y>" />
+//          <rect width="<w>" height="<h>" x="<x>" y="<y>" />
 //          ...
 //      </svg>
 //  </div>
@@ -94,7 +94,8 @@
             let rect = this._svgElement.appendChild(createSVGElement("rect"));
             rect.setAttribute("width", width);
             rect.setAttribute("height", height);
-            rect.setAttribute("transform", `translate(${x}, ${y})`);
+            rect.setAttribute("x", x);
+            rect.setAttribute("y", y);
         }
     }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RangeChart.js (242559 => 242560)


--- trunk/Source/WebInspectorUI/UserInterface/Views/RangeChart.js	2019-03-06 20:05:49 UTC (rev 242559)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RangeChart.js	2019-03-06 20:16:35 UTC (rev 242560)
@@ -36,8 +36,8 @@
 //
 //  <div class="range-chart">
 //      <svg viewBox="0 0 800 75">
-//          <rect width="<w>" height="100%" transform="translateX(<x>)" class="<class>" />
-//          <rect width="<w>" height="100%" transform="translateX(<x>)" class="<class>" />
+//          <rect width="<w>" height="100%" x="<x>" class="<class>" />
+//          <rect width="<w>" height="100%" x="<x>" class="<class>" />
 //          ...
 //      </svg>
 //  </div>
@@ -103,7 +103,7 @@
             let rect = this._svgElement.appendChild(createSVGElement("rect"));
             rect.setAttribute("width", width);
             rect.setAttribute("height", height);
-            rect.setAttribute("transform", `translate(${x}, 0)`);
+            rect.setAttribute("x", x);
             rect.classList.add(className);
         }
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/StackedColumnChart.js (242559 => 242560)


--- trunk/Source/WebInspectorUI/UserInterface/Views/StackedColumnChart.js	2019-03-06 20:05:49 UTC (rev 242559)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StackedColumnChart.js	2019-03-06 20:16:35 UTC (rev 242560)
@@ -40,9 +40,9 @@
 //
 //  <div class="stacked-column-chart">
 //      <svg viewBox="0 0 800 75">
-//          <rect class="section-class-name-3" width="<w>" height="<h3>" transform="translate(<x>, <y>)" />
-//          <rect class="section-class-name-2" width="<w>" height="<h2>" transform="translate(<x>, <y>)" />
-//          <rect class="section-class-name-1" width="<w>" height="<h1>" transform="translate(<x>, <y>)" />
+//          <rect class="section-class-name-3" width="<w>" height="<h3>" x="<x>" y="<y>" />
+//          <rect class="section-class-name-2" width="<w>" height="<h2>" x="<x>" y="<y>" />
+//          <rect class="section-class-name-1" width="<w>" height="<h1>" x="<x>" y="<y>" />
 //          ...
 //      </svg>
 //  </div>
@@ -118,7 +118,8 @@
                 rect.classList.add(this._sections[i]);
                 rect.setAttribute("width", width);
                 rect.setAttribute("height", height);
-                rect.setAttribute("transform", `translate(${x}, ${y})`);
+                rect.setAttribute("x", x);
+                rect.setAttribute("y", y);
             }
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to