WebKit Bugzilla
Attachment 360888 Details for
Bug 194171
: Web Inspector: Make WI.ColumnChart a WI.View subclass
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Proposed Fix
column-chart-1.patch (text/plain), 4.23 KB, created by
Joseph Pecoraro
on 2019-02-01 13:20:44 PST
(
hide
)
Description:
[PATCH] Proposed Fix
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2019-02-01 13:20:44 PST
Size:
4.23 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 14fd3e1c270..6ef12f23638 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,20 @@ >+2019-02-01 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Make WI.ColumnChart a WI.View subclass >+ https://bugs.webkit.org/show_bug.cgi?id=194171 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Views/CPUTimelineOverviewGraph.js: >+ (WI.CPUTimelineOverviewGraph): >+ * UserInterface/Views/ColumnChart.js: >+ (WI.ColumnChart): >+ (WI.ColumnChart.prototype.set size): >+ (WI.ColumnChart.prototype.layout): >+ (WI.ColumnChart.prototype.get element): Deleted. >+ (WI.ColumnChart.prototype.needsLayout): Deleted. >+ (WI.ColumnChart.prototype.updateLayout): Deleted. >+ > 2019-02-01 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Make WI.StackedLineChart a WI.View subclass >diff --git a/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js b/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js >index c58fa8ba497..221d88f657c 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js >+++ b/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js >@@ -39,6 +39,7 @@ WI.CPUTimelineOverviewGraph = class CPUTimelineOverviewGraph extends WI.Timeline > > let size = new WI.Size(0, this.height); > this._chart = new WI.ColumnChart(size); >+ this.addSubview(this._chart); > this.element.appendChild(this._chart.element); > > this._legendElement = this.element.appendChild(document.createElement("div")); >diff --git a/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js b/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js >index 67ec984bea2..bfa868bbfab 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js >@@ -32,22 +32,23 @@ > // > // - There is a single rect for each bar. > // >-// <div class="line-chart"> >-// <svg width="800" height="75" viewbox="0 0 800 75"> >+// <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>)" /> > // ... > // </svg> > // </div> > >-WI.ColumnChart = class ColumnChart >+WI.ColumnChart = class ColumnChart extends WI.View > { > constructor(size) > { >- this._element = document.createElement("div"); >- this._element.classList.add("column-chart"); >+ super(); > >- this._svgElement = this._element.appendChild(createSVGElement("svg")); >+ this.element.classList.add("column-chart"); >+ >+ this._svgElement = this.element.appendChild(createSVGElement("svg")); > > this._columns = []; > this.size = size; >@@ -55,8 +56,6 @@ WI.ColumnChart = class ColumnChart > > // Public > >- get element() { return this._element; } >- > get size() > { > return this._size; >@@ -66,9 +65,7 @@ WI.ColumnChart = class ColumnChart > { > this._size = size; > >- this._svgElement.setAttribute("width", size.width); >- this._svgElement.setAttribute("height", size.height); >- this._svgElement.setAttribute("viewbox", `0 0 ${size.width} ${size.height}`); >+ this._svgElement.setAttribute("viewBox", `0 0 ${size.width} ${size.height}`); > } > > addColumn(x, y, width, height) >@@ -81,21 +78,15 @@ WI.ColumnChart = class ColumnChart > this._columns = []; > } > >- needsLayout() >+ // Protected >+ >+ layout() > { >- if (this._scheduledLayoutUpdateIdentifier) >+ super.layout(); >+ >+ if (this.layoutReason === WI.View.LayoutReason.Resize) > return; > >- this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this)); >- } >- >- updateLayout() >- { >- if (this._scheduledLayoutUpdateIdentifier) { >- cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier); >- this._scheduledLayoutUpdateIdentifier = undefined; >- } >- > this._svgElement.removeChildren(); > > for (let {x, y, width, height} of this._columns) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194171
:
360888
|
360890